• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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.
 
Switching from electric heat to a rocket mass heater reduces your carbon footprint as much as parking 7 cars. Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic