in u r configured context inside webapps..
edit u r main application's web.xml..and add the following lines...fort example..
<servlet>
<servlet-name>welcome</servlet-name>
<servlet-class>packagename.HelloWorld</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>welcome</servlet-name>
<url-pattern>/welcome</url-pattern>
</servlet-mapping>
remember u have to do like this for each servlet u deploy
-----Original Message-----
From: Peng Annie
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 15, 2003 3:37 PM
To: 'Tomcat Users List'
Subject: RE: servlet context, urgent !!!
Thanks. In the global web.xml or the one in MainApplication? Could you give
me an example how to register?
-----Original Message-----
From: Prashanth Gane [mailto:[EMAIL PROTECTED]]
Sent: 15. tammikuuta 2003 11:54
To: Tomcat Users List
Subject: RE: servlet context, urgent !!!
if u r using tomcat4.1.x then u have to register the servlet context inside
the web.xml or else the server will not recoginse...
-----Original Message-----
From: Peng Annie
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 15, 2003 3:15 PM
To: '[EMAIL PROTECTED]'
Subject: servlet context, urgent !!!
Hi,
I am useing Apache2, Tomcat4. Now I got a problem about the servlet context.
I have an main application which was configured to the DocumentRoot in
httpd.conf, and the alias of this main application is just under the url
root (http://servername/index.jsp will direct user to
webapps/MainApplication/index.jsp). The programe need to redirect user to
another application webapps/SecondApplication/, so in a servlet of the
MainApplication, I use the following statements:
ServletContext sc =
this.getServletConfig().getServletContext().getContext("/SecondApplication")
;
sc.getRequestDispatcher("/servlet/ControllerServlet").forward(request,
response);
But it doesn't work, I always get error
The requested resource (/servlet/ControllerServlet) is not
available.
It seems Tomcat4 tried to find this ControllerServlet in the
MainApplication. How can I get the context of SecondApplication? Should I do
sth with the web.xml?
By the way, the above way works fine on Tomcat3.2.
Please help, many thanks!
Annie
--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>