lozina
Lifer
I was hoping to get some help using struts...
firstly,
I want to be able to set a page variable within a nested logic tag and then test for that variable's value later. I cant figure out how to do this though...
as a pseduo code to get idea of what I am trying to do:
//some big nested logic tags
<s:set name="myVar" value="true"/>
// other code then closing the logic tags
<s:if test="%{myVar == 'true'}>
//do something
</s:if>
But I cannot figure out the correct syntax for this... If possible I'd rather not have to add a property to a bean but if that's the only way then so be it
secondly,
I have a page with a checkbox tied to a struts action form. But I want the checkbox to always show up as unchecked when the page loads, no matter what the value may be in the bean from last time. but it seems no matter what I do it always remembers the checkbox value if it was submitted with 'true' and then loads the page with it checked.
of course I could just hack the page by setting the property to false at the top of the page or just doing an onload javascript to say checked=false but is there a 'right' way to do this?
firstly,
I want to be able to set a page variable within a nested logic tag and then test for that variable's value later. I cant figure out how to do this though...
as a pseduo code to get idea of what I am trying to do:
//some big nested logic tags
<s:set name="myVar" value="true"/>
// other code then closing the logic tags
<s:if test="%{myVar == 'true'}>
//do something
</s:if>
But I cannot figure out the correct syntax for this... If possible I'd rather not have to add a property to a bean but if that's the only way then so be it
secondly,
I have a page with a checkbox tied to a struts action form. But I want the checkbox to always show up as unchecked when the page loads, no matter what the value may be in the bean from last time. but it seems no matter what I do it always remembers the checkbox value if it was submitted with 'true' and then loads the page with it checked.
of course I could just hack the page by setting the property to false at the top of the page or just doing an onload javascript to say checked=false but is there a 'right' way to do this?