Thank you for your response.
Correct me if I'm wrong, but the way I understand is that the
HttpServletResponse is not passed directly back to the calling client
(in my case the Applet.) Instead the server container sends to the
client what is written to the HttpServletResponse writer. In my case I
send either an Image object or a string. This means that the applet
does not have access to the servlets response object. Also the
getParameter method is not defined in HttpServletREsponse. It is only
defined in HttpServletRequest which is what I think is getting confused
here.
Anyhow,
thanks again.
anoop wrote:
> i think u can try getting the response.getParameter("some string ")
> method in ur applet code in the form of
>
> param name-value pairs like this..
>
>
>
> <param name=query value=<%=response.getParameter("some string ");%>
>
>
>
> tell me how this works...
>
> regards
>
> anoop
>
>
>
> ----- Original Message -----
>
> *From:*Travis Stevens <mailto:[EMAIL PROTECTED]>
>
> *To:*[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>
>
> *Sent:* Tuesday, January 01, 2002 1:32 AM
>
> *Subject:* maintaining session
>
>
> good day,
>
> I am creating an applet that is talking to a servlet and I am having
> problems maintaining session.
>
> The servlet returns two types of data, one is an Image, and the
> other is
> a String. To retrieve the Image, I us the applets getImage() method.
> The image I receive is different depending on the get parameters.
> Each
> time I use getImage, the session is maintained.
>
> The problem lies when asking the servlet to return a string. There is
> no nice getString method in the Applet class so I have to do this
> manually:
>
> try {
> System.out.println("sending string in getEnv"+sb.toString());
> //the url looks good
> URL envurl=new URL(sb.toString());
> BufferedReader bin = new BufferedReader(new
> InputStreamReader(envurl.openStream()));
>
>
> String line;
> while( (line = bin.readLine()) !=null){
> retsb.append(line); //retsb is a StringBuffer
> }
> }catch (MalformedURLException mue){
> System.err.println("bad url or something"+mue);
> }catch (IOException e){
> System.err.println("error in GetEnvelope" + e.toString());
> }
>
>
> Each time I do this call, a new session is created.
>
> Any ideas on what is going on and what I should do to get around this
> besides url rewriting.
>
> thanks,
> -Trav
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]> and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources:
> http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html