• 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
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

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
 
She'll be back. I'm just gonna wait here. With this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic