I have a web form such as:

<strutshtml:form action="/someAction" enctype="multipart/form-data">
   <strutshtml:text name="someForm" property="someProperty" size="10" value="???"/>
</strutshtml:form>

How can I set a default value for the text field, where the value I want is in a different session scoped ActionForm than the one named in the <strutshtml:text> tag? The only way I've been able to do it is saving a value as a session attribute and retrieving it with a scriptlet, like this:

<strutshtml:text name="someForm" property="someProperty" size="10" value="<%= (String)session.getAttribute("sessionAttributeValue") %>"/>

This approach works, but should I need to use a scriptlet and sessionAttributes to do this? I've heard that it's best to avoid putting scriptlet/java code in my jsp pages. What I'd like to do is reference the value in the existing session scoped ActionForm, such as:

<strutshtml:text name="someForm" property="someProperty" size="10" value=otherSessionScopedForm.someProperty/>

Can something like this be done?



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to