1) Your URL's look really strange. It looks as if your whole server
directory is exported visible through your server. I hope you know what you
are doing.
2) getRequestDispatcher(target)) only works within the servlet context (SC).
For resources outside the SC you might want to try
HttpResponse.sendRedirect( url ).
----- Original Message -----
From: "Xiongfei Wang" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 3:20 PM
Subject: RE: can servlet interact with html file in someplace other than c
urrent servlet context?
> Thanks for your advice.
> one more question is how to interact wiht static html?
> i have /var/www/html
> i have /var/www/servlet
> /var/www/servlet is current cotext of webapp
>
> I have servlet login, in login.java i have code like
> ------------------------------------------------------------
> private static final String TARGET_FILE="/var/www/html/index1.html";
> if( )
> {
> (req.getRequestDispatcher(target)).forward(req,res);
> return;
> }
> ----------------------------------------------------------------
> this code does not work because index1.html is outside /var/www/html
>
> how can i let servlets in /var/www/servlet interact with html files in
> /var/www/html?
>
> Thanks
>
>
> On Tue, 25 Feb 2003 [EMAIL PROTECTED] wrote:
>
> > Morning!
> >
> > Your code wouldn't work.
> >
> > Servlet should before to get context of the another webapp.
> >
> > .............
> > ServletContext webapp2context =
> > this.getServletContext().getContext(uri_path_to_wevapp2);
> >
> >
webapp2context.getRequestDispather("some_target_in_webapp2").forward(request
> > ,response);
> > .............
> >
> > Hope it help you.
> > ============================================
> > BeSt ReGaRdS level0 icq#155042687
> > -----Original Message-----
> > From: Xiongfei Wang [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, February 25, 2003 5:46 AM
> > To: Tomcat Users List
> > Subject: can servlet interact with html file in someplace other than
current
> > servlet context?
> >
> > My current servlet context is in
> > /home/jp/reg
> > I have a login(login.java) servlet in this context
> > In login.java i have code like
> > ------------------------------------------------------------
> > private static final String TARGET_FILE="/var/www/index.html";
> > if( )
> > {
> > (req.getRequestDispatcher(target)).forward(req,res);
> > return;
> > }
> > ----------------------------------------------------------------
> > t
> > his code does not work because index.html is outside /home/jp/reg
> >
> > Is there a way i can let login servlet interact with index.html?
> >
> > Thanks
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]