• Post Reply Bookmark Topic Watch Topic
  • New Topic

Pathing problem between JSP and Servlet  RSS feed

Ranch Hand
Posts: 210
Ruby Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need some help with relative pathing between JSP and Servlet.
Basically I have a bunch of JSP for the front end with
Servlets doing the business logic and manage trafic between
Anyway here's what's going on:
1. Initial page give some options of stuff to do using form
and submit it to a servlet, let say "servlet/options"
2. Base one the option, "servlet/options" forward it to another
JSP stuff for another form, let say "myform.jsp"
3. "myform.jsp" will take input and submit the result to
another servlet that process the input, let's call it
On step 2, I had tried both forwarding, and redirecting, also
tried encodeURL and encodeRedirectURL but the myform.jsp will
always load with the path still showing "http://myhost/servlet/options", so when it tried
to submit the data, since I use relative path in myform.jsp
it tried to look for "http://myhost/servlet/servlet/process"
which doesn't exist.
How can I fix this besides hardcoding the path?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!