tags:

views:

339

answers:

2

Hi,

I have the following in my jspx file:

<jsp:scriplet>
   int myvar = 2;
</jsp:scriptlet>

How can I put variable myvar into a textbox (id=myinput) value using JSTL or scriptlet (I can do this using session variable)

<input type="text" id="myinput" value="...the value of myvar..."/>

Thanks

+1  A: 
<input type="text" id="myinput" value="<%=myvar%>"/>
cherouvim
This does not work because it's a JSPX file, not JSP. Sorry it was not clear.
portoalet
A: 

Just a little typo in previous answer. Please use like this

<input type="text" id="myinput" value="<%=myvar%>"/>
lucentmind
thanks for the correction
cherouvim