struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antony Stace <s45652...@yahoo.com>
Subject Re: Using <logic:equals> tag around <html:form action.... > tag. Is it legal?
Date Wed, 20 Feb 2002 08:07:48 GMT
Hi Patrick

Thanks for all your help Patrick, I really appreciate it.  
Seeing your email made me try the code again, I am not sure why but when
I tryed the example lines this morning, I got and error.  Maybe I changed
something else somewhere.  If I have in my jsp code the following  

<logic:equal name="pageBean" property="typeOfProcess" value="new">
<bean:define id="formAction" value="processNewClient" />
<H1>NEW</H1>
</logic:equal>

<logic:equal name="pageBean" property="typeOfProcess" value="edit">
<bean:define id="formAction" value="processExistingClient" />
<H1>EDIT</H1>
</logic:equal>

<bean:define id="formAction" value="processExistingClient" />  -(1)
<html:form action='<%=formAction%>' focus="username">


with the line (1) in then the code works.  However,  if I do not have the
line (1) in then I get an error which I have put at the bottom of this
email.  I can verify that the code goes into the <logic:equals> sections
since when I run the code with line (1) in it then <H1>EDIT</H1> is displayed.

Any ideas?

Cheers

Tony

---------------snip start error message--------------------------
2002-02-20 17:01:46 action:  Validating input form properties
2002-02-20 17:01:46 action:  Looking for Action instance for class ClientEditAction
2002-02-20 17:01:53 ApplicationDispatcher[/sturdy] ?????? jsp ?Servlet.service()?????????
org.apache.jasper.JasperException: JSP????????????????: sun.tools.javac.Main ?????????


JSP????: /WEB-INF/pages/clientDetails.jsp ????: 32???????????

?????????????????:
/var/tomcat4/work/localhost/sturdy/WEB-INF/pages/clientDetails$jsp.java:1182: formAction ??????????
    _jspx_th_html_form_0.setAction(formAction);
                                   ^
??? 1 ?, ?? 1 ?

	at org.apache.jasper.compiler.Compiler.compile(Compiler.java)
	at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java)

----------------snip end error message----------------------

On Wed, 20 Feb 2002 08:32:35 +0100
Patrick Refondini <patrick.refondini@jpnet.ch> wrote:



> 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 <patrick.refondini@jpnet.ch> 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:struts-user-unsubscribe@jakarta.apache.org>
> >>For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>
> >>
> >
> >
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


-- 


Cheers

Tony。
---------------------------------------------------------------------


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
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