retrieve vector from applet.
hi all,
i have an jsp application, in which i am using an applet in one of my jsp. from my applet i am sending a large vector to my servlet. but i am not finding out a way to store that vector in such a way that later i can use those vectors in my jsp page.plz guide me how to proceed.
thanks in advance
[322 byte] By [
paridaa] at [2007-11-27 6:21:25]

# 2
> hi all,
> i have an jsp application, in which i am
> using an applet in one of my jsp. from my applet i
> am sending a large vector to my servlet. but i am
> not finding out a way to store that vector in such a
> way that later i can use those vectors in my jsp
> page.plz guide me how to proceed.
well only thing i can't understand here is how how is that you are sending a Vector from applet to servlet..
never mind as you have said you have collected a vector object in a servlet assuming that you redirect or forward that to the next JSP by storing that vector as an attribute in the scope of request/session/ServletContext(application)
-
--
-
--
public void doGet(req,res){
--
--
--
request.setAttribute("acquireVector",appletVector);
request.getRequestDispatcher("/someRandom.jsp").forward(req,res);
}
-
--
-
--
someRandom.jsp:
===============
-
--
-
--
<%
-
--
Vector vec = (Vector) request.getAttribute("acquireVector");
-
--
%>
if you want to know of how to do this using session you can take a look on your earlier post.
http://forum.java.sun.com/thread.jspa?threadID=5179536&tstart=0
hope that might help if that does,do not forget to assign duke stars to the ppl whom you feel have helped U :D
REGARDS,
RaHuL
# 3
hi rahul,
i have already done this but the problem is after forwarding the request to a particular jsp . i am not able to get the vector in any other jsp.
first what i am doing is forwarding the request to a jsp say 1.jsp. in 1.jsp i am able to get the vector. here again i am trying to save the vector in a session variable. but in any other jsp when i am trying to retrieve the vector it is giving null values to me.
plz suggest what shall i do.
thanx
# 4
>am trying to save the vector in a session variable
how is that you are saving it under session ?
It be gr8 if you explain all this by presenting a your code snippets.
where someone out here can get a gud idea to fix your issue.
and to my knowledge the only conditions where a session variable in one JSP doesn't work
1). the session attribute is removed from session.
2). the existing session is unbound / invalidated / timed out and a new session is being created in a new JSP
now inorder to overcome those
1). make sure you remove that attribute from session appropraitely.
2).
case 1: say the session is still active at the container side and a new session is being created make use of jsessionid to bind the newly created session to the existing by which you can overcome this problem.
case 2:where a request object is destroyed and a session object bound is destoryed at the container please look into the cases where this is happening you have no other scope of doing this my last advice would be making use of servletContext / application scope (It is termed as one of worst practices too)
Hope that might help :)
REGARDS,
RaHuL
# 5
hi rahul ,i believe its creating a new session when my servlet is sending to my jsp. so how shall i troubleshoot it or make out a problem.how to bind the jsession id. can u please give some code snippet which would give me some idea.thanks in advance.