struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Refondini <patrick.refond...@jpnet.ch>
Subject Re: Using <logic:equals> tag around <html:form action.... > tag. Is it legal?
Date Tue, 19 Feb 2002 11:05:27 GMT
the wrong syntax seems to come from my previous quick and dirty answer :(

Problems:
1. bean:define value must not be define as body content but as value 
attribute.
2. forget about action='<bean:write name="formAction">'  it compiles but 
the bean:write tag is not interpreted so at runtime the action looked 
for is <bean:write name="formAction">

This time I tested the following code sample, it works :)

    <bean:define id="formAction" value="/test" />

    <html:form action='<%=formAction%>' >
      (...)
    </html:form>

Hereafter corrections regarding your example

Antony Stace wrote:

>Hi 
>
>Can someone please give me the syntax for defining the action using the contents of
>formAction in the <html:form> line.
>
>><bean:define id="formAction" >defaultAction</bean:define>
>>
should become 
<bean:define id="formAction" value="defaultAction" />


>>
>>
>><logic:equal name="testPageBean" property="typeOfProcess" value="add">
>><bean:define id="formAction" >/addUser</bean:define>
>>
<bean:define id="formAction" value="/addUser" />


>>
>></logic:equal>
>>
>><logic:equal name="testPageBean" property="typeOfProcess" value="modify">
>><bean:define id="formAction" >/modifyUser</bean:define>
>>
<bean:define id="formAction" value="/modifyUser"/>

>>
>></logic:equal>
>>
>>
>><html:form action='<bean:write name="formAction">' focus="username">
>>or 
>><html:form action='<%=formAction%>' focus="username">
>>
This one should work 

<html:form action='<%=formAction%>' focus="username">


I hope this time your problem is solved ...

Patrick



--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message