Link to home
Start Free TrialLog in
Avatar of wallpaperpaste
wallpaperpaste

asked on

jsp session variables

Is it possible to insert a session variable as a value in a form? Ive tried this, it gets executed and the value is set buts its not inserted as a value in the form.

<% String p = (String)session.getAttribute("p");
out.print(p)
%>

<input type="text" name= "anam" size = "4" value = "€ "'+p+'"" >
Avatar of rrz
rrz
Flag of United States of America image

><input type="text" name= "anam" size = "4" value = "€ "'+p+'"" >
instead you could use  
<input type="text" name= "anam" size = "4" value ="<%= '€ ' + p %>" />
rrz
Avatar of wallpaperpaste
wallpaperpaste

ASKER

This is what im trying:
value ="<%= + pass %>" "

This is the error im getting:
operator + cannot be applied to java.lang.String


ASKER CERTIFIED SOLUTION
Avatar of rrz
rrz
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Got it with this:
value ="<%=pass %>

thanks