aspose file tools*
The moose likes Servlets and the fly likes href path changes in jsp on redirecting the servlet to that jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "href path changes in jsp on redirecting the servlet to that jsp" Watch "href path changes in jsp on redirecting the servlet to that jsp" New topic
Author

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

Keya Shah
Greenhorn

Joined: Sep 13, 2004
Posts: 3
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

Joined: Aug 02, 2004
Posts: 823
Change it to "/Main.jsp". That will probably work, though I'm not sure it's what you want.

Jules
Keya Shah
Greenhorn

Joined: Sep 13, 2004
Posts: 3
Had to specify the path as /CC/Main.jsp

Thanks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: href path changes in jsp on redirecting the servlet to that jsp