Hi there
I am trying to go through spring in action third edition.
I am trying to implement a basic login and url security. I am not getting any login page. Here is my web.xml
Here is my application context xml name servlet-context.xml
here is my security xml
I have two controller. for admin I have one controller
Besides telling that you want to use the SecuriltyDelegatingFilterProxy, you also have to map it to URLs in the web.xml file Usually to all the URLs like you did with the DispatcherServlet in the servlet-mapping.
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:251)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.33 logs.
rewati raman
Ranch Hand
Joined: May 22, 2010
Posts: 62
posted
0
I googled some stuff and changed my web.xml to this
The DispatcherServlet is loading the same config files. So now you have two copies of all those beans.
The DispatcherServlet should load the xml that contains web only components, spring beans.
The ContextLoaderListener should only load the xml that contains the middle tier spring beans.
You will get two ApplicationContexts, one a parent, one a child. and that is what you want.
You last error is that the URL request isn't formed correctly, or that you don't have a URL mapping to your Controller for that URL.
I recommend reading the Spring MVC sections in the Spring documentation to help explain it more.
Thanks
Mark
rewati raman
Ranch Hand
Joined: May 22, 2010
Posts: 62
posted
0
I dont think thats the issue, but still I changed it because that how it should be.
my new web.xml is
rewati raman
Ranch Hand
Joined: May 22, 2010
Posts: 62
posted
0
Its still not working what am i doing wrong. I read hundreds of blogs and forum but its still not working. I have posted my all configuration here. and all changes one by one. What am I doing wrong???
Ok, fine.. Yes, then you don't need to define login page in security context file.. In web.xml, you are mapping /admin1/* to spring security filter, so when you request for /admin, this filter is not applied..
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.