tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lessault Jean-Luc <JL.Lessa...@kheops.com>
Subject To keep beans sessions associated at jsp files in a servlet...hel p!
Date Fri, 12 Oct 2001 09:18:11 GMT

hi,
in order to make a web cache, I'm looking for to keep a answers local copy.
But I'm loosing beans sessions associated at jsp files " filename.jsp "
(line 5) 
in using the following code lines.Nevertheless the session servlet 
"request.getRequestedSessionId()" is the same.
Why? 

 public void makeTask( Task task){
    URL url=null;
    setStatus("good");
    try{
      url= new URL("http://localhost:8080/jspcontext/filename.jsp");
      URLConnection con=url.openConnection();
      con.connect();
      String contentType=con.getContentType();
      HttpURLConnection httpconn=(HttpURLConnection)con;
      if (httpconn.getResponseCode() == HttpURLConnection.HTTP_OK)
        if (contentType.startsWith("text/"))
        {
          returnURLText(con.getInputStream(),contentType);
        }  
      }
    }
    catch(MalformedURLException mue) 
    {...}
    catch(Exception e)
    {...}
 }
  
  public void returnURLText(InputStream instream, String contentType){
     InputStream in=null;
     String text="";
     try{
       InputStreamReader isr= new InputStreamReader(instream);
       BufferedReader in= new BufferedReader(isr);
       Html_Parser parser=new Html_Parser(in);    
       text=parser.parse();
       setResponse(text, contentType));
       in.close();
       isr.close();
     }
     catch(IOException ioe){
       System.out.println("IOException"+ ioe.toString());
     }
   }
   
I note, I keep sessions in using
 
"getServletContext().getRequestDispatcher("/fileName.jsp").forward(request,r
esponse);"
 unfortunately this method not allowed to keep a local copy.

I would be very happy if someone say me a solution and why not, give me code
lines tosolve this problem.

Thanks to all, in advance.  
 


Mime
View raw message