Yeah. I thought he wouldn't need it based on what was posted. But reading the log, there is a lot that was not posted. There was a lot more to the configurations, classes, etc. And since it wasn't posted that he had Services and other beans that would be needed in other Controllers etc, I assumed what he posted was all that was in his app.
But, if you look at the log line right above the stack trace, like line 120, it says
GRAVE: No WebApplicationContext found: no ContextLoaderListener registered?
Difference is two different ApplicationContexts created. One to store your middle tier beans, and one for your web tier beans. The servlet-class is for your web-tier beans. Controllers, ViewResolvers. the listener class creates an ApplicationContext for your middle tier beans and gets stored in the ServletContext for all Servlets to get access to it, including all your web tier beans.
In your web.xml you have a servlet-class to create an ApplicationContext for your middle tier beans that won't be accessable by your two other DispatcherServlet. That one should be with the listener-class ContextLoaderListener.
On another note. this is one web application. So you only need one DispatcherServlet in the web.xml and servlet mapping to all URLs for your application. The more specific distinct URLs are then mapped to Controller methods with your @RequestMapping in your Controllers.
I recommend you pick up a copy of Spring In Action 3rd edition, or the Spring documentation. Be careful of tutorials/blog posts because they tend to show bad practices, use older styles and are sometimes just wrong.
thanks for your help, i downloaded the pdf spring in action 3rd edition.
So i change my code but i've an error404 with this log error:
Here is the link i call :
and my controller:
my class User
and finally my mapge createUser.jsp that is under user/
i suppose it's a silly mistake but i can't find.
thanks to unblock me
posted 7 years ago
I can do a sample that work and my mistake was the value of my @RequestMapping (my file is under the directory user.
it works with an hyperlink to the address /user/createUser.jsp but how can i do with a frame (createUSer.sjp) include in my index.jsp
Get me the mayor's office! I need to tell him about this tiny ad: