Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is it possible in JSP?

 
Gaurav Chikara
Ranch Hand
Posts: 412
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have created a session object in JSP thru this snippet
<% HttpSession ses = request.getSession(true);
Vector v = new Vector();
ses.putValue("MyVector",v1);
%>
and i also have included the java.util package like this
<%@ page language = "java" import="java.util.*" %>
everything runs fine except the code line
ses.putValue("MyVector",v1);
it gives internal server error on this line and if i comment it it runs fine i tried using ses.setAttribute("MyVector",v1) also
but still internal server error come and page is not displayed
I jus want to know is it possible to put value in session variable in the way i am trying to do
any comments or suggestions will be appreciated
thnkx in advance
Gaurav
 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to your code, the Vector's reference is "v", not "v1".
 
Gaurav Chikara
Ranch Hand
Posts: 412
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry it was a typo error
but wht i want to know is till unanswered?
your profile says that you are sheriff
can you clarify my doubt
Originally posted by Tony Alicea:
According to your code, the Vector's reference is "v", [b]not "v1". [/B]

 
Tushar Kansara
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gaurav,
I am making a wild guess here.
Your server does not support the latest Servlet Apis.
If ur usinfg jws, then pls ensure that u plug in the servlet.jar in the classpath of the jws,
Also if u can let us know what is being printed on the server console it would be a great help,
I also suggest put the above code in try catch block and print the exception if ur not doing it now.

Regards
Tushar Kansara
------------------
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic