You have to look at it from the client side since that's where the path to the resource is constructed. If you'd like the more stable server relative path to a form, then do this in your jsp:

<form name="form1" method="post" action="${request.contextPath}/control">
    .... form body ......
</form>

${request.contextPath} returns the server relative path of your webapp and you can tack on any webapp relative path you need.

--David

Uma Kalluru wrote:
Hi,

I have a servlet defined in web.xml and this is how I defined it

    <servlet>
        <servlet-name>controllerServlet</servlet-name>
        <servlet-class>
            tests.servlets.ControllerServlet
        </servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>controllerServlet</servlet-name>
        <url-pattern>/control</url-pattern>
    </servlet-mapping>


I am trying to call this servlet from a JSP page using HTML form.

<form name="form1" method="post" action="../control">

</form>

The above form call works but why should I give ../control? And this
is relative path to the context. It never works if I give "control".

I have not enabled invoker servlet in conf/web.xml. Am I missing any
setting? I am using Tomcat 5.0.28

Thanks
Uma

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to