You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Shruti Ahuja, Noida" <sh...@noida.hcltech.com> on 2002/11/11 07:27:14 UTC
servlet mapping
Hi,
I have deployed a web appplication whose context name is graduate . It has 2
servlets(named auditor and blobserve) in it placed in the Web-inf/classes
directory .
I have mapped the 2 servlets in web.xml as follows -
<servlet>
<servlet-name>auditor</servlet-name>
<servlet-class>auditor</servlet-class>
</servlet>
<servlet>
<servlet-name>blobserve</servlet-name>
<servlet-class>blobserve</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>auditor</servlet-name>
<url-pattern>/auditor</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>blobserve</servlet-name>
<url-pattern>/blobserve</url-pattern>
</servlet-mapping>
Now, i wish to invoke the auditor servlet in the jsp page as follows -
<FORM METHOD="GET" ACTION="/auditor">
The above does not work . When called it removes the context name from the
URL .
However , the following works -
<FORM METHOD="GET" ACTION="servlet/auditor">
What should i change in the web.xml or the jsp page so that i can invoke the
servlet without the /servlet clause.
Pls suggest ..
Thanks
Shruti.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: servlet mapping
Posted by Kwok Peng Tuck <pe...@makmal.com>.
Try without the forward slash . So it looks like this:
<FORM METHOD="GET" ACTION="auditor">
Shruti Ahuja, Noida wrote:
>Hi,
>
>I have deployed a web appplication whose context name is graduate . It has 2
>servlets(named auditor and blobserve) in it placed in the Web-inf/classes
>directory .
>I have mapped the 2 servlets in web.xml as follows -
> <servlet>
> <servlet-name>auditor</servlet-name>
> <servlet-class>auditor</servlet-class>
> </servlet>
> <servlet>
> <servlet-name>blobserve</servlet-name>
> <servlet-class>blobserve</servlet-class>
> </servlet>
> <servlet-mapping>
> <servlet-name>auditor</servlet-name>
> <url-pattern>/auditor</url-pattern>
> </servlet-mapping>
> <servlet-mapping>
> <servlet-name>blobserve</servlet-name>
> <url-pattern>/blobserve</url-pattern>
> </servlet-mapping>
>
>Now, i wish to invoke the auditor servlet in the jsp page as follows -
><FORM METHOD="GET" ACTION="/auditor">
>The above does not work . When called it removes the context name from the
>URL .
>However , the following works -
><FORM METHOD="GET" ACTION="servlet/auditor">
>What should i change in the web.xml or the jsp page so that i can invoke the
>servlet without the /servlet clause.
>
>Pls suggest ..
>
>Thanks
>Shruti.
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>