| Author |
Populating actionform elements outside html:form etc
|
darin sanana
Greenhorn
Joined: Sep 02, 2005
Posts: 2
|
|
Hello all, let's say I have a action form called FoobarForm that populates <html:form> but I wan't to write some of the elements outside of the form. E.g: some static values that cannot be changed (#ID, etc ... ) Is there some way to do this ? (<bean:write name="???" .. ), or is the only way to put the FoorbarForm also to the request scope (request.setAttribute("")) Another question is about the <logic:iterate>-tag. Is there any way to limit the amount on iterations ? For example, If I want to iterate only the first five elements. How about a situation where there is only one element to be iterated. Do I have to use <logic:iterate> then also or is there any alternative method to print the element ? Thanks.
|
 |
Marc Peabody
pie sneak
Sheriff
Joined: Feb 05, 2003
Posts: 4725
|
|
You can use bean:write and specify the name of the form that you used in the struts-config.xml. <bean:write name="myFormName" property="myValue"/> You could also use JSTL <c ut value='${myFormName.myValue}'/> As far as your logic:iterate question... why would you use a collection when you know you have only one element? There's nothing to iterate over.
|
A good workman is known by his tools.
|
 |
 |
|
|
subject: Populating actionform elements outside html:form etc
|
|
|