passing parameters - urgent please
Dear friends,
In my first.jsp file i am passsing a emailaddress to second.jsp
thru url. second.jsp is receiving the emailaddress using request.getparameter.
However i have somany parameters like email. and i have hide these parameters, in which the user cannot see in the url bar.
please help me how can i hide the parameters like (email..etc.,)
first.jsp
<a href="second.jsp?email=<%=emailaddress%>">Test</a>
second.jsp
String getemailid=request.getParameter("email");
out.println("My name is : "+getemailid);
thank you for your cooperation
Yours
rajesh
Dear Friend,
Thank you very much for ur cooperation.
I am assing the parameters using a session.
I need to pass a int value also, along with strings.
When i am trying to pass integer parameter..it is saying error like
Incompatible type for method. Can't convert int to java.lang.Object.
please help me how can i put integet value in a session.
Thanks in advance.
Looking to hearing from u again
Yours
Rajesh
You have to convert the primitive int type into an object and to do this you should use the Integer class. e,g, session.putValue("integernumber", new Integer(int) ) and if you need the number you should get the value of the integer by using the Integer.intValue() method.
I set the integer value in a session as like this (in my first.jsp)
session.putValue("integernumber", new Integer(10) ) ;
in my second.jsp i am using like this to get that integer value.
int counter = Integer.intValue(session.getAttribute("integernumber"));
but in second.jsp it is saying the error as "Wrong number of arguments in method.
"
please help me whats wrong here.
Thanks in advance.
really looking for ur idea.
Dear MinaGavinmaur and Ps,
Thank you for your valuable suggestions. Now my problem is solved.
Once again thanks a lot for fast replies.
If you need any assistance please contact me at getfastreply@hotmail.com
Yours
Rajesh
> intValue() doesn't have an input parameter so it
> should be written as:
>
> Integer intObj = (Integer)
> session.getAttribute("integernumber");
> int counter = intObj.intValue();
>
>