• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Page redirect not working

 
Ranch Hand
Posts: 367
Eclipse IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

In the below program, when I submit the login.jsp page, I get the "org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/Bookstore/index] in DispatcherServlet with name 'appServlet' message.The index.jsp page is in WEB-INF/views folder.

If I write return "index" instead of "redirect:/index" it works fine. Also If I move the index.jsp page out of the WEB-INF/views folder and keep it inside WebContent, it works fine when written as return "index.jsp". So how to redirect to a different page which is inside WEB-INF/views folder.

the WEB-INF/spring/appServlet/servlet-context.xml is as follows :
Please advise.
 
pramod talekar
Ranch Hand
Posts: 367
Eclipse IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Also If I move the index.jsp page out of the WEB-INF/views folder and keep it inside WebContent, it works fine when written as return "index.jsp".


Here, it works fine when written as return "redirect:/index.jsp".

I found out the answer for this problem.
The dispatcher servlet couldn't locate any mapping for /Bookstore/index. So I modified the LoginController class


The only problem I see here is that the LoginController class has no more @RequestMapping available.
However, the tutorial I'm following has got the program running without this modification.
 
Creativity is allowing yourself to make mistakes; art is knowing which ones to keep. Keep this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic