I have copy pasted your lines : <bean:define id="formAction" value="/test" /> <%=formAction%><br /> <%= 1+1 %><br /> <bean:write name="formAction" filter="true" /><br />
and I obtain the expected output: /test 2 /test The error must come from elsewhere. What error do you obtain ? Patrick Antony Stace wrote: >Thank you very much for your reply Patrick. > >I got an error with the <%=formAction%> line. As test I tried > ><bean:define id="formAction" value="/test" /> ><%=formAction%> > >in my jsp page, I always get an error, it is strange since > ><%= 1+1 %> and ><bean:write name="formAction" filter="true" /> > >works fine. Any ideas why > ><%=formAction%> > >is giving an error? > >Cheers > >Tony > > > > >On Tue, 19 Feb 2002 12:05:27 +0100 >Patrick Refondini <[EMAIL PROTECTED]> wrote: > >>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:[EMAIL PROTECTED]> >>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> >> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>