> I want to initialize the fields of a Struts Form with the <html:text>-Tag.

> In my request there is a bean with the getter and setter I need. Now I
tried this:
> <html:text value="<bean:write name="myLink" property="URL"/>"
property="URL" 
> size="25" maxlength="256"></html:text>

You cannot nest tags like that.  Populate the form bean's URL property with
the correct value in the action, then forward to the JSP and Struts will
automatically generate the HTML with the 'value' attribute:

   formBean.setURL( "http://blah.blah.blah );
   <html:text property="URL" />

I'm not sure what the JavaBeans spec says about all upppercase property
names... If the above doesn't work, change the property to 'url' and use
setUrl().

If that doesn't fit your needs, take a look at the Struts-EL tags in the
'contrib' directory.

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management

Reply via email to