• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Does value in @RequestMapping and the viewName parameter of ModelAndView need to be same.

 
Ranch Hand
Posts: 78
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



HomeController.java


forward.jsp



xxxxx-servlet.xml



The problem is it says home.jsp not found. But in HomeController.java in ModelAndView I am redirecting it to login. It should redirect to login.jsp. If I am wrong anywhere please let me know. Any help will be appreciated.
 
Ranch Hand
Posts: 672
4
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are redirecting *.do to DispactherServlet, but have configured /home as requestmapping, you can change it to /home.do in the requestmapping of the controller and check.
 
jas preet
Ranch Hand
Posts: 78
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem was in the servlet xml file. I used


and it worked fine. in forward.jsp i am sending request as home.do
So home.do executes my method


and from there it takes it to my login page with the message being printed.

Thank you for all your help.
 
Power corrupts. Absolute power xxxxxxxxxxxxxxxx is kinda neat.
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!