You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Holger Wiechert <hw...@iks-gmbh.com> on 2001/07/23 18:52:15 UTC

Howto: Accessing values of a Form in the JSP directly?

Is there a way of accessing form data directly within a JSP page?
I want to insert a text into my html code by asking the form for
this value.
Let's assume, I have a JSP myPage.jsp that uses MyForm with a field
myValue.
How can I say something like:
<bean:write name="TheMyForm_Object" property="myValue"/>

Thanks in advance,
Holger



Re: Howto: Accessing values of a Form in the JSP directly?

Posted by Ted Husted <hu...@apache.org>.
<bean:write name="MyForm" property="myValue"/>

If "MyForm" is the name giuven in the Struts config file.

Struts will instantiate the ActionForm for a mapping either when the
Action is called or when the html:form tag is rendered. 

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 737-3463.
-- http://www.husted.com/about/struts/


Holger Wiechert wrote:
> 
> Is there a way of accessing form data directly within a JSP page?
> I want to insert a text into my html code by asking the form for
> this value.
> Let's assume, I have a JSP myPage.jsp that uses MyForm with a field
> myValue.
> How can I say something like:
> <bean:write name="TheMyForm_Object" property="myValue"/>
> 
> Thanks in advance,
> Holger