spring-projects / spring-projects/spring-ldap

How to load spring-ldap.xml beans without web.xml

Open
#12 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
375
Forks
501
Avg merge
6h 4m
Merged PRs (30d)
63

Description

Hi I'm creating simple user managment system with spring web-mvc + spring-ldap.
Luckily the sample project is available ( https://github.com/spring-projects/spring-ldap/tree/master/samples/user-admin ) for my task. It references spring-ldap.xml in web.xml

But there are some issues. I'm following this sample for web-rest UI project (http://spring.io/guides/gs/rest-service/) but the page mentions that there is no need for web.xml.
So can you suggest me a way to load beans and autowire them from spring-ldap.xm l without web.xml.
Currently I'm loading "LdapTemplate" at many places by repeating my code.
'context = new ClassPathXmlApplicationContext("springldap.xml");
ldapTemplate = (LdapTemplate) context.getBean("ldapTemplate");'

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the sample project's web.xml and spring-ldap.xml with the REST service guide referenced in the issue. Identify the supported application entry point and bean-loading configuration, then document how LdapTemplate can be injected without repeating ClassPathXmlApplicationContext calls. No test or target documentation file is mentioned.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.