• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

href path changes in jsp on redirecting the servlet to that jsp

 
Keya Shah
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My servlet gets redirected properly to a jsp page(MyPage.jsp), but clicking the links on that jsp page fails.

Get the error:
The requested resource (/CC/servlet/Main.jsp) is not available.

In MyPage.jsp page, the link is defined as follows:
<a href="Main.jsp">Back to Main Page</a>

but after the servlet redirects to MyPage.jsp, the link now have the servlet path attached to it(becomes http://localhost:8080/CC/servlet/Main.jsp instead of just Main.jsp), resulting in the above error when i click it.

I am a newbie, so any help is greatly appreciated.
 
Julian Kennedy
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Change it to "/Main.jsp". That will probably work, though I'm not sure it's what you want.

Jules
 
Keya Shah
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Had to specify the path as /CC/Main.jsp

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic