tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Xiongfei Wang <wan...@arches.uga.edu>
Subject RE: can servlet interact with html file in someplace other than c urrent servlet context?
Date Tue, 25 Feb 2003 14:20:07 GMT
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 TO_Valery@BelPost.by 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:wangxf@arches.uga.edu] 
> 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: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message