Forums Register Login

How to use Relative path for a servlet (Using Tomcat server)

+Pie Number of slices to send: Send
I am new to servlets.

I am trying to call my servlet from a HTML form. I dont want to use full url in action tag that will point to my servlet. I want to use relative path.

I am using tomcat 6 web server. If I am giving relative path in Action tag of HTML form, it is searching in C:\myApp\Servlet.

Please help me how I can use relative path in Tomcat server. If these is any other setting needs to be done for my application folder for relative path.


Thanks in advance.
+Pie Number of slices to send: Send
There is nothing Tomcat specific about this.

Your URLs should be server-relative and never page-relative. That is, they should start wit the the context path. See the JspFaq for details.
+Pie Number of slices to send: Send
 

Bear Bibeault wrote:There is nothing Tomcat specific about this.

Your URLs should be server-relative and never page-relative. That is, they should start wit the the context path. See the JspFaq for details.



It would be helpful if you can give an example HTML form calling a servlet.
Opportunity is missed by most people because it is dressed in overalls and looks like work - Edison. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 2302 times.
Similar Threads
CSS is not coming into effect
specifiying URI
server to server call
problem in form action tag
servlet beginner confused
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 06:43:51.