struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Max Cooper" <...@maxcooper.com>
Subject Re: Using variable on JSP Page
Date Tue, 22 Jul 2003 11:28:36 GMT
Anubhav,

Here is an HTML text input field with the name defined by the Java variable
'name', which is set to the value "notKnownInAdvance" inside the JSP page:

<% String name = "notKnownInAdvance"; %>
<input type="text" name="<%=name%>">

It will render like this in the resulting HTML page:

<input type="text" name="notKnownInAdvance">

This is not Struts-specific in any way. If you need a more "Strutsy" answer,
please describe more about how the value is used. For example, how will it
get populated in the ActionForm when a user submits the form? Are you using
DynaForms?

-Max

----- Original Message ----- 
From: "Anubhav Kale" <anubhav_kale@persistent.co.in>
To: <struts-user@jakarta.apache.org>
Sent: Tuesday, July 22, 2003 12:51 AM
Subject: Using variable on JSP Page


> Hello.
>
> I want to create a text box on JSP page and give it a name which is stored
> in the VARIABLE say 'name'.  This variable is defined in the java code on
> the JSP page.
>
> Can you please tell me the EXACT syntax ?
>
> PLEASE NOTE THAT I WANT TO GIVE NAME TO TEXT BOX THRU MY CODE. So the name
> is in variable and not known beforehand
>
> Thanks a lot
>
> Anubhav
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message