• 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
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Had to specify the path as /CC/Main.jsp

Thanks
 
This tiny ad is wafer thin:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic