Re: Using logic:equals tag around html:form action.... tag. Is it legal?
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]
Re: Using logic:equals tag around html:form action.... tag. Is it legal?
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] -- Cheers Tony$B!#(B - _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Using logic:equals tag around html:form action.... tag. Is it legal?
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]
Re: Using logic:equals tag around html:form action.... tag. Is it legal?
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" / H1NEW/H1 /logic:equal logic:equal name="pageBean" property="typeOfProcess" value="edit" bean:define id="formAction" value="processExistingClient" / H1EDIT/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 H1EDIT/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 [EMAIL PROTECTED] 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 [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] -- Cheers Tony$B!#(B - _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Using logic:equals tag around html:form action.... tag. Is it legal?
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 logic:equal name=testPageBean property=typeOfProcess value=add bean:define id=formAction /addUser/bean:define /logic:equal logic:equal name=testPageBean property=typeOfProcess value=modify bean:define id=formAction /modifyUser/bean:define /logic:equal html:form action='bean:write name=formAction' focus=username or html:form action='%=formAction%' focus=username I get errors when I try and use the above two ways to try and define the action. Cheers Tony Patrick Antony Stace wrote: Hi Ladies and Gentlemen I want to use logic:equals tags around a html:form action but I am having errors. I am not sure if this is allowed in struts. Can someone please confirmthat this is not or is allowed in struts. The code I have is --snip logic:equal name=testPageBean property=typeOfProcess value=add html:form action=/addUser focus=username /logic:equal logic:equal name=testPageBean property=typeOfProcess value=modify html:form action=/modifyUser focus=username /logic:equal rest of form definition --snip- The error I am getting is org.apache.jasper.compiler.ParseException: /WEB-INF/pages/clientDetails.jsp(21,0) ??: lt;/logic:equalgt; ??? at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java) at org.apache.jasper.compiler.Parser.parse(Parser.java) at org.apache.jasper.compiler.Parser.parse(Parser.java) at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java) at org.apache.jasper.compiler.Parser.parse(Parser.java) at org.apache.jasper.compiler.Parser.parse(Parser.java) at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java) at org.apache.jasper.compiler.Parser.parse(Parser.java) at org.apache.jasper.compiler.Parser.parse(Parser.java) at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java) at org.apache.jasper.compiler.Parser.parse(Parser.java) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Using logic:equals tag around html:form action.... tag. Is it legal?
logic:equal html:form /html:form /logic:equal is valid xml should work (never done it myself). logic:equal html:form /logic:equal /html:form isnt valid xml. But this means you'll have a large piece of duplicated jsp code. In my limited experience when I hit this situation I have 2 JSP's, I find lots of code inside logic tags very nasty. Actually you could probably use struts include to hold the duplicated bit. Does any-one know if you can have form fields inside an include? --- Antony Stace [EMAIL PROTECTED] wrote: Hi Ladies and Gentlemen I want to use logic:equals tags around a html:form action but I am having errors. I am not sure if this is allowed in struts. Can someone please confirmthat this is not or is allowed in struts. The code I have is --snip logic:equal name=testPageBean property=typeOfProcess value=add html:form action=/addUser focus=username /logic:equal logic:equal name=testPageBean property=typeOfProcess value=modify html:form action=/modifyUser focus=username /logic:equal rest of form definition --snip- The error I am getting is org.apache.jasper.compiler.ParseException: /WEB-INF/pages/clientDetails.jsp(21,0) ??: lt;/logic:equalgt; ??? at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java) at org.apache.jasper.compiler.Parser.parse(Parser.java) at org.apache.jasper.compiler.Parser.parse(Parser.java) at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java) at org.apache.jasper.compiler.Parser.parse(Parser.java) at org.apache.jasper.compiler.Parser.parse(Parser.java) at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java) at org.apache.jasper.compiler.Parser.parse(Parser.java) at org.apache.jasper.compiler.Parser.parse(Parser.java) at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java) at org.apache.jasper.compiler.Parser.parse(Parser.java) -- Cheers Tony¡£ - _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Got something to say? Say it better with Yahoo! Video Mail http://mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Using logic:equals tag around html:form action.... tag. Is it legal?
Hi Antony, I guess you are not allowed to enclose a tag start within a logic tag whithout enclosing the tag end as well. This leads to : logic:equal name="testPageBean" property="typeOfProcess" value="add" html:form action="/addUser" focus="username" ... /html:form /logic:equal Of course if the only difference in your forms (addUser, modifyUser) are the form action attribute it will duplicate a lot of code. In this case as action attribute is a RunTime Expression you might deal with something like : bean:define id="formAction" defaultAction/bean:define logic:equal name="testPageBean" property="typeOfProcess" value="add" bean:define id="formAction" /addUser/bean:define /logic:equal logic:equal name="testPageBean" property="typeOfProcess" value="modify" bean:define id="formAction" /modifyUser/bean:define /logic:equal html:form action='bean:write name="formAction"' focus="username" or html:form action='%=formAction%' focus="username" I am not sure about syntax ... but this is the idea Patrick Antony Stace wrote: Hi Ladies and Gentlemen I want to use logic:equals tags around a html:form action but I am having errors. I am not sure if this is allowed in struts. Can someone please confirmthat this is not or is allowed in struts. The code I have is --snip logic:equal name="testPageBean" property="typeOfProcess" value="add" html:form action="/addUser" focus="username" /logic:equal logic:equal name="testPageBean" property="typeOfProcess" value="modify" html:form action="/modifyUser" focus="username" /logic:equal rest of form definition --snip- The error I am getting is org.apache.jasper.compiler.ParseException: /WEB-INF/pages/clientDetails.jsp(21,0) ??: lt;/logic:equalgt; ??? at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java) at org.apache.jasper.compiler.Parser.parse(Parser.java) at org.apache.jasper.compiler.Parser.parse(Parser.java) at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java) at org.apache.jasper.compiler.Parser.parse(Parser.java) at org.apache.jasper.compiler.Parser.parse(Parser.java) at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java) at org.apache.jasper.compiler.Parser.parse(Parser.java) at org.apache.jasper.compiler.Parser.parse(Parser.java) at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java) at org.apache.jasper.compiler.Parser.parse(Parser.java) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Using logic:equals tag around html:form action.... tag. Is it legal?
What exactly does this do? What is logic:equal comparing? Mark -Original Message- From: Keith [mailto:[EMAIL PROTECTED]] Sent: Friday, February 15, 2002 4:43 AM logic:equal html:form /html:form /logic:equal -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Using logic:equals tag around html:form action.... tag. Is it legal?
cripes - no wonder it doesn't work - some-one nicked the end off my lines. looking at it closely someones nicked all me form fields as well. better install CVS. Mark's getting stroppy on Friday again. Most welcome. --- Galbreath, Mark [EMAIL PROTECTED] wrote: What exactly does this do? What is logic:equal comparing? Mark -Original Message- From: Keith [mailto:[EMAIL PROTECTED]] Sent: Friday, February 15, 2002 4:43 AM logic:equal html:form /html:form /logic:equal -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Got something to say? Say it better with Yahoo! Video Mail http://mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Using logic:equals tag around html:form action.... tag. Is it legal?
When I ran into that issue, I just used two action mappings -- "/editUser" to initialize the form (including an action property that identified add vs. edit) and forward that to the .jsp. And in the .jsp form tag I used "/storeEditUser" to process the results. Antony Stace wrote: Hi Ladies and Gentlemen I want to use logic:equals tags around a html:form action but I am having errors. I am not sure if this is allowed in struts. Can someone please confirmthat this is not or is allowed in struts. The code I have is --snip logic:equal name="testPageBean" property="typeOfProcess" value="add" html:form action="/addUser" focus="username" /logic:equal logic:equal name="testPageBean" property="typeOfProcess" value="modify" html:form action="/modifyUser" focus="username" /logic:equal rest of form definition --snip- The error I am getting is org.apache.jasper.compiler.ParseException: /WEB-INF/pages/clientDetails.jsp(21,0) ??: lt;/logic:equalgt; ??? at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java) at org.apache.jasper.compiler.Parser.parse(Parser.java) at org.apache.jasper.compiler.Parser.parse(Parser.java) at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java) at org.apache.jasper.compiler.Parser.parse(Parser.java) at org.apache.jasper.compiler.Parser.parse(Parser.java) at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java) at org.apache.jasper.compiler.Parser.parse(Parser.java) at org.apache.jasper.compiler.Parser.parse(Parser.java) at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java) at org.apache.jasper.compiler.Parser.parse(Parser.java) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]