Re: Struts tag problem (bean:message and bean:write)
Hello Marco, maybe this will help (using struts-el): bean-el:message key='prompt.productType.${product.productType}'/ Dima. Thursday, March 25, 2004, 6:02:54 PM, you wrote: MM Hi all, MM I was wondering if anyone of you have a solution MM For this dilemma. MM I have a collectin of product DTOs to show on my jsp. One of MM DTO's property is, let's say, the type, which is listed in number. MM (let's say, 10 or 20). MM ON the DTO I will have the value 10,20 ecc but on the jsp I have to MM display MM The corresponding string (let's say, HouseProduct or Car or something MM else) which is listed in application.resources. MM I am looping thru the collection using logic:iterate, and MM as I have found out myself, following code does not work MM bean:message key='prompt.productType.bean:write name=product MM property=productType'/ MM basically in app.resources I will have MM prompt.productType.10=HouseProduct MM prompt.productType.20=Car MM etc.. MM above, I am outputting the message prompt.productType.(productType) MM how can I solve my dilemma, keeping in mind that I am using also MM logic:iterate to loop thru the collection? MM With best regards MM marco MM - MM To unsubscribe, e-mail: [EMAIL PROTECTED] MM For additional commands, e-mail: [EMAIL PROTECTED] -- Best regards, Dmitriimailto:[EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: access variable value in html tag
Hallo together, Thx, for the help. I installed the Tomcat v5.x engine and now it's working like you guys suggested without EL. Regards Joern -Original Message- From: Brian Buchanan [mailto:[EMAIL PROTECTED] Sent: Dienstag, 23. März 2004 15:12 To: Struts Users Mailing List Subject: RE: access variable value in html tag The Struts-EL is what I'd recommend, which supports exactly what you want to do, unless you're into (Tomcat 5 and the) JSP 2.0 then you'd just do: option value=${accounts.number}${accounts.number}/option Otherwise I _think_ I've done this nastiness and it worked, but I might have been doing it with plain HTML (non-struts tags): html:option value=c:out value=${accounts.number}/c:out value=${accounts.number}//html:option ._. -Original Message- From: Steltner, Joern [mailto:[EMAIL PROTECTED] Sent: Friday, March 19, 2004 7:28 AM To: [EMAIL PROTECTED] Subject: access variable value in html tag Dear, I'm not an expert in Struts and Java. I need some simple help: html:select property=no_account c:forEach var=accounts items=${Accounts} varStatus=status html:option value=c:out value=${accounts.number}/html:option /c:forEach /html:select Everything works fine, but at ??? mark I would like take account.no_account like ${accounts.number}, but it doesn't work. May someone can give me a small note about the right syntax to get the value from accounts.number as text in the quotes. Thanks Regards J. Steltner - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
custom tag called with bean properties as attributes
Hello, I'm trying to iterate through a collection of beans and call a custom tag for each bean. logic:iterate id=dezeSchaal name=%=Risc.BEREKENING% property=profielSchalen / risc:staaf schaal_nummer=bean:write name=dezeSchaal property=schaalNummer/ schaal_naam=bean:write name=dezeSchaal property=schaalNaam/ ruwe_score=bean:write name=dezeSchaal property=ruweScore/ gewogen_score=bean:write name=dezeSchaal property=gewogenScore/ max_geen_risico=bean:write name=dezeSchaal property=maxGeenRisico/ max_weinig_risico=bean:write name=dezeSchaal property=maxWeinigRisico/ max_veel_risico=bean:write name=dezeSchaal property=maxVeelRisico/ breedte_geen_risico=100 breedte_weinig_risico=100 breedte_veel_risico=100 hoogte=21 / /logic:iterate Now I get the error message: org.apache.jasper.JasperException: /form/profiel.jsp(72,46) equal symbol expected org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler. java:83) ... I think it has to do with the order of expanding of the tags, I hoped that my custom tag would be called with the expanded bean:write values, but it doesn't seem to be the case. I tried all varieties for the fragment and rtexprvalue attributes for the tag. Maybe anyone has an idea how I can best handle this? If anyone recommends a different approach, I'll be most interested to hear about it. Kind regards, Jeroen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: custom tag called with bean properties as attributes
risc:staaf schaal_nummer=bean:write name=dezeSchaal property=schaalNummer/ This is a standard tag nesting error. You can't put tags inside of tag attributes. You CAN put scriptlets, such as your first tag... logic:iterate id=dezeSchaal name=%=Risc.BEREKENING% property=profielSchalen / ...The key is that you have quotes inside of quotes. When I need to do something similar to what you are, I include the standard name and property attributes as used by bean write. Doing this, your first tag would become risc:staaf name=dezeSchaal property=schaalNummer / And in the tag code I can do something like this: String schaal_nummer = (String) TagUtils.getRealValueFromBean( name, property, null, pageContext); Voila, no nested tags. Plus it's very easy to read in the JSP. David Hibbs, ACS Staff Programmer / Analyst American National Insurance Company - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts tag problem (bean:message and bean:write)
Hi all, I was wondering if anyone of you have a solution For this dilemma. I have a collectin of product DTOs to show on my jsp. One of DTO's property is, let's say, the type, which is listed in number. (let's say, 10 or 20). ON the DTO I will have the value 10,20 ecc but on the jsp I have to display The corresponding string (let's say, HouseProduct or Car or something else) which is listed in application.resources. I am looping thru the collection using logic:iterate, and as I have found out myself, following code does not work bean:message key='prompt.productType.bean:write name=product property=productType'/ basically in app.resources I will have prompt.productType.10=HouseProduct prompt.productType.20=Car etc.. above, I am outputting the message prompt.productType.(productType) how can I solve my dilemma, keeping in mind that I am using also logic:iterate to loop thru the collection? With best regards marco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts tag problem (bean:message and bean:write)
Something like bean:define id=type bean:write name=product property=productType /bean:define bean:message key=%='prompt.productType.' + type%/ Paul -Original Message- From: Marco Mistroni [mailto:[EMAIL PROTECTED] Sent: 25 March 2004 16:03 To: 'Struts Users Mailing List' Subject: Struts tag problem (bean:message and bean:write) Hi all, I was wondering if anyone of you have a solution For this dilemma. I have a collectin of product DTOs to show on my jsp. One of DTO's property is, let's say, the type, which is listed in number. (let's say, 10 or 20). ON the DTO I will have the value 10,20 ecc but on the jsp I have to display The corresponding string (let's say, HouseProduct or Car or something else) which is listed in application.resources. I am looping thru the collection using logic:iterate, and as I have found out myself, following code does not work bean:message key='prompt.productType.bean:write name=product property=productType'/ basically in app.resources I will have prompt.productType.10=HouseProduct prompt.productType.20=Car etc.. above, I am outputting the message prompt.productType.(productType) how can I solve my dilemma, keeping in mind that I am using also logic:iterate to loop thru the collection? With best regards marco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts tag problem (bean:message and bean:write)
Marco, can you use bean:define and a scriptlet code inside bean:message ? Something like : bean:define id=suffix name=product property=productType/ bean:message key='%=prompt.productType.+suffix%'/ --- Marco Mistroni [EMAIL PROTECTED] escreveu: Hi all, I was wondering if anyone of you have a solution For this dilemma. I have a collectin of product DTOs to show on my jsp. One of DTO's property is, let's say, the type, which is listed in number. (let's say, 10 or 20). ON the DTO I will have the value 10,20 ecc but on the jsp I have to display The corresponding string (let's say, HouseProduct or Car or something else) which is listed in application.resources. I am looping thru the collection using logic:iterate, and as I have found out myself, following code does not work bean:message key='prompt.productType.bean:write name=product property=productType'/ basically in app.resources I will have prompt.productType.10=HouseProduct prompt.productType.20=Car etc.. above, I am outputting the message prompt.productType.(productType) how can I solve my dilemma, keeping in mind that I am using also logic:iterate to loop thru the collection? With best regards marco __ Yahoo! Mail - O melhor e-mail do Brasil! Abra sua conta agora: http://br.yahoo.com/info/mail.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
EL Tag Libraries
Hi Guys, I have an action form with a get method (i.e. getValue(String)) which takes a string value, its working fine when i render the data in a text field. E.g. c:set var=uniqueKey c:out value=${CustomerTO.id}/-c:out value=${CustomerTO.orderNo}/ /c:set html-el:text name=myForm property=value(${uniqueKey})/ Now i want to render the data as a label on screen i've tried using the C:out/ tag lib but i cant get it to work e.g. c:out value=${myForm.value(${uniqueKey})}/ and c:out value=${myForm.value(uniqueKey)}/ Any ideas how i might do this? _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: EL Tag Libraries
Why not use c:out value=${uniqueKey} / instead of c:out value=${myForm.value(${uniqueKey})} / ??? This works for me: c:set var=testVar value=Hello / c:set var=testVar1 value=World / c:set var=hello c:out value=${testVar} /-c:out value=${testVar1} / /c:set c:out value=${hello} / Thanks -- pady [EMAIL PROTECTED] -Original Message- From: Pat Quinn [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 24, 2004 7:11 AM To: [EMAIL PROTECTED] Subject: EL Tag Libraries Hi Guys, I have an action form with a get method (i.e. getValue(String)) which takes a string value, its working fine when i render the data in a text field. E.g. c:set var=uniqueKey c:out value=${CustomerTO.id}/-c:out value=${CustomerTO.orderNo}/ /c:set html-el:text name=myForm property=value(${uniqueKey})/ Now i want to render the data as a label on screen i've tried using the C:out/ tag lib but i cant get it to work e.g. c:out value=${myForm.value(${uniqueKey})}/ and c:out value=${myForm.value(uniqueKey)}/ Any ideas how i might do this? _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ __ This email has been scanned by the Heroix e-mail Security System __ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: EL Tag Libraries
I want to pass uniqueKey as a parameter to the getValue method on my action form, i dont want to render the uniqueKey value i want to render the return value from the getValue(String) method call From: Pady Srinivasan [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: RE: EL Tag Libraries Date: Wed, 24 Mar 2004 08:57:41 -0500 Why not use c:out value=${uniqueKey} / instead of c:out value=${myForm.value(${uniqueKey})} / ??? This works for me: c:set var=testVar value=Hello / c:set var=testVar1 value=World / c:set var=hello c:out value=${testVar} /-c:out value=${testVar1} / /c:set c:out value=${hello} / Thanks -- pady [EMAIL PROTECTED] -Original Message- From: Pat Quinn [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 24, 2004 7:11 AM To: [EMAIL PROTECTED] Subject: EL Tag Libraries Hi Guys, I have an action form with a get method (i.e. getValue(String)) which takes a string value, its working fine when i render the data in a text field. E.g. c:set var=uniqueKey c:out value=${CustomerTO.id}/-c:out value=${CustomerTO.orderNo}/ /c:set html-el:text name=myForm property=value(${uniqueKey})/ Now i want to render the data as a label on screen i've tried using the C:out/ tag lib but i cant get it to work e.g. c:out value=${myForm.value(${uniqueKey})}/ and c:out value=${myForm.value(uniqueKey)}/ Any ideas how i might do this? _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ __ This email has been scanned by the Heroix e-mail Security System __ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: EL Tag Libraries
It is not working because JSTL think that you are trying to call a function. To make it work you will need to define this function in a TLD file and use the namespace to call it. Take a look at TOMCAT\webapps\jsp-examples\jsp2\el\functions.jsp HTH --Shaul Pat Quinn wrote: I want to pass uniqueKey as a parameter to the getValue method on my action form, i dont want to render the uniqueKey value i want to render the return value from the getValue(String) method call From: Pady Srinivasan [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: RE: EL Tag Libraries Date: Wed, 24 Mar 2004 08:57:41 -0500 Why not use c:out value=${uniqueKey} / instead of c:out value=${myForm.value(${uniqueKey})} / ??? This works for me: c:set var=testVar value=Hello / c:set var=testVar1 value=World / c:set var=hello c:out value=${testVar} /-c:out value=${testVar1} / /c:set c:out value=${hello} / Thanks -- pady [EMAIL PROTECTED] -Original Message- From: Pat Quinn [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 24, 2004 7:11 AM To: [EMAIL PROTECTED] Subject: EL Tag Libraries Hi Guys, I have an action form with a get method (i.e. getValue(String)) which takes a string value, its working fine when i render the data in a text field. E.g. c:set var=uniqueKey c:out value=${CustomerTO.id}/-c:out value=${CustomerTO.orderNo}/ /c:set html-el:text name=myForm property=value(${uniqueKey})/ Now i want to render the data as a label on screen i've tried using the C:out/ tag lib but i cant get it to work e.g. c:out value=${myForm.value(${uniqueKey})}/ and c:out value=${myForm.value(uniqueKey)}/ Any ideas how i might do this? _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ __ This email has been scanned by the Heroix e-mail Security System __ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] *** This Mail Was Scanned By Mail-seCure System in Matrix Herzeliya *** *** This Mail Was Scanned By Mail-seCure System in Matrix Herzeliya *** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: access variable value in html tag
The Struts-EL is what I'd recommend, which supports exactly what you want to do, unless you're into (Tomcat 5 and the) JSP 2.0 then you'd just do: option value=${accounts.number}${accounts.number}/option Otherwise I _think_ I've done this nastiness and it worked, but I might have been doing it with plain HTML (non-struts tags): html:option value=c:out value=${accounts.number}/c:out value=${accounts.number}//html:option ._. -Original Message- From: Steltner, Joern [mailto:[EMAIL PROTECTED] Sent: Friday, March 19, 2004 7:28 AM To: [EMAIL PROTECTED] Subject: access variable value in html tag Dear, I'm not an expert in Struts and Java. I need some simple help: html:select property=no_account c:forEach var=accounts items=${Accounts} varStatus=status html:option value=c:out value=${accounts.number}/html:option /c:forEach /html:select Everything works fine, but at ??? mark I would like take account.no_account like ${accounts.number}, but it doesn't work. May someone can give me a small note about the right syntax to get the value from accounts.number as text in the quotes. Thanks Regards J. Steltner - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Generating Tiles tags and Struts tags from with in another Custom Tag
All, I wrote a custom tag that generates JSP code that includes struts tags and tiles tags. They are not getting interpreted by the JSP Container. Can you please let me know if it is possible? If it is possible are there any examples that help me understand the life cycle? Thanks and Regards, Sree/- This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose.
RE: Generating Tiles tags and Struts tags from with in another Custom Tag
If you are writing a tag,The output generated by your tag should be valid html. Because the life cycle is as follows. 1--The ServletContainer gets a request for a particular page(In this case your .jsp page) 2--The request being for a JSP page, the servlet container decides to pass it on to JspServlet/any helper class which knows how to interpret jsp code(Call methods on the Actions(Tags) if there are any tags included etc. ),I am also not very clear about this part, in the sense that if there is any restriction on ServletCOntainers about how to handle the interpretation of jsps. 3--Any output that the tags generate will written to the HTTPServletResponse object. which means it has to be valid HTML if the browser has to display it properly. In your case, as you can see, the tags you wrote are again generating jsp which will be directly going to the client Browser. May be what you can do is to write a temporary jsp file and then redirect to that temporary jsp file. But why you have to go this way?It looks too contrived/complicated to me. Why not just spit out proper HTML from your tags? And the only purpose is to reuse the existing struts/Tiles tags,why not extend them, overriding where ever appropriate? HTH. Regards, Shirish -Original Message- From: Sreenivasa Chadalavada [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 23, 2004 3:22 PM To: Struts Users Mailing List Subject: Generating Tiles tags and Struts tags from with in another Custom Tag All, I wrote a custom tag that generates JSP code that includes struts tags and tiles tags. They are not getting interpreted by the JSP Container. Can you please let me know if it is possible? If it is possible are there any examples that help me understand the life cycle? Thanks and Regards, Sree/- This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Generating Tiles tags and Struts tags from with in another Custom Tag
Shirish, Thanks for answering the e-mail. One reason I would like to generate Struts, Tiles tags is to implement composition. Take an example of generating a Table structure. I would like to use Struts and Tiles because of all the niceties. I hope this example makes sense? If what you are saying is true, then I should follow some of the techniques you suggested to solve the problem. Thanks and Regards, Sree/- This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose. shirishchandra.sakhare @ubs.com 03/23/2004 09:47 AM Please respond to Struts Users Mailing List To: [EMAIL PROTECTED] cc: Subject:RE: Generating Tiles tags and Struts tags from with in another Custom Tag If you are writing a tag,The output generated by your tag should be valid html. Because the life cycle is as follows. 1--The ServletContainer gets a request for a particular page(In this case your .jsp page) 2--The request being for a JSP page, the servlet container decides to pass it on to JspServlet/any helper class which knows how to interpret jsp code(Call methods on the Actions(Tags) if there are any tags included etc. ),I am also not very clear about this part, in the sense that if there is any restriction on ServletCOntainers about how to handle the interpretation of jsps. 3--Any output that the tags generate will written to the HTTPServletResponse object. which means it has to be valid HTML if the browser has to display it properly. In your case, as you can see, the tags you wrote are again generating jsp which will be directly going to the client Browser. May be what you can do is to write a temporary jsp file and then redirect to that temporary jsp file. But why you have to go this way?It looks too contrived/complicated to me. Why not just spit out proper HTML from your tags? And the only purpose is to reuse the existing struts/Tiles tags,why not extend them, overriding where ever appropriate? HTH. Regards, Shirish -Original Message- From: Sreenivasa Chadalavada [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 23, 2004 3:22 PM To: Struts Users Mailing List Subject: Generating Tiles tags and Struts tags from with in another Custom Tag All, I wrote a custom tag that generates JSP code that includes struts tags and tiles tags. They are not getting interpreted by the JSP Container. Can you please let me know if it is possible? If it is possible are there any examples that help me understand the life cycle? Thanks and Regards, Sree/- This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
access variable value in html tag
Dear, I'm not an expert in Struts and Java. I need some simple help: html:select property=no_account c:forEach var=accounts items=${Accounts} varStatus=status html:option value=c:out value=${accounts.number}/html:option /c:forEach /html:select Everything works fine, but at ??? mark I would like take account.no_account like ${accounts.number}, but it doesn't work. May someone can give me a small note about the right syntax to get the value from accounts.number as text in the quotes. Thanks Regards J. Steltner - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: access variable value in html tag
Hmm..Your syntax looks right to me, though you are missing a closing just before /html:option Could the problem lie elsewhere? Can you write out the accounts.number/account.no_account label/value as a simple list? Colm -Original Message- From: Steltner, Joern [mailto:[EMAIL PROTECTED] Sent: 19 March 2004 12:28 To: [EMAIL PROTECTED] Subject: access variable value in html tag Dear, I'm not an expert in Struts and Java. I need some simple help: html:select property=no_account c:forEach var=accounts items=${Accounts} varStatus=status html:option value=c:out value=${accounts.number}/html:option /c:forEach /html:select Everything works fine, but at ??? mark I would like take account.no_account like ${accounts.number}, but it doesn't work. May someone can give me a small note about the right syntax to get the value from accounts.number as text in the quotes. Thanks Regards J. Steltner - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: access variable value in html tag
You will need to use Struts-EL taglib then you should be able to do what you want. http://jakarta.apache.org/struts/faqs/struts-el.html html:select property=no_account c:forEach var=accounts items=${Accounts} varStatus=status html_el:option value=${account.no_account} c:out value=${accounts.number}/html_el:option /c:forEach /html:select You might also investigate using the html:optionsCollection .../ or the html:options .../ http://jakarta.apache.org/struts/userGuide/struts-html robert -Original Message- From: Steltner, Joern [mailto:[EMAIL PROTECTED] Sent: Friday, March 19, 2004 7:28 AM To: [EMAIL PROTECTED] Subject: access variable value in html tag Dear, I'm not an expert in Struts and Java. I need some simple help: html:select property=no_account c:forEach var=accounts items=${Accounts} varStatus=status html:option value=c:out value=${accounts.number}/html:option /c:forEach /html:select Everything works fine, but at ??? mark I would like take account.no_account like ${accounts.number}, but it doesn't work. May someone can give me a small note about the right syntax to get the value from accounts.number as text in the quotes. Thanks Regards J. Steltner - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:image tag and DynaActionForm
I have an html:image tag inside a html:form tag, which points to one of my Struts Actions. My Action utilizes a DynaActionForm, in which I have defined several form-property entries. One of these form-property entries, lets call it imageProperty matches the property attribute of my html:image tag, also imageProperty. However, in my Action, when I have clicked on the image generated by the html:image tag, the DynaActionForm object does NOT contain an entry for the html:image property attribute. I would expect that my call to dynaForm.get(imageProperty) would return something other than throwing an IllegalArgumentException. Here's the HTML: html:form action=myAction html:image page=/img/myImage.gif property=imageProperty / /html:form The struts-config.xml: form-bean dynamic=true name=myActionForm type=org.apache.struts.action.DynaActionForm form-property name=imageProperty type=java.lang.String / /form-bean action attribute=myActionForm name=myActionForm path=/myAction type=com.foo.bar.MyAction validate=false forward ... / /action The Action code: DynaActionForm dynaForm = (DynaActionForm) form; if ( dynaForm != null ) { Object o = dynaForm.get(imageProperty); } Any thoughts on what I am doing wrong here? T - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
internationalizing html:option tag, force to lookup resource file
Hi, Sorry if this is a repeat post, but I don't think the original went through. I'm just starting into looking at struts. Is it possible to generate a select/ options list using the html:select and html:option(s) tags, where the labelProperties (i.e. the text displayed on the end users web browser) get looked up from a resource file, instead of been displayed directly. e.g. if we have a collection bean made up of 3 namevalue pairs {(1,one), (2,two), (3,three)} html:select property=partnerId html:options collection=list.bean property=name labelProperty=value/ /html:select produces select option value=1one/option option value=2two/option option value=3three/option /select This produces a select box with the English values appearing on the web page regardless of the locale that is set. What I want is for the one, two and three to be keys into the applicationResources.properties so that different locales can be setup. If this is not available would it be useful to write a tag to do this? Cheers, Keith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: internationalizing html:option tag, force to lookup resource file
Currently, you need to use the html:option tag, not the html:options or html:optionsCollection tags. The latter two do not support I18n. Therefore, you need to iterate over a collection, placing the resource key in the html:ooption's key attribute. Here's an example of what I do: html:select property=searchListValue styleClass=drpdwn logic:iterate id=item name=SearchFormBean property=searchList.list html:option key=${item.labelKey} value=${item.labelKey} / /logic:iterate /html:select -- Jay Glanville -Original Message- From: Keith Hyland [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 11:11 AM To: Struts Users Mailing List Subject: internationalizing html:option tag, force to lookup resource file Hi, Sorry if this is a repeat post, but I don't think the original went through. I'm just starting into looking at struts. Is it possible to generate a select/ options list using the html:select and html:option(s) tags, where the labelProperties (i.e. the text displayed on the end users web browser) get looked up from a resource file, instead of been displayed directly. e.g. if we have a collection bean made up of 3 namevalue pairs {(1,one), (2,two), (3,three)} html:select property=partnerId html:options collection=list.bean property=name labelProperty=value/ /html:select produces select option value=1one/option option value=2two/option option value=3three/option /select This produces a select box with the English values appearing on the web page regardless of the locale that is set. What I want is for the one, two and three to be keys into the applicationResources.properties so that different locales can be setup. If this is not available would it be useful to write a tag to do this? Cheers, Keith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: internationalizing html:option tag, force to lookup resource file
The html:option tag already has this facility - you can specify a key attribute. If however you want yo use the html:optionsCollection tag, there was an identical discussion on this list recently. You can find the start of that thread here.. http://www.mail-archive.com/[EMAIL PROTECTED]/msg93939.html Niall - Original Message - From: Keith Hyland [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, March 08, 2004 4:10 PM Subject: internationalizing html:option tag, force to lookup resource file Hi, Sorry if this is a repeat post, but I don't think the original went through. I'm just starting into looking at struts. Is it possible to generate a select/ options list using the html:select and html:option(s) tags, where the labelProperties (i.e. the text displayed on the end users web browser) get looked up from a resource file, instead of been displayed directly. e.g. if we have a collection bean made up of 3 namevalue pairs {(1,one), (2,two), (3,three)} html:select property=partnerId html:options collection=list.bean property=name labelProperty=value/ /html:select produces select option value=1one/option option value=2two/option option value=3three/option /select This produces a select box with the English values appearing on the web page regardless of the locale that is set. What I want is for the one, two and three to be keys into the applicationResources.properties so that different locales can be setup. If this is not available would it be useful to write a tag to do this? Cheers, Keith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with html:form tag
Hi! I am writing an application with JSPs and I am using the struts framework. I am also using Struts JSP Tags in my JSP. I am having a problem with the html:form tag. I have a do/while loop embedded in my JSP as a scriplet. Ths scriplet is inside my html:form tags and it is giving me the following 3 errors: 'try' without 'catch' or 'finally'. if (_jspx_th_html_form_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) 'while' expected. } finally { 'finally' without 'try'. } finally { If I take the form's closing tag and put it before the end of the loop, then I do not get the error. However I must have it after the loop. So it seems that the /html:form tag has problems with loops in scriplets. Has anyone experienced this before? Hope someone can help Thanks, Chris. Here is the relevant portion of my JSP code. Thanks % x++; }while(iter.hasNext()); % html:submit title=Vote/ /html:form _ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Showing selected in struts option tag
Vincent, appreciat ethe reply. I ahve been trying the smae and still cant get the drop down to show my selected attribute. Here is the two approachesI tried to do this. beofre my book.jsp gets called, BookAction.java is called.In here I set the ISBN from sessions' selected book as follows: httpsession.setAttribute(book, book); String formISBN= book.getISBN(); bookForm.setISBN(formISBN); ALso in my book.jsp, just above the select tag for struts drop down using options tag, here is what I wrote: % String selectedISBN= null; com.model.Book book= (com.model.Book)request.getAttribute(book); com.model.Book book= (com.model.Book)session.getAttribute(book); if (book!= null)System.out.println(* In book.jsp, booknot null); selectedISBN= (String )book.getISBN(); if (selectedISBN!= null)System.out.println(* In book.jsp, selectedISBN is:+selectedISBN); session.setAttribute(fullName,selectedISBN); % !--select name=fullName style=width:225px value=lisa h turner-- select name=ISBN style=width:225px logic:iterate id=book name=books option value=bean:write name=book property =author/ bean:write name=book property =ISBN/ /option /logic:iterate /select The system outs in the book.jsp show me the defualt ISBN correctly as follows: * In book.jsp * In book.jsp, booknot null * In book.jsp, bookISBNis:2345 Only that the drp down is not showing this ISBN as selected but some other ISBN alphabeticlaly first in the list how can i fix this seems i am very close to the solution i couldnt set private String ISBN =2345 in the BookForm.java as I need to retrive this vaue from request or session-so I need to call a method over it before I set the ISBN thanks a lot in advance sam Vincent Lin [EMAIL PROTECTED] wrote: Hi, You can specify a default value to ISBN in the form bean. Then the selected option will jump to the default value you set when the page is rendered. For example, in the form bean you declare ISBN: private int ISBN = 12345; And you have an option 12345 as the property value in your option collection. The select object will jump to 12345 (struts will give it a selected attribute in tag) when the page is loaded. Regard, Vincent --- as as ªº°T®§¡G Hi, OK. I tried the following and it works fine (shows me the drop down.Thanks for the syntax, Wendy) I now want to show a default book as the selected item in the drop down.. how do I do it Thanks in advance. My code (working) below... Book: No books found in this site. labelProperty=bookName/ Wendy Smoak wrote: From: as as [mailto:[EMAIL PROTECTED] =employeeID/ An example from my project that may get you started: labelProperty=value/ You can drop the '-el' in the tags, there are no expressions in this one anyway. The docs for and are here: http://jakarta.apache.org/struts/userGuide/dev_html.html Give it a try and post what you come up with! -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Search - Find what youre looking for faster. - ¨C¤Ñ³£ Yahoo!©_¼¯ ®üªºÃC¦â¡Bshy;·ªº®ð®§¡B·R§Aªº·Å«×¡AºÉ¦b«H¯È©³¹Ï http://tw.promo.yahoo.com/mail_premium/stationery.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Search - Find what youre looking for faster.
RE: Showing selected in struts option tag
From: as as [mailto:[EMAIL PROTECTED] Keep this, in the Action: String formISBN= book.getISBN(); bookForm.setISBN(formISBN); This isn't right: select name=ISBN style=width:225px If you want Struts to pre-select the correct item based on the value of the Form bean, you have to use a Struts tag, in this case html:select. Here is an example from subscription.jsp of the struts-example webapp that came with Struts 1.1. html:select property=type html:options collection=serverTypes property=value labelProperty=label/ /html:select You'll have to figure out the correct attributes for html:options depending on your situation: http://jakarta.apache.org/struts/userGuide/struts-html.html#options You do not have to do the iteration manually, the 'options' tag will do it for you, and the enclosing html:select tag will pick the right one. -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Showing selected in struts option tag
o yes! I need to use html:select instead of select Lemme try this now right away Thanks! Wendy Smoak [EMAIL PROTECTED] wrote: From: as as [mailto:[EMAIL PROTECTED] Keep this, in the Action: String formISBN= book.getISBN(); bookForm.setISBN(formISBN); This isn't right: If you want Struts to pre-select the correct item based on the value ofthe Form bean, you have to use a Struts tag, in this case .Here is an example from subscription.jsp of the struts-example webappthat came with Struts 1.1. labelProperty=label/You'll have to figure out the correct attributes for depending on your situation:http://jakarta.apache.org/struts/userGuide/struts-html.html#optionsYou do not have to do the iteration manually, the 'options' tag will doit for you, and the enclosing tag will pick the rightone.-- Wendy SmoakApplication Systems Analyst, Sr.ASU IA Information Resources Management -To unsubscribe, e-mail: [EMAIL PROTECTED] additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Search - Find what youre looking for faster.
RE: Showing selected in struts option tag
Hi, I tried this: html:select property=book html:options collection=books property=book labelProperty=ISBN/ /html:select Gives me: weblogic.servlet.jsp.JspException: (line 116): Non-matching extension tags //[ null; Line: 116] at weblogic.servlet.jsp.JspLexer.jspException(JspLexer.java:872) at weblogic.servlet.jsp.JspLexer.mCLOSE_EXTENSION_TAG(JspLexer.java:2740) at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:2007) at weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java:1892) Thanks in advance, Sam. Wendy Smoak [EMAIL PROTECTED] wrote: From: as as [mailto:[EMAIL PROTECTED] Keep this, in the Action: String formISBN= book.getISBN(); bookForm.setISBN(formISBN); This isn't right: If you want Struts to pre-select the correct item based on the value ofthe Form bean, you have to use a Struts tag, in this case .Here is an example from subscription.jsp of the struts-example webappthat came with Struts 1.1. labelProperty=label/You'll have to figure out the correct attributes for depending on your situation:http://jakarta.apache.org/struts/userGuide/struts-html.html#optionsYou do not have to do the iteration manually, the 'options' tag will doit for you, and the enclosing tag will pick the rightone.-- Wendy SmoakApplication Systems Analyst, Sr.ASU IA Information Resources Management -To unsubscribe, e-mail: [EMAIL PROTECTED] additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Search - Find what youre looking for faster.
RE: Showing selected in struts option tag
Hi, Now I changed the syntax to below. html:select style=width:225px property=selectedISBN html:optionsCollection property=books value=selectedISBN/ /html:select Gives me error: javax.servlet.jsp.JspException: No getter method for property books of bean org.apache.struts.taglib.html.BEAN Though I have the getters and setters in the form bean. Thanks! as as [EMAIL PROTECTED] wrote: Hi, I tried this: labelProperty=ISBN/ Gives me: weblogic.servlet.jsp.JspException: (line 116): Non-matching extension tags //[ null; Line: 116] at weblogic.servlet.jsp.JspLexer.jspException(JspLexer.java:872) at weblogic.servlet.jsp.JspLexer.mCLOSE_EXTENSION_TAG(JspLexer.java:2740) at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:2007) at weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java:1892) Thanks in advance, Sam. Wendy Smoak wrote: From: as as [mailto:[EMAIL PROTECTED] Keep this, in the Action: String formISBN= book.getISBN(); bookForm.setISBN(formISBN); This isn't right: If you want Struts to pre-select the correct item based on the value ofthe Form bean, you have to use a Struts tag, in this case .Here is an example from subscription.jsp of the struts-example webappthat came with Struts 1.1. labelProperty=label/You'll have to figure out the correct attributes for depending on your situation:http://jakarta.apache.org/struts/userGuide/struts-html.html#optionsYou do not have to do the iteration manually, the 'options' tag will doit for you, and the enclosing tag will pick the rightone.-- Wendy SmoakApplication Systems Analyst, Sr.ASU IA Information Resources Management -To unsubscribe, e-mail: [EMAIL PROTECTED] additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Search - Find what youre looking for faster. - Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online
RE: Showing selected in struts option tag
From: as as [mailto:[EMAIL PROTECTED] html:select style=width:225px property=selectedISBN html:optionsCollection property=books value=selectedISBN/ /html:select Gives me error: javax.servlet.jsp.JspException: No getter method for property books of bean org.apache.struts.taglib.html.BEAN I think it's looking for a getBooks() method in your form bean, which returns a Collection. Is that where getBooks() really is? Or is it a session attribute? -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Showing selected in struts option tag
Wendy, Sure there is a getBooks method. Shoud it return a java Collection, if so do I have to cast it into it? My Hibernate Database based on sql returns it as books which in my action class comes out as java.util.List Thanks! Wendy Smoak [EMAIL PROTECTED] wrote: From: as as [mailto:[EMAIL PROTECTED] Gives me error: javax.servlet.jsp.JspException: No getter method for property books of bean org.apache.struts.taglib.html.BEAN I think it's looking for a getBooks() method in your form bean, which returns a Collection. Is that where getBooks() really is? Or is it a session attribute? -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Search - Find what youre looking for faster.
RE: Showing selected in struts option tag
From: as as [mailto:[EMAIL PROTECTED] Sure there is a getBooks method. In the *ActionForm*? That's what I'm asking. I do not store my Collections for select lists in the Form bean, I put them in session or application scope depending on whether they're user specific. Shoud it return a java Collection, if so do I have to cast it into it? My Hibernate Database based on sql returns it as books which in my action class comes out as java.util.List Thanks! java.util.List implements Collection, so you're okay there. I just wonder where you're storing your List of books after you retrieve it from the database. The problem seems to be that whatever Struts is calling 'getBooks()' on, does not have that method. Lets get that part cleared up, then I think there's a problem with your html:optionsCollection tag. -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Showing selected in struts option tag
Thanks much Vincent. Just curious as to how to do in jsp. please let me know That way may be i can also try mentioing it in the table row in the jsp for the drop down meanwile i will post back my results of mentioing in the action form as default Thanks Sam Vincent Lin [EMAIL PROTECTED] wrote: Actually, you can set the default value to the select attribute of the form bean anywhere before the tag. You can do it either in JSP or action class. I suggest doing it in your action class. For example: int defaultValue = getDefaultISBN(bookId); form.setISBN(defaultValue); ... Regards, Vincent --- as as ªº°T®§¡G Thanks much! That helps. But also, i have a table with rows.each row has details about a specific book(like bookname is a column and so is ISBN) so when a user clicks on a row, those details are displayed of that book, with a drop down saying order the book from this bookStoreName (shown as a drop down, with a default bookStoreName for each book).so this value is defualt for that row but not for the whole table /struts form so wondering how I can implement default to the whole form.in my books object in my logic:iterate tag, iterating over id=book Thanks in advance. sam Vincent Lin wrote: Hi, You can specify a default value to ISBN in the form bean. Then the selected option will jump to the default value you set when the page is rendered. For example, in the form bean you declare ISBN: private int ISBN = 12345; And you have an option 12345 as the property value in your option collection. The select object will jump to 12345 (struts will give it a selected attribute in tag) when the page is loaded. Regard, Vincent - ¨C¤Ñ³£ Yahoo!©_¼¯ ®üªºÃC¦â¡Bshy;·ªº®ð®§¡B·R§Aªº·Å«×¡AºÉ¦b«H¯È©³¹Ï http://tw.promo.yahoo.com/mail_premium/stationery.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Search - Find what youre looking for faster.
url rewrite prob in html:img tag
I've posted this on Apache/Tomcat/Struts as unsure where appropriate I have a jsp page hosted on Apache 1.3.xxx/Tomcat 4.1.xxx config On the page I use the following struts tag html:img page=/images/x.gif ../ On the initial hit of the site this produces img src=http://host_name/images/x.gif:jsessionid=some_id_value; . The browser does not load this at all. On hitting Refresh on the browser the following is produced img src=http://host_name/images/x.gif; . .i.e no jsessionid The browser can then load the image correctly. If I turn cookies off then the images are never loaded. Does anyone know why this is ?. I assume it is a problem with the handling off URL rewriting but don't know he fix. Is it Apache or Tomcat that is the problem. Maybe mod_rewrite in Apache ? Thanks GM The Royal Bank of Scotland plc, Registered in Scotland No. 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB The Royal Bank of Scotland plc is authorised and regulated by the Financial Services Authority and represents The Royal Bank of Scotland Marketing Group. The Bank sells life policies, collective investment schemes and pension products and advises only on the Marketing Group's range of these products and on a With-Profit Bond produced by Norwich Union Life (RBS) Limited. This e-mail message is confidential and for use by the addressee only. If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer. Internet e-mails are not necessarily secure. The Royal Bank of Scotland plc does not accept responsibility for changes made to this message after it was sent. Whilst all reasonable care has been taken to avoid the transmission of viruses, it is the responsibility of the recipient to ensure that the onward transmission, opening or use of this message and any attachments will not adversely affect its systems or data. No responsibility is accepted by The Royal Bank of Scotland plc in this regard and the recipient should carry out such virus and other checks as it considers appropriate. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: url rewrite prob in html:img tag
From: Mitchell, Glen (Corporate Channel Development) On the page I use the following struts tag html:img page=/images/x.gif ../ On the initial hit of the site this produces img src=http://host_name/images/x.gif:jsessionid=some_id_valu e . The browser does not load this at all. On hitting Refresh on the browser the following is produced img src=http://host_name/images/x.gif; . Is there anything dynamic in the path or filename to the image? If not, can you use a plain-old img src= I serve images from the root of the Apache webserver, so that Tomcat doesn't get involved other than writing out the img tag. I had the same problem with the appended jsessionid, and when the content is dynamic, I used this: link rel=stylesheet href=c:url value=${css}/ type=text/css -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Showing selected in struts option tag
Hi, OK. I tried the following and it works fine (shows me the drop down.Thanks for the syntax, Wendy) I now want to show a default book as the selected item in the drop down.. how do I do it Thanks in advance. My code (working) below... tr bgcolor=A9A9A4 th align=right Book: /th td logic:notPresent name=books No books found in this site. /logic:notPresent html:select property=ISBN html:options collection=books property=book labelProperty=bookName/ /html:select /td /tr Wendy Smoak [EMAIL PROTECTED] wrote: From: as as [mailto:[EMAIL PROTECTED] =employeeID/ An example from my project that may get you started: labelProperty=value/ You can drop the '-el' in the tags, there are no expressions in this one anyway. The docs for and are here: http://jakarta.apache.org/struts/userGuide/dev_html.html Give it a try and post what you come up with! -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Search - Find what youre looking for faster.
RE: Showing selected in struts option tag
Hi, You can specify a default value to ISBN in the form bean. Then the selected option will jump to the default value you set when the page is rendered. For example, in the form bean you declare ISBN: private int ISBN = 12345; And you have an option 12345 as the property value in your option collection. The select object will jump to 12345 (struts will give it a selected attribute in option tag) when the page is loaded. Regard, Vincent --- as as [EMAIL PROTECTED] Hi, OK. I tried the following and it works fine (shows me the drop down.Thanks for the syntax, Wendy) I now want to show a default book as the selected item in the drop down.. how do I do it Thanks in advance. My code (working) below... tr bgcolor=A9A9A4 th align=right Book: /th td logic:notPresent name=books No books found in this site. /logic:notPresent html:select property=ISBN html:options collection=books property=book labelProperty=bookName/ /html:select /td /tr Wendy Smoak [EMAIL PROTECTED] wrote: From: as as [mailto:[EMAIL PROTECTED] =employeeID/ An example from my project that may get you started: labelProperty=value/ You can drop the '-el' in the tags, there are no expressions in this one anyway. The docs for and are here: http://jakarta.apache.org/struts/userGuide/dev_html.html Give it a try and post what you come up with! -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Search - Find what you?e looking for faster. - Yahoo! http://tw.promo.yahoo.com/mail_premium/stationery.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Showing selected in struts option tag
Thanks much! That helps. But also, i have a table with rows.each row has details about a specific book(like bookname is a column and so is ISBN) so when a user clicks on a row, those details are displayed of that book, with a drop down saying order the book from this bookStoreName (shown as a drop down, with a default bookStoreName for each book).so this value is defualt for that row but not for the whole table /struts form so wondering how I can implement default to the whole form.in my books object in my logic:iterate tag, iterating over id=book Thanks in advance. sam Vincent Lin [EMAIL PROTECTED] wrote: Hi, You can specify a default value to ISBN in the form bean. Then the selected option will jump to the default value you set when the page is rendered. For example, in the form bean you declare ISBN: private int ISBN = 12345; And you have an option 12345 as the property value in your option collection. The select object will jump to 12345 (struts will give it a selected attribute in tag) when the page is loaded. Regard, Vincent --- as as ªº°T®§¡G Hi, OK. I tried the following and it works fine (shows me the drop down.Thanks for the syntax, Wendy) I now want to show a default book as the selected item in the drop down.. how do I do it Thanks in advance. My code (working) below... Book: No books found in this site. labelProperty=bookName/ Wendy Smoak wrote: From: as as [mailto:[EMAIL PROTECTED] =employeeID/ An example from my project that may get you started: labelProperty=value/ You can drop the '-el' in the tags, there are no expressions in this one anyway. The docs for and are here: http://jakarta.apache.org/struts/userGuide/dev_html.html Give it a try and post what you come up with! -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Search - Find what youre looking for faster. - ¨C¤Ñ³£ Yahoo!©_¼¯ ®üªºÃC¦â¡Bshy;·ªº®ð®§¡B·R§Aªº·Å«×¡AºÉ¦b«H¯È©³¹Ï http://tw.promo.yahoo.com/mail_premium/stationery.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Search - Find what youre looking for faster.
RE: Showing selected in struts option tag
Actually, you can set the default value to the select attribute of the form bean anywhere before the html:options tag. You can do it either in JSP or action class. I suggest doing it in your action class. For example: int defaultValue = getDefaultISBN(bookId); form.setISBN(defaultValue); ... Regards, Vincent --- as as [EMAIL PROTECTED] Thanks much! That helps. But also, i have a table with rows.each row has details about a specific book(like bookname is a column and so is ISBN) so when a user clicks on a row, those details are displayed of that book, with a drop down saying order the book from this bookStoreName (shown as a drop down, with a default bookStoreName for each book).so this value is defualt for that row but not for the whole table /struts form so wondering how I can implement default to the whole form.in my books object in my logic:iterate tag, iterating over id=book Thanks in advance. sam Vincent Lin [EMAIL PROTECTED] wrote: Hi, You can specify a default value to ISBN in the form bean. Then the selected option will jump to the default value you set when the page is rendered. For example, in the form bean you declare ISBN: private int ISBN = 12345; And you have an option 12345 as the property value in your option collection. The select object will jump to 12345 (struts will give it a selected attribute in tag) when the page is loaded. Regard, Vincent - Yahoo! http://tw.promo.yahoo.com/mail_premium/stationery.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Showing selected in struts option tag
Hi, Here is my code tr bgcolor=A9A9A4 th align=right Supervisor: /th td select name=fullName style=width:225px logic:iterate id=supervisor name=supervisors option value=bean:write name=supervisor property =employeeID/ bean:write name=supervisor property =fullName/ /option /logic:iterate /select /td /tr Please let me know how I can accomplish the same. - Do you Yahoo!? Yahoo! Search - Find what youre looking for faster.
RE: Showing selected in struts option tag
From: as as [mailto:[EMAIL PROTECTED] select name=fullName style=width:225px logic:iterate id=supervisor name=supervisors option value=bean:write name=supervisor property =employeeID/ bean:write name=supervisor property =fullName/ /option /logic:iterate /select An example from my project that may get you started: html-el:select property=calendarYear onchange=updateAccounts(); html-el:options collection=years property=key labelProperty=value/ /html-el:select You can drop the '-el' in the tags, there are no expressions in this one anyway. The docs for html:select and html:options are here: http://jakarta.apache.org/struts/userGuide/dev_html.html Give it a try and post what you come up with! -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Showing selected in struts option tag
Wendy, Thanks for the prompt reply.Had a quick question. where do we mention this method? in the form's action class? updateAccounts(); Meanwhile I am running the new code so I will post my results shortly. Thanks, Samy Wendy Smoak [EMAIL PROTECTED] wrote: From: as as [mailto:[EMAIL PROTECTED] =employeeID/ An example from my project that may get you started: labelProperty=value/ You can drop the '-el' in the tags, there are no expressions in this one anyway. The docs for and are here: http://jakarta.apache.org/struts/userGuide/dev_html.html Give it a try and post what you come up with! -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Search - Find what youre looking for faster.
How do I get a cookie under a different path within the same doma in with bean:cookie tag?
Is it possible to retrieve the cookie at: www.abcd.com/cookie/path from www.abcd.com/another/path - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How do I get a cookie under a different path within the same domain with bean:cookie tag?
Some cookie spec says: The path attribute is used to specify the subset of URLs in a domain for which the cookie is valid. If a cookie has already passed domain matching, then the pathname component of the URL is compared with the path attribute, and if there is a match, the cookie is considered valid and is sent along with the URL request. The path /foo would match /foobar and /foo/bar.html. The path / is the most general path. If the path is not specified, it as assumed to be the same path as the document being described by the header which contains the cookie. So, YES it is possible. Just set the cookies for the domain www.abcd.com and to path /, and you should be able to get cookies from every page under www.abcd.com, You can actually make it more general by specifying the domain abcd.com, and now www2.abcd.com can access the cookies too. BTW, the spec I read was : http://wp.netscape.com/newsref/std/cookie_spec.html , it might be old but it made sense.. HTH, Pritpal Dhaliwal -Original Message- From: Lee, Yau-Pang [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 02, 2004 11:18 AM To: 'Struts Users Mailing List' Subject: How do I get a cookie under a different path within the same domain with bean:cookie tag? Is it possible to retrieve the cookie at: www.abcd.com/cookie/path from www.abcd.com/another/path - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How do I get a cookie under a different path within the same domain with bean:cookie tag?
Thks for the reply. However the problem is I have no control in setting the cookie. It's set to www.abcd.com/cookie/path and I can't change that to just / So, from my path www.abcd.com/another/path, I guess I can't read that cookie. -Original Message- From: Dhaliwal, Pritpal (HQP) [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 02, 2004 3:00 PM To: 'Struts Users Mailing List' Subject: RE: How do I get a cookie under a different path within the same domain with bean:cookie tag? Some cookie spec says: The path attribute is used to specify the subset of URLs in a domain for which the cookie is valid. If a cookie has already passed domain matching, then the pathname component of the URL is compared with the path attribute, and if there is a match, the cookie is considered valid and is sent along with the URL request. The path /foo would match /foobar and /foo/bar.html. The path / is the most general path. If the path is not specified, it as assumed to be the same path as the document being described by the header which contains the cookie. So, YES it is possible. Just set the cookies for the domain www.abcd.com and to path /, and you should be able to get cookies from every page under www.abcd.com, You can actually make it more general by specifying the domain abcd.com, and now www2.abcd.com can access the cookies too. BTW, the spec I read was : http://wp.netscape.com/newsref/std/cookie_spec.html , it might be old but it made sense.. HTH, Pritpal Dhaliwal -Original Message- From: Lee, Yau-Pang [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 02, 2004 11:18 AM To: 'Struts Users Mailing List' Subject: How do I get a cookie under a different path within the same domain with bean:cookie tag? Is it possible to retrieve the cookie at: www.abcd.com/cookie/path from www.abcd.com/another/path - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Showing selected in struts option tag
From: as as [mailto:[EMAIL PROTECTED] Thanks for the prompt reply.Had a quick question. where do we mention this method? in the form's action class? updateAccounts(); It's in the 'onchange' attribute of html:select. The docs are here: http://jakarta.apache.org/struts/userGuide/struts-html.html#select Specifically: onchange - JavaScript event handler executed when this element loses input focus and its value has changed. [RT Expr] So 'updateAccounts()' is a JavaScript method [or function??] in my page. You can probably take that part out. :) -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Showing selected in struts option tag
Wendy, Sounds good. So updateAccounts() is in the jsp..I have similar functionality to update the backend struts classes on changing the value in this drop downm, especially wondering how to tie in struts with javascript becuase i want to do something like the following in my javascript function: SCRIPT LANGUAGE=JavaScript function onChange(){ //call another struts class - window.location.href=booksDsiplay.do or something like that } /script can we invoke struts mapings and navigation from javascript. also i got following error using htmlOptions, though I have the getter for the BEAN property supervisor.wondering why. Thanks in advance. javax.servlet.jsp.JspException: No getter method for property supervisors of bean org.apache.struts.taglib.html.BEAN Wendy Smoak [EMAIL PROTECTED] wrote: From: as as [mailto:[EMAIL PROTECTED] Thanks for the prompt reply.Had a quick question. where do we mention this method? in the form's action class? updateAccounts(); It's in the 'onchange' attribute of . The docs are here: http://jakarta.apache.org/struts/userGuide/struts-html.html#select Specifically: onchange - JavaScript event handler executed when this element loses input focus and its value has changed. [RT Expr] So 'updateAccounts()' is a JavaScript method [or function??] in my page. You can probably take that part out. :) -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Search - Find what youre looking for faster.
RE: Showing selected in struts option tag
From: as as [mailto:[EMAIL PROTECTED] can we invoke struts mapings and navigation from javascript. Sure. The Struts tags have attributes for all the JavaScript handlers-- onclick, onblur, etc. Just keep it clear in your mind that in the simplest case, Struts code executes on the server, then HTML is delivered to the client, at which point the JavaScript runs. So you can't call a method in your Action class directly from JavaScript*, instead you'd have to cause another request to the server, usually by submitting the form. [*Actually I think something like this _is_ possible, but not with the basic JavaScript knowledge I have! Anyone care to toss out some search terms? How to replace a section of HTML on the page by making a request behind the scenes without actually submitting the form?] also i got following error using htmlOptions, though I have the getter for the BEAN property supervisor.wondering why. Thanks in advance. javax.servlet.jsp.JspException: No getter method for property supervisors of bean org.apache.struts.taglib.html.BEAN You will need to study the documentation for the html:options tag. It has many attributes, and they do different things when used in various combinations. For a start, post the section of JSP that's supposed to render this select tag, and tell us about 'supervisors'. Is it in the ActionForm? What type of Collection is it? What's happening is that Struts is calling the getSupervisors() method on some bean, and it's not the one that has that method. How you fix that depends on where 'supervisors' lives. -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
replacing messages tag with fmt tag - can both exist at 1x?
does anyone have the messages tag working in the same application as the fmt tag using the fmt tag for displaying messages in some pages and messages for other pages? can you implement both at once? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: replacing messages tag with fmt tag - can both exist at 1x?
Yes, just point them to the same file. -- James Mitchell Software Engineer / Open Source Evangelist EdgeTech, Inc. 678.910.8017 AIM: jmitchtx MSN: [EMAIL PROTECTED] - Original Message - From: Menke, John [EMAIL PROTECTED] To: Struts (E-mail) [EMAIL PROTECTED] Sent: Monday, March 01, 2004 10:16 AM Subject: replacing messages tag with fmt tag - can both exist at 1x? does anyone have the messages tag working in the same application as the fmt tag using the fmt tag for displaying messages in some pages and messages for other pages? can you implement both at once? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Xhtml tag usage question
I tried to insert the xhtml tag in my pages, but the only way I found is to insert it in each tile that composes my page. It seems it is not sufficient to put it in the template file, or in the page using the template. Is there a better approach ? Any help is appreciated Renato Renato Romano Sistemi e Telematica S.p.A. Calata Grazie - Vial Al Molo Giano 16127 - GENOVA e-mail: [EMAIL PROTECTED] Tel.: 010 2712603 _ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Xhtml tag usage question
Unfortunately it saves the xhtml 'flag' in page scope so there isn't much you can do about it. Background: BaseHandlerTag has an isXhtml() method which calls the TagUtils.isXhtml() method which checks the xhtml 'flag' in page scope. I did think a solution would be to override the TagUtils.isXhtml() method to either always return 'true' or check a flag in request scope (which you would have to set some way) - but unfortunately the instance variable for TagUtils is both private and final - so theres no way to extend and implement your own custom TagUtils version in 'vanilla' struts. If you build your own version of struts, you could change TagUtils itself, so maybe thats an option for you - but then every time you take a new struts version you have to re-implement your change. Another alternative is to extend the struts tags to create 'xhtml' versions - all you would have to do is override the isXhtml() method there. For example public class XhtmlTextTag extends TextTag public XhtmlTextTag () { super(); } protected boolean isXhtml() { return true; } } So I think you have a few options: - put the html:xhtml tag in every jsp - build your own version of struts and change TagUtils - extend the struts tags to create xhtml versions Personally, I would go with html:xhtml for now and try to get struts changed so that either the scope of the xhtml flag can be customized or TagUtils can be extended and overriden. Niall - Original Message - From: Renato Romano [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Thursday, February 26, 2004 8:49 AM Subject: Xhtml tag usage question I tried to insert the xhtml tag in my pages, but the only way I found is to insert it in each tile that composes my page. It seems it is not sufficient to put it in the template file, or in the page using the template. Is there a better approach ? Any help is appreciated Renato Renato Romano Sistemi e Telematica S.p.A. Calata Grazie - Vial Al Molo Giano 16127 - GENOVA e-mail: [EMAIL PROTECTED] Tel.: 010 2712603 _ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Xhtml tag usage question
Thank you very much for your detailed explanation!!! Renato Renato Romano Sistemi e Telematica S.p.A. Calata Grazie - Vial Al Molo Giano 16127 - GENOVA e-mail: [EMAIL PROTECTED] Tel.: 010 2712603 _ -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: giovedì 26 febbraio 2004 12.36 To: Struts Users Mailing List Subject: Re: Xhtml tag usage question Unfortunately it saves the xhtml 'flag' in page scope so there isn't much you can do about it. Background: BaseHandlerTag has an isXhtml() method which calls the TagUtils.isXhtml() method which checks the xhtml 'flag' in page scope. I did think a solution would be to override the TagUtils.isXhtml() method to either always return 'true' or check a flag in request scope (which you would have to set some way) - but unfortunately the instance variable for TagUtils is both private and final - so theres no way to extend and implement your own custom TagUtils version in 'vanilla' struts. If you build your own version of struts, you could change TagUtils itself, so maybe thats an option for you - but then every time you take a new struts version you have to re-implement your change. Another alternative is to extend the struts tags to create 'xhtml' versions - all you would have to do is override the isXhtml() method there. For example public class XhtmlTextTag extends TextTag public XhtmlTextTag () { super(); } protected boolean isXhtml() { return true; } } So I think you have a few options: - put the html:xhtml tag in every jsp - build your own version of struts and change TagUtils - extend the struts tags to create xhtml versions Personally, I would go with html:xhtml for now and try to get struts changed so that either the scope of the xhtml flag can be customized or TagUtils can be extended and overriden. Niall - Original Message - From: Renato Romano [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Thursday, February 26, 2004 8:49 AM Subject: Xhtml tag usage question I tried to insert the xhtml tag in my pages, but the only way I found is to insert it in each tile that composes my page. It seems it is not sufficient to put it in the template file, or in the page using the template. Is there a better approach ? Any help is appreciated Renato Renato Romano Sistemi e Telematica S.p.A. Calata Grazie - Vial Al Molo Giano 16127 - GENOVA e-mail: [EMAIL PROTECTED] Tel.: 010 2712603 _ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts Tag Lib Documentation/Tutorials
Hi All, Could any one of you pls let me know URL's to find the Documentation of the Struts TagLibs .. Thanks Sateesh - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts Tag Lib Documentation/Tutorials
http://jakarta.apache.org/struts/userGuide/index.html If you look at the second part of the menu of the left titled Developer Guides you can see the all the different tag packages guides. Niall - Original Message - From: Kommineni, Sateesh (GE Consumer Industrial) [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 25, 2004 12:20 PM Subject: Struts Tag Lib Documentation/Tutorials Hi All, Could any one of you pls let me know URL's to find the Documentation of the Struts TagLibs .. Thanks Sateesh - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Nested nest Tag
Hi there, I am using Struts 1.1 and Java SE 1.4.2.02 and Java EE 1.4 I have an object called SccDTO.java which is extended by many objects, but I will use LocDTO,java as the example here. In my SccBean.java - which extends the ValidatorForm - I have getter and setter methods for a SccDTO object. I am using nested:nest property=sccDTO nested:write property=type/ This is fine, but I actually sometimes want to access methods in the LocDTO, and sometimes from the other objects which extend the SccDTO. Now I realise that the SccDTO has no getter and setter methods for the LocDTO methods, so this is not going to work, but is there a way around this? Any help would be much appreciated, Gillian Daniel
RE: Nested nest Tag
Have you tried using the LocDTO properties? I think it will just work - Struts uses bean utils which looks at the object you are trying to operate on, rather than the type it is declared as. Paul -Original Message- From: Daniel, Gillian [mailto:[EMAIL PROTECTED] Sent: 25 February 2004 14:31 To: [EMAIL PROTECTED] Subject: Nested nest Tag Hi there, I am using Struts 1.1 and Java SE 1.4.2.02 and Java EE 1.4 I have an object called SccDTO.java which is extended by many objects, but I will use LocDTO,java as the example here. In my SccBean.java - which extends the ValidatorForm - I have getter and setter methods for a SccDTO object. I am using nested:nest property=sccDTO nested:write property=type/ This is fine, but I actually sometimes want to access methods in the LocDTO, and sometimes from the other objects which extend the SccDTO. Now I realise that the SccDTO has no getter and setter methods for the LocDTO methods, so this is not going to work, but is there a way around this? Any help would be much appreciated, Gillian Daniel ** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Nested nest Tag
Thanks very much for the advice, I tried it and it did work. I had tried before but it didn't work, but I tried again and it did work, so thanks for prompting me to try again. Something must have been wrong the first time. Thanks again, Gillian -Original Message- From: Paul McCulloch [mailto:[EMAIL PROTECTED] Sent: 25 February 2004 16:23 To: 'Struts Users Mailing List' Subject: RE: Nested nest Tag Have you tried using the LocDTO properties? I think it will just work - Struts uses bean utils which looks at the object you are trying to operate on, rather than the type it is declared as. Paul -Original Message- From: Daniel, Gillian [mailto:[EMAIL PROTECTED] Sent: 25 February 2004 14:31 To: [EMAIL PROTECTED] Subject: Nested nest Tag Hi there, I am using Struts 1.1 and Java SE 1.4.2.02 and Java EE 1.4 I have an object called SccDTO.java which is extended by many objects, but I will use LocDTO,java as the example here. In my SccBean.java - which extends the ValidatorForm - I have getter and setter methods for a SccDTO object. I am using nested:nest property=sccDTO nested:write property=type/ This is fine, but I actually sometimes want to access methods in the LocDTO, and sometimes from the other objects which extend the SccDTO. Now I realise that the SccDTO has no getter and setter methods for the LocDTO methods, so this is not going to work, but is there a way around this? Any help would be much appreciated, Gillian Daniel ** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Nested nest Tag
Sorry to bother you again, but I have another stumbling block. Although I can get the details from the LocDTO with nested:nest property=sccDTO nested:write property=type/ The problem is with this line. taskTitle is an attribute of LocDTO but not SccDTO. When I submit my form, obviously an object of type SccDTO is created, since that is in the nested:nest tag, and the property taskTitle does not get set. nested:text property=taskTitle size=55 maxlength=55 styleClass=editorlargetextbox/ Is there a way I can force the jsp to sometimes submit an LocDTO rather than the SccDTO?? Thanks again, Gillian Daniel -Original Message- From: Daniel, Gillian Sent: 25 February 2004 16:27 To: Struts Users Mailing List Subject: RE: Nested nest Tag Thanks very much for the advice, I tried it and it did work. I had tried before but it didn't work, but I tried again and it did work, so thanks for prompting me to try again. Something must have been wrong the first time. Thanks again, Gillian -Original Message- From: Paul McCulloch [mailto:[EMAIL PROTECTED] Sent: 25 February 2004 16:23 To: 'Struts Users Mailing List' Subject: RE: Nested nest Tag Have you tried using the LocDTO properties? I think it will just work - Struts uses bean utils which looks at the object you are trying to operate on, rather than the type it is declared as. Paul -Original Message- From: Daniel, Gillian [mailto:[EMAIL PROTECTED] Sent: 25 February 2004 14:31 To: [EMAIL PROTECTED] Subject: Nested nest Tag Hi there, I am using Struts 1.1 and Java SE 1.4.2.02 and Java EE 1.4 I have an object called SccDTO.java which is extended by many objects, but I will use LocDTO,java as the example here. In my SccBean.java - which extends the ValidatorForm - I have getter and setter methods for a SccDTO object. I am using nested:nest property=sccDTO nested:write property=type/ This is fine, but I actually sometimes want to access methods in the LocDTO, and sometimes from the other objects which extend the SccDTO. Now I realise that the SccDTO has no getter and setter methods for the LocDTO methods, so this is not going to work, but is there a way around this? Any help would be much appreciated, Gillian Daniel ** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Nested nest Tag
That should be fine as well. I'd test that you can read the property first before trying to write it: nested:nest property=sccDTO nested:write property=taskTitle/ Paul -Original Message- From: Daniel, Gillian [mailto:[EMAIL PROTECTED] Sent: 25 February 2004 18:07 To: Struts Users Mailing List Subject: RE: Nested nest Tag Sorry to bother you again, but I have another stumbling block. Although I can get the details from the LocDTO with nested:nest property=sccDTO nested:write property=type/ The problem is with this line. taskTitle is an attribute of LocDTO but not SccDTO. When I submit my form, obviously an object of type SccDTO is created, since that is in the nested:nest tag, and the property taskTitle does not get set. nested:text property=taskTitle size=55 maxlength=55 styleClass=editorlargetextbox/ Is there a way I can force the jsp to sometimes submit an LocDTO rather than the SccDTO?? Thanks again, Gillian Daniel -Original Message- From: Daniel, Gillian Sent: 25 February 2004 16:27 To: Struts Users Mailing List Subject: RE: Nested nest Tag Thanks very much for the advice, I tried it and it did work. I had tried before but it didn't work, but I tried again and it did work, so thanks for prompting me to try again. Something must have been wrong the first time. Thanks again, Gillian -Original Message- From: Paul McCulloch [mailto:[EMAIL PROTECTED] Sent: 25 February 2004 16:23 To: 'Struts Users Mailing List' Subject: RE: Nested nest Tag Have you tried using the LocDTO properties? I think it will just work - Struts uses bean utils which looks at the object you are trying to operate on, rather than the type it is declared as. Paul -Original Message- From: Daniel, Gillian [mailto:[EMAIL PROTECTED] Sent: 25 February 2004 14:31 To: [EMAIL PROTECTED] Subject: Nested nest Tag Hi there, I am using Struts 1.1 and Java SE 1.4.2.02 and Java EE 1.4 I have an object called SccDTO.java which is extended by many objects, but I will use LocDTO,java as the example here. In my SccBean.java - which extends the ValidatorForm - I have getter and setter methods for a SccDTO object. I am using nested:nest property=sccDTO nested:write property=type/ This is fine, but I actually sometimes want to access methods in the LocDTO, and sometimes from the other objects which extend the SccDTO. Now I realise that the SccDTO has no getter and setter methods for the LocDTO methods, so this is not going to work, but is there a way around this? Any help would be much appreciated, Gillian Daniel ** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Must have action=..... in html:form tag?
Struts places mapping name in the request before redirecting to the JSP We extended FormTag and allows action not to be mandatory. If no action is defined in the tag, we have the following code to get action name: ActionMapping mapping = (ActionMapping)pageContext.getRequest().getAttribute(Action.MAPPING_KEY) ; if (mapping != null) { value = mapping.getPath(); if (value != null) value = value.substring(1); } action = value; Besides, we use DispatchAction and our FormTag creates the hidden property needed to perform dispatch introspection, for example, if you define parameter=dispatch, a input tyoe=hidden name=dispatch tag will automatically be created by FormTag. We use self-detecting mapping name to reuse the same JSP in different ActionMappings, and use DispatchAction to determine, for example, if we have to perform a save or an update. We have a dispatch method name called store, witch determines if user is updating or creating (with a mark set in request or session) and calls itself to save or update. From JSP view, you always call store. Cheers. Guillermo. -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Martes, 24 de Febrero de 2004 02:51 a.m. To: 'Struts Users Mailing List' Subject: RE: Must have action=. in html:form tag? I understand DispatchAction fairly well. But because there are certain extra things I need to do that DispatchAction won't help. Anyway, Shyam's suggestion of using logic:equal to display the appropriate button with associate action should take care of my problem and I think it will be pretty simple. Thanks Shyam. I would also like to thank everyone who has responded to my plead for help (Geeta, Paul, Hubert,Ramadoss and Khalid etc.) Thanks you all. -Original Message- From: Shyam A [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 6:34 PM To: Struts Users Mailing List Subject: RE: Must have action=. in html:form tag? Well, as the others said DispatchAction is the way to go. Since, you already have two separate Actions defined, I thought it may be worthwhile to give my idea a try. What I meant was, instead of a submit button html:submit, use a normal button input type=button. You can display a create or update button based on the previous screen, i.e. logic:equal name=formName property=whichAction value =create input type=button name=Create onClick=submitForm /logic:equal logic:equal name=formName property=whichAction value =update input type=button name=Update onClick=submitForm /logic:equal Then, in your submitForm() Javascript, check for which button is clicked, or check for whichAction as you're doin now, and set the action accordingly. (Sorry, I'm not an expert in Javascript!) HTH, Shyam --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: Shyam: I am not sure what you mean, can you elaborate that? The current form only has one 'submit' button. After the user fills in data on the current form, I want the data to be submitted to the DB and then automatically be taken back to the 'previous' screen. This previous screen can be a 'Create main screen' or an 'Update main screen'. I use a hidden field 'whichAction' to remember which is the 'previous' screen. So when the user submits the input data on the cuurrent form, that's when the javascript submitForm() function decides which screen (/app/fdd/shopWorkOrder/fromCreateShopWorkOrder or /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder) to return to. Example: Create Main screen use 'theForm' to input data return back to Create main Update Main screen - use 'theForm' to input data return back to Update main (this screen 'theForm' is where I decide which precious screen to return to based on the hidden field whichAction. That's why form action has to be dynamic My user only wants ONE submit button on theForm and the application should be smart enough to return to the correct 'previous' page. -Original Message- From: Shyam A [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 5:31 PM To: Struts Users Mailing List Subject: RE: Must have action=. in html:form tag? Just a suggestion. Not sure if I'm right... Instead of using onSubmit() event of your html:form, why don't you call the Javascript when the user clicks/submits the associcated HTML component - Create/Update button, and set the action accordingly. HTH, Shyam __ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
Loading attributes into a tag attribute
Hello, I am wondering what is the best method for loading a variable passed to a page as an attribute into a tag's attribute? For Example: I have a String stored in a request attribute and it's called startDate. In the JSP, I do the following: bean:define id=startDate name=startDate/ bean:message key=salesResults.main.table.title arg0='%= new String( + startDate) %'/ It strikes me that there is probably a better, cleaner way to do this. How would you use JSTL to do this? Originally, I wanted to use JSTL but it appears that the c:set tag doesn't make startDate available as a scripting value. c:set var=startDate property=${startDate}/ Mike Zatko * I know this topic has probably been covered before but the mailing list archive was giving me timeouts. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Loading attributes into a tag attribute
Mike, Use this link to get to the struts-user archives: http://marc.theaimsgroup.com/?l=struts-user -Richard --- Mike Zatko [EMAIL PROTECTED] wrote: Hello, I am wondering what is the best method for loading a variable passed to a page as an attribute into a tag's attribute? For Example: I have a String stored in a request attribute and it's called startDate. In the JSP, I do the following: bean:define id=startDate name=startDate/ bean:message key=salesResults.main.table.title arg0='%= new String( + startDate) %'/ It strikes me that there is probably a better, cleaner way to do this. How would you use JSTL to do this? Originally, I wanted to use JSTL but it appears that the c:set tag doesn't make startDate available as a scripting value. c:set var=startDate property=${startDate}/ Mike Zatko * I know this topic has probably been covered before but the mailing list archive was giving me timeouts. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:logic tag doesn't recognize Struts dataBean property's val ue
Hi: In my struts-based application I am using a html:logic tag in my JSP page to print two links depends on the value of a struts-based databean's property. Bacially on this JSP page, a list of records wil be displayed. Next to each record, either a Create link or an Update link should be displayed depends upon the property 'shopOrderExist. If this property has the value notExist, it should display the Create link. If it is not equal to notExist, it should display the Update link. For some reason, the Update link is always displayed even though shopOrderExist has a value of notExist. So the logic:equal tag is not comparing things correctly. Am I doing it wrong? (note, the property shopOrderExist is of type String and in Debug I see that its value is notExist) Here's my code: logic:iterate id=sequenceList collection=%=ShopWorkOrderSearchFormBean.getPage()% type=com.cat.fdd.dataBean.shopWorkOrder.ShopWorkOrderSearchBean tr td class=listCellbean:write name=sequenceList property=sequence/ /td !-- If the ShopOrderExist attribue is not equal to notExist, display Create link ,otherwise Update link-- logic:equal name=sequenceList property=shopOrderExist value=notExist a href=app/fdd/shopWorkOrder/CreateShopWorkOrderRequest.exec img src=images/icoAdd.gif border=0/a /logic:equal logic:notEqual name=sequenceList property=shopOrderExist value=notExist a href=app/fdd/shopWorkOrder/UpdateShopWorkOrderRequest.exec img src=images/icoEdit.gif border=0/a /logic:notEqual /td /tr Thanks in advance! Stella - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:logic tag doesn't recognize Struts dataBean property's value
I doubt the problem is logic:equal. Your jsp looks OK - why not try outputting the shopOrderExist property in your table (along with yhe other stuff) - something along the lines of: td class=listCellbean:write name=sequenceList property=shopOrderExist//td That way, you can see the value the logic:equal/notEqual is testing against. Niall - Original Message - From: Au-Yeung, Stella H [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 23, 2004 3:34 PM Subject: html:logic tag doesn't recognize Struts dataBean property's value Hi: In my struts-based application I am using a html:logic tag in my JSP page to print two links depends on the value of a struts-based databean's property. Bacially on this JSP page, a list of records wil be displayed. Next to each record, either a Create link or an Update link should be displayed depends upon the property 'shopOrderExist. If this property has the value notExist, it should display the Create link. If it is not equal to notExist, it should display the Update link. For some reason, the Update link is always displayed even though shopOrderExist has a value of notExist. So the logic:equal tag is not comparing things correctly. Am I doing it wrong? (note, the property shopOrderExist is of type String and in Debug I see that its value is notExist) Here's my code: logic:iterate id=sequenceList collection=%=ShopWorkOrderSearchFormBean.getPage()% type=com.cat.fdd.dataBean.shopWorkOrder.ShopWorkOrderSearchBean tr td class=listCellbean:write name=sequenceList property=sequence/ /td !-- If the ShopOrderExist attribue is not equal to notExist, display Create link ,otherwise Update link-- logic:equal name=sequenceList property=shopOrderExist value=notExist a href=app/fdd/shopWorkOrder/CreateShopWorkOrderRequest.exec img src=images/icoAdd.gif border=0/a /logic:equal logic:notEqual name=sequenceList property=shopOrderExist value=notExist a href=app/fdd/shopWorkOrder/UpdateShopWorkOrderRequest.exec img src=images/icoEdit.gif border=0/a /logic:notEqual /td /tr Thanks in advance! Stella - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:logic tag doesn't recognize Struts dataBean property's value
There is an error in your JSP. IF that is the complete jsp post, then you are missing the closing iterate tag /logic:iterate So anything between the interate tag is not being evaulated, I bet if you look at the rendered html output source, you will actually see the logic:iterate tags Khalid Quoting Niall Pemberton [EMAIL PROTECTED]: I doubt the problem is logic:equal. Your jsp looks OK - why not try outputting the shopOrderExist property in your table (along with yhe other stuff) - something along the lines of: td class=listCellbean:write name=sequenceList property=shopOrderExist//td That way, you can see the value the logic:equal/notEqual is testing against. Niall - Original Message - From: Au-Yeung, Stella H [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 23, 2004 3:34 PM Subject: html:logic tag doesn't recognize Struts dataBean property's value Hi: In my struts-based application I am using a html:logic tag in my JSP page to print two links depends on the value of a struts-based databean's property. Bacially on this JSP page, a list of records wil be displayed. Next to each record, either a Create link or an Update link should be displayed depends upon the property 'shopOrderExist. If this property has the value notExist, it should display the Create link. If it is not equal to notExist, it should display the Update link. For some reason, the Update link is always displayed even though shopOrderExist has a value of notExist. So the logic:equal tag is not comparing things correctly. Am I doing it wrong? (note, the property shopOrderExist is of type String and in Debug I see that its value is notExist) Here's my code: logic:iterate id=sequenceList collection=%=ShopWorkOrderSearchFormBean.getPage()% type=com.cat.fdd.dataBean.shopWorkOrder.ShopWorkOrderSearchBean tr td class=listCellbean:write name=sequenceList property=sequence/ /td !-- If the ShopOrderExist attribue is not equal to notExist, display Create link ,otherwise Update link-- logic:equal name=sequenceList property=shopOrderExist value=notExist a href=app/fdd/shopWorkOrder/CreateShopWorkOrderRequest.exec img src=images/icoAdd.gif border=0/a /logic:equal logic:notEqual name=sequenceList property=shopOrderExist value=notExist a href=app/fdd/shopWorkOrder/UpdateShopWorkOrderRequest.exec img src=images/icoEdit.gif border=0/a /logic:notEqual /td /tr Thanks in advance! Stella - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Khalid K. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:logic tag doesn't recognize Struts dataBean property's value
As you suggested I will display the shopOrderExist property on the form too. I know my loop is working fine because each of the ecord is displayed correctly. The only problem is when the flag is notExist, it will display the Update Link instead of the Create Link. That's why I thought my logic:equal is not correct. -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 11:16 AM To: Struts Users Mailing List Subject: Re: html:logic tag doesn't recognize Struts dataBean property's value I doubt the problem is logic:equal. Your jsp looks OK - why not try outputting the shopOrderExist property in your table (along with yhe other stuff) - something along the lines of: td class=listCellbean:write name=sequenceList property=shopOrderExist//td That way, you can see the value the logic:equal/notEqual is testing against. Niall - Original Message - From: Au-Yeung, Stella H [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 23, 2004 3:34 PM Subject: html:logic tag doesn't recognize Struts dataBean property's value Hi: In my struts-based application I am using a html:logic tag in my JSP page to print two links depends on the value of a struts-based databean's property. Bacially on this JSP page, a list of records wil be displayed. Next to each record, either a Create link or an Update link should be displayed depends upon the property 'shopOrderExist. If this property has the value notExist, it should display the Create link. If it is not equal to notExist, it should display the Update link. For some reason, the Update link is always displayed even though shopOrderExist has a value of notExist. So the logic:equal tag is not comparing things correctly. Am I doing it wrong? (note, the property shopOrderExist is of type String and in Debug I see that its value is notExist) Here's my code: logic:iterate id=sequenceList collection=%=ShopWorkOrderSearchFormBean.getPage()% type=com.cat.fdd.dataBean.shopWorkOrder.ShopWorkOrderSearchBean tr td class=listCellbean:write name=sequenceList property=sequence/ /td !-- If the ShopOrderExist attribue is not equal to notExist, display Create link ,otherwise Update link-- logic:equal name=sequenceList property=shopOrderExist value=notExist a href=app/fdd/shopWorkOrder/CreateShopWorkOrderRequest.exec img src=images/icoAdd.gif border=0/a /logic:equal logic:notEqual name=sequenceList property=shopOrderExist value=notExist a href=app/fdd/shopWorkOrder/UpdateShopWorkOrderRequest.exec img src=images/icoEdit.gif border=0/a /logic:notEqual /td /tr Thanks in advance! Stella - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:logic tag doesn't recognize Struts dataBean property's value
Niall: I did what you suggested and print out the value of the property shopOrderExist. It is equal to notExist as expected. But somehow the Update link is still displayed instead of the Create link. Do you think I have to do something to the value of shopOrderExist such as .trim() or convert to true before letting it be compared in the logic:equal tag? logic:iterate id=sequenceList collection=%=ShopWorkOrderSearchFormBean.getPage()% type=com.cat.fdd.dataBean.shopWorkOrder.ShopWorkOrderSearchBean tr td class=listCellbean:write name=sequenceList property=sequence/ /td td class=listCellbean:write name=sequenceList property=shopOrderExist//td ADDED td class=listCellnobr !-- If the ShopOrderExist attribue is not equal to notExist, display Create link ,otherwise Update link-- logic:equal name=sequenceList property=shopOrderExist value=notExist a href=app/fdd/shopWorkOrder/CreateShopWorkOrderRequest.exec img src=images/icoAdd.gif border=0/a /logic:equal logic:notEqual name=sequenceList property=shopOrderExist value=notExist a href=app/fdd/shopWorkOrder/UpdateShopWorkOrderRequest.exec img src=images/icoEdit.gif border=0/a /logic:notEqual /td /tr /logic:iterate -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 11:16 AM To: Struts Users Mailing List Subject: Re: html:logic tag doesn't recognize Struts dataBean property's value I doubt the problem is logic:equal. Your jsp looks OK - why not try outputting the shopOrderExist property in your table (along with yhe other stuff) - something along the lines of: td class=listCellbean:write name=sequenceList property=shopOrderExist//td That way, you can see the value the logic:equal/notEqual is testing against. Niall - Original Message - From: Au-Yeung, Stella H [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 23, 2004 3:34 PM Subject: html:logic tag doesn't recognize Struts dataBean property's value Hi: In my struts-based application I am using a html:logic tag in my JSP page to print two links depends on the value of a struts-based databean's property. Bacially on this JSP page, a list of records wil be displayed. Next to each record, either a Create link or an Update link should be displayed depends upon the property 'shopOrderExist. If this property has the value notExist, it should display the Create link. If it is not equal to notExist, it should display the Update link. For some reason, the Update link is always displayed even though shopOrderExist has a value of notExist. So the logic:equal tag is not comparing things correctly. Am I doing it wrong? (note, the property shopOrderExist is of type String and in Debug I see that its value is notExist) Here's my code: logic:iterate id=sequenceList collection=%=ShopWorkOrderSearchFormBean.getPage()% type=com.cat.fdd.dataBean.shopWorkOrder.ShopWorkOrderSearchBean tr td class=listCellbean:write name=sequenceList property=sequence/ /td !-- If the ShopOrderExist attribue is not equal to notExist, display Create link ,otherwise Update link-- logic:equal name=sequenceList property=shopOrderExist value=notExist a href=app/fdd/shopWorkOrder/CreateShopWorkOrderRequest.exec img src=images/icoAdd.gif border=0/a /logic:equal logic:notEqual name=sequenceList property=shopOrderExist value=notExist a href=app/fdd/shopWorkOrder/UpdateShopWorkOrderRequest.exec img src=images/icoEdit.gif border=0/a /logic:notEqual /td /tr Thanks in advance! Stella - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:logic tag doesn't recognize Struts dataBean property'svalue
Jumping in here.. yes, I think you need to trim() before you check. Also, if that too doesn't work, can you check for something positive (like if ShopOrderExist is equals to false rather than ShopOrderExist is not equals to not exists..?). Another thought, try to get this to work just using oridinary jsp tags and java code (% java code here %) and see oif things work. Than you can narrow the problem down to tag issues.. Good luck! Geeta Au-Yeung, Stella H wrote: Niall: I did what you suggested and print out the value of the property shopOrderExist. It is equal to notExist as expected. But somehow the Update link is still displayed instead of the Create link. Do you think I have to do something to the value of shopOrderExist such as .trim() or convert to true before letting it be compared in the logic:equal tag? logic:iterate id=sequenceList collection=%=ShopWorkOrderSearchFormBean.getPage()% type=com.cat.fdd.dataBean.shopWorkOrder.ShopWorkOrderSearchBean tr td class=listCellbean:write name=sequenceList property=sequence/ /td td class=listCellbean:write name=sequenceList property=shopOrderExist//td ADDED td class=listCellnobr !-- If the ShopOrderExist attribue is not equal to notExist, display Create link ,otherwise Update link-- logic:equal name=sequenceList property=shopOrderExist value=notExist a href=app/fdd/shopWorkOrder/CreateShopWorkOrderRequest.exec img src=images/icoAdd.gif border=0/a /logic:equal logic:notEqual name=sequenceList property=shopOrderExist value=notExist a href=app/fdd/shopWorkOrder/UpdateShopWorkOrderRequest.exec img src=images/icoEdit.gif border=0/a /logic:notEqual /td /tr /logic:iterate -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 11:16 AM To: Struts Users Mailing List Subject: Re: html:logic tag doesn't recognize Struts dataBean property's value I doubt the problem is logic:equal. Your jsp looks OK - why not try outputting the shopOrderExist property in your table (along with yhe other stuff) - something along the lines of: td class=listCellbean:write name=sequenceList property=shopOrderExist//td That way, you can see the value the logic:equal/notEqual is testing against. Niall - Original Message - From: Au-Yeung, Stella H [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 23, 2004 3:34 PM Subject: html:logic tag doesn't recognize Struts dataBean property's value Hi: In my struts-based application I am using a html:logic tag in my JSP page to print two links depends on the value of a struts-based databean's property. Bacially on this JSP page, a list of records wil be displayed. Next to each record, either a Create link or an Update link should be displayed depends upon the property 'shopOrderExist. If this property has the value notExist, it should display the Create link. If it is not equal to notExist, it should display the Update link. For some reason, the Update link is always displayed even though shopOrderExist has a value of notExist. So the logic:equal tag is not comparing things correctly. Am I doing it wrong? (note, the property shopOrderExist is of type String and in Debug I see that its value is notExist) Here's my code: logic:iterate id=sequenceList collection=%=ShopWorkOrderSearchFormBean.getPage()% type=com.cat.fdd.dataBean.shopWorkOrder.ShopWorkOrderSearchBean tr td class=listCellbean:write name=sequenceList property=sequence/ /td !-- If the ShopOrderExist attribue is not equal to notExist, display Create link ,otherwise Update link-- logic:equal name=sequenceList property=shopOrderExist value=notExist a href=app/fdd/shopWorkOrder/CreateShopWorkOrderRequest.exec img src=images/icoAdd.gif border=0/a /logic:equal logic:notEqual name=sequenceList property=shopOrderExist value=notExist a href=app/fdd/shopWorkOrder/UpdateShopWorkOrderRequest.exec img src=images/icoEdit.gif border=0/a /logic:notEqual /td /tr Thanks in advance! Stella - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:logic tag doesn't recognize Struts dataBean property's value
Yes Geeta. I do need trim() and that makes it work. That is so strange even though when I printed out ShopOrderExist to confirm it has no trailing blanks. Thanks. -Original Message- From: Geeta Ramani [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 1:45 PM To: Struts Users Mailing List Subject: Re: html:logic tag doesn't recognize Struts dataBean property'svalue Jumping in here.. yes, I think you need to trim() before you check. Also, if that too doesn't work, can you check for something positive (like if ShopOrderExist is equals to false rather than ShopOrderExist is not equals to not exists..?). Another thought, try to get this to work just using oridinary jsp tags and java code (% java code here %) and see oif things work. Than you can narrow the problem down to tag issues.. Good luck! Geeta Au-Yeung, Stella H wrote: Niall: I did what you suggested and print out the value of the property shopOrderExist. It is equal to notExist as expected. But somehow the Update link is still displayed instead of the Create link. Do you think I have to do something to the value of shopOrderExist such as .trim() or convert to true before letting it be compared in the logic:equal tag? logic:iterate id=sequenceList collection=%=ShopWorkOrderSearchFormBean.getPage()% type=com.cat.fdd.dataBean.shopWorkOrder.ShopWorkOrderSearchBean tr td class=listCellbean:write name=sequenceList property=sequence/ /td td class=listCellbean:write name=sequenceList property=shopOrderExist//td ADDED td class=listCellnobr !-- If the ShopOrderExist attribue is not equal to notExist, display Create link ,otherwise Update link-- logic:equal name=sequenceList property=shopOrderExist value=notExist a href=app/fdd/shopWorkOrder/CreateShopWorkOrderRequest.exec img src=images/icoAdd.gif border=0/a /logic:equal logic:notEqual name=sequenceList property=shopOrderExist value=notExist a href=app/fdd/shopWorkOrder/UpdateShopWorkOrderRequest.exec img src=images/icoEdit.gif border=0/a /logic:notEqual /td /tr /logic:iterate -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 11:16 AM To: Struts Users Mailing List Subject: Re: html:logic tag doesn't recognize Struts dataBean property's value I doubt the problem is logic:equal. Your jsp looks OK - why not try outputting the shopOrderExist property in your table (along with yhe other stuff) - something along the lines of: td class=listCellbean:write name=sequenceList property=shopOrderExist//td That way, you can see the value the logic:equal/notEqual is testing against. Niall - Original Message - From: Au-Yeung, Stella H [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 23, 2004 3:34 PM Subject: html:logic tag doesn't recognize Struts dataBean property's value Hi: In my struts-based application I am using a html:logic tag in my JSP page to print two links depends on the value of a struts-based databean's property. Bacially on this JSP page, a list of records wil be displayed. Next to each record, either a Create link or an Update link should be displayed depends upon the property 'shopOrderExist. If this property has the value notExist, it should display the Create link. If it is not equal to notExist, it should display the Update link. For some reason, the Update link is always displayed even though shopOrderExist has a value of notExist. So the logic:equal tag is not comparing things correctly. Am I doing it wrong? (note, the property shopOrderExist is of type String and in Debug I see that its value is notExist) Here's my code: logic:iterate id=sequenceList collection=%=ShopWorkOrderSearchFormBean.getPage()% type=com.cat.fdd.dataBean.shopWorkOrder.ShopWorkOrderSearchBean tr td class=listCellbean:write name=sequenceList property=sequence/ /td !-- If the ShopOrderExist attribue is not equal to notExist, display Create link ,otherwise Update link-- logic:equal name=sequenceList property=shopOrderExist value=notExist a href=app/fdd/shopWorkOrder/CreateShopWorkOrderRequest.exec img src=images/icoAdd.gif border=0/a /logic:equal logic:notEqual name=sequenceList property=shopOrderExist value=notExist a href=app/fdd/shopWorkOrder/UpdateShopWorkOrderRequest.exec img src=images/icoEdit.gif border=0/a /logic:notEqual /td /tr Thanks in advance! Stella - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
Must have action=..... in html:form tag?
Hi: My html:form tag doesn't allow me to skip an 'action' attribue. If you look at my code below, I move the assignment of the 'form action' to the javascript function so which action to take is dynamically depends on the form element 'whichAction'. But the compiler insist I have to have the 'action' property right inside the html:form tag. But that doesn't allow me to choose the action dynamically. Does anyone have any suggestion? script language = Javascript function submitForm(frm) { var whichAction=frm.elements(whichAction) if (whichAction == create) { document.theForm.action = /app/fdd/shopWorkOrder/fromCreateShopWorkOrder; } else { document.theForm.action = /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder; } return true; } /script jsp:useBean id=ShopWorkOrderBean scope=request class=com.cat.sdl.fdd.formBean.shopWorkOrder.ShopWorkOrderForm/ html:form name=theForm method=post onSubmit=return submitForm(document.theForm) I got the following error with the above code: Parsing of JSP File '/app/fdd/shopWorkOrder/CreateTLFPart.jsp' failed: /app/fdd/shopWorkOrder/CreateTLFPart.jsp(28): required attribute 'action' not specified for tag 'form' probably occurred due to an error in /app/fdd/shopWorkOrder/CreateTLFPart.jsp line 28: html:form name=theForm method=post onSubmit=return submitForm(document.theForm) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Must have action=..... in html:form tag?
Specify the Action associated with fromCreateShopWorkOrder or fromUpdateShopWorkOrder in the html:form attribute. --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: Hi: My html:form tag doesn't allow me to skip an 'action' attribue. If you look at my code below, I move the assignment of the 'form action' to the javascript function so which action to take is dynamically depends on the form element 'whichAction'. But the compiler insist I have to have the 'action' property right inside the html:form tag. But that doesn't allow me to choose the action dynamically. Does anyone have any suggestion? script language = Javascript function submitForm(frm) { var whichAction=frm.elements(whichAction) if (whichAction == create) { document.theForm.action = /app/fdd/shopWorkOrder/fromCreateShopWorkOrder; } else { document.theForm.action = /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder; } return true; } /script jsp:useBean id=ShopWorkOrderBean scope=request class=com.cat.sdl.fdd.formBean.shopWorkOrder.ShopWorkOrderForm/ html:form name=theForm method=post onSubmit=return submitForm(document.theForm) I got the following error with the above code: Parsing of JSP File '/app/fdd/shopWorkOrder/CreateTLFPart.jsp' failed: /app/fdd/shopWorkOrder/CreateTLFPart.jsp(28): required attribute 'action' not specified for tag 'form' probably occurred due to an error in /app/fdd/shopWorkOrder/CreateTLFPart.jsp line 28: html:form name=theForm method=post onSubmit=return submitForm(document.theForm) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Must have action=..... in html:form tag?
Hubert: Can you elaborate that In othe words, how do I do everything that the function submitForm() does to dynamically pick an action all within the html:form tag? -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:36 PM To: Struts Users Mailing List Subject: Re: Must have action=. in html:form tag? Specify the Action associated with fromCreateShopWorkOrder or fromUpdateShopWorkOrder in the html:form attribute. --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: Hi: My html:form tag doesn't allow me to skip an 'action' attribue. If you look at my code below, I move the assignment of the 'form action' to the javascript function so which action to take is dynamically depends on the form element 'whichAction'. But the compiler insist I have to have the 'action' property right inside the html:form tag. But that doesn't allow me to choose the action dynamically. Does anyone have any suggestion? script language = Javascript function submitForm(frm) { var whichAction=frm.elements(whichAction) if (whichAction == create) { document.theForm.action = /app/fdd/shopWorkOrder/fromCreateShopWorkOrder; } else { document.theForm.action = /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder; } return true; } /script jsp:useBean id=ShopWorkOrderBean scope=request class=com.cat.sdl.fdd.formBean.shopWorkOrder.ShopWorkOrderForm/ html:form name=theForm method=post onSubmit=return submitForm(document.theForm) I got the following error with the above code: Parsing of JSP File '/app/fdd/shopWorkOrder/CreateTLFPart.jsp' failed: /app/fdd/shopWorkOrder/CreateTLFPart.jsp(28): required attribute 'action' not specified for tag 'form' probably occurred due to an error in /app/fdd/shopWorkOrder/CreateTLFPart.jsp line 28: html:form name=theForm method=post onSubmit=return submitForm(document.theForm) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Must have action=..... in html:form tag?
I never said anything close to what you're asking me. All I said is choose one of your two possible outcomes (doesn't matter which one), take the path that you gave it in the struts-config.xml, then use that in your html:form. Let's say you have the ff entry in your struts-config: action path=/fromCreateShopWorkOrder ... name=theForm forward .../ /action then in your html:form, specify that action: html:form action=/fromCreateShopWorkOrder method=post onSubmit=return submitForm(document.theForm) ... /html:form You do have action's associated with fromCreateShopWorkOrder and fromUpdateShopWorkOrder, right? - Hubert --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: Hubert: Can you elaborate that In othe words, how do I do everything that the function submitForm() does to dynamically pick an action all within the html:form tag? -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:36 PM To: Struts Users Mailing List Subject: Re: Must have action=. in html:form tag? Specify the Action associated with fromCreateShopWorkOrder or fromUpdateShopWorkOrder in the html:form attribute. --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: Hi: My html:form tag doesn't allow me to skip an 'action' attribue. If you look at my code below, I move the assignment of the 'form action' to the javascript function so which action to take is dynamically depends on the form element 'whichAction'. But the compiler insist I have to have the 'action' property right inside the html:form tag. But that doesn't allow me to choose the action dynamically. Does anyone have any suggestion? script language = Javascript function submitForm(frm) { var whichAction=frm.elements(whichAction) if (whichAction == create) { document.theForm.action = /app/fdd/shopWorkOrder/fromCreateShopWorkOrder; } else { document.theForm.action = /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder; } return true; } /script jsp:useBean id=ShopWorkOrderBean scope=request class=com.cat.sdl.fdd.formBean.shopWorkOrder.ShopWorkOrderForm/ html:form name=theForm method=post onSubmit=return submitForm(document.theForm) I got the following error with the above code: Parsing of JSP File '/app/fdd/shopWorkOrder/CreateTLFPart.jsp' failed: /app/fdd/shopWorkOrder/CreateTLFPart.jsp(28): required attribute 'action' not specified for tag 'form' probably occurred due to an error in /app/fdd/shopWorkOrder/CreateTLFPart.jsp line 28: html:form name=theForm method=post onSubmit=return submitForm(document.theForm) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Must have action=..... in html:form tag?
But I don't always want /app/fdd/shopWorkOrder/fromCreateShopWorkOrder to be my action all the time. I want the action for the form to be dynamic and depends on the form field whichAction. That's why I created the javascript function submitForm(frm) to pick the action dynamically. In other words, I have action mapping in my struts-config.xml file for both path /app/fdd/shopWorkOrder/fromCreateShopWorkOrder and /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder. But I want whichever one to be chosen to be dynamically. So how I do that all within the html:form tag? -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:58 PM To: Struts Users Mailing List Subject: RE: Must have action=. in html:form tag? I never said anything close to what you're asking me. All I said is choose one of your two possible outcomes (doesn't matter which one), take the path that you gave it in the struts-config.xml, then use that in your html:form. Let's say you have the ff entry in your struts-config: action path=/fromCreateShopWorkOrder ... name=theForm forward .../ /action then in your html:form, specify that action: html:form action=/fromCreateShopWorkOrder method=post onSubmit=return submitForm(document.theForm) ... /html:form You do have action's associated with fromCreateShopWorkOrder and fromUpdateShopWorkOrder, right? - Hubert --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: Hubert: Can you elaborate that In othe words, how do I do everything that the function submitForm() does to dynamically pick an action all within the html:form tag? -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:36 PM To: Struts Users Mailing List Subject: Re: Must have action=. in html:form tag? Specify the Action associated with fromCreateShopWorkOrder or fromUpdateShopWorkOrder in the html:form attribute. --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: Hi: My html:form tag doesn't allow me to skip an 'action' attribue. If you look at my code below, I move the assignment of the 'form action' to the javascript function so which action to take is dynamically depends on the form element 'whichAction'. But the compiler insist I have to have the 'action' property right inside the html:form tag. But that doesn't allow me to choose the action dynamically. Does anyone have any suggestion? script language = Javascript function submitForm(frm) { var whichAction=frm.elements(whichAction) if (whichAction == create) { document.theForm.action = /app/fdd/shopWorkOrder/fromCreateShopWorkOrder; } else { document.theForm.action = /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder; } return true; } /script jsp:useBean id=ShopWorkOrderBean scope=request class=com.cat.sdl.fdd.formBean.shopWorkOrder.ShopWorkOrderForm/ html:form name=theForm method=post onSubmit=return submitForm(document.theForm) I got the following error with the above code: Parsing of JSP File '/app/fdd/shopWorkOrder/CreateTLFPart.jsp' failed: /app/fdd/shopWorkOrder/CreateTLFPart.jsp(28): required attribute 'action' not specified for tag 'form' probably occurred due to an error in /app/fdd/shopWorkOrder/CreateTLFPart.jsp line 28: html:form name=theForm method=post onSubmit=return submitForm(document.theForm) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Must have action=..... in html:form tag?
Isn't that what the onsubmit attribute in your html:form is for? --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: But I don't always want /app/fdd/shopWorkOrder/fromCreateShopWorkOrder to be my action all the time. I want the action for the form to be dynamic and depends on the form field whichAction. That's why I created the javascript function submitForm(frm) to pick the action dynamically. In other words, I have action mapping in my struts-config.xml file for both path /app/fdd/shopWorkOrder/fromCreateShopWorkOrder and /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder. But I want whichever one to be chosen to be dynamically. So how I do that all within the html:form tag? --- Hubert Rabago [EMAIL PROTECTED] wrote: I never said anything close to what you're asking me. All I said is choose one of your two possible outcomes (doesn't matter which one), take the path that you gave it in the struts-config.xml, then use that in your html:form. Let's say you have the ff entry in your struts-config: action path=/fromCreateShopWorkOrder ... name=theForm forward .../ /action then in your html:form, specify that action: html:form action=/fromCreateShopWorkOrder method=post onsubmit=return submitForm(document.theForm) ... /html:form You do have action's associated with fromCreateShopWorkOrder and fromUpdateShopWorkOrder, right? - Hubert --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: Hubert: Can you elaborate that In othe words, how do I do everything that the function submitForm() does to dynamically pick an action all within the html:form tag? -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:36 PM To: Struts Users Mailing List Subject: Re: Must have action=. in html:form tag? Specify the Action associated with fromCreateShopWorkOrder or fromUpdateShopWorkOrder in the html:form attribute. --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: Hi: My html:form tag doesn't allow me to skip an 'action' attribue. If you look at my code below, I move the assignment of the 'form action' to the javascript function so which action to take is dynamically depends on the form element 'whichAction'. But the compiler insist I have to have the 'action' property right inside the html:form tag. But that doesn't allow me to choose the action dynamically. Does anyone have any suggestion? script language = Javascript function submitForm(frm) { var whichAction=frm.elements(whichAction) if (whichAction == create) { document.theForm.action = /app/fdd/shopWorkOrder/fromCreateShopWorkOrder; } else { document.theForm.action = /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder; } return true; } /script jsp:useBean id=ShopWorkOrderBean scope=request class=com.cat.sdl.fdd.formBean.shopWorkOrder.ShopWorkOrderForm/ html:form name=theForm method=post onSubmit=return submitForm(document.theForm) I got the following error with the above code: Parsing of JSP File '/app/fdd/shopWorkOrder/CreateTLFPart.jsp' failed: /app/fdd/shopWorkOrder/CreateTLFPart.jsp(28): required attribute 'action' not specified for tag 'form' probably occurred due to an error in /app/fdd/shopWorkOrder/CreateTLFPart.jsp line 28: html:form name=theForm method=post onSubmit=return submitForm(document.theForm) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Must have action=..... in html:form tag?
You can't. Correct me if I'm wrong, but the html:form action= property is what let's struts know which Form object to map your .jsp to. I'm don't think this will work for you unless all the possible urls you'd submit to share the same Form. What you may want to do instead then is look at something along the lines of DispatchAction, and pass a parameter that tells Struts which logical action it should forward to after hitting the for submit action (which would be a subclass of DispatchAction or something similar). Of course you could do as the previous poster said and change the action to submit to in your javascript onSubmit function: function onSubmit() { forms[0].action=/Some/New/Action.do; return true; } And then you'd put logic to decide where to actually submit to inside the onSubmit function. -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:13 PM To: 'Struts Users Mailing List' Subject: RE: Must have action=. in html:form tag? But I don't always want /app/fdd/shopWorkOrder/fromCreateShopWorkOrder to be my action all the time. I want the action for the form to be dynamic and depends on the form field whichAction. That's why I created the javascript function submitForm(frm) to pick the action dynamically. In other words, I have action mapping in my struts-config.xml file for both path /app/fdd/shopWorkOrder/fromCreateShopWorkOrder and /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder. But I want whichever one to be chosen to be dynamically. So how I do that all within the html:form tag? -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:58 PM To: Struts Users Mailing List Subject: RE: Must have action=. in html:form tag? I never said anything close to what you're asking me. All I said is choose one of your two possible outcomes (doesn't matter which one), take the path that you gave it in the struts-config.xml, then use that in your html:form. Let's say you have the ff entry in your struts-config: action path=/fromCreateShopWorkOrder ... name=theForm forward .../ /action then in your html:form, specify that action: html:form action=/fromCreateShopWorkOrder method=post onSubmit=return submitForm(document.theForm) ... /html:form You do have action's associated with fromCreateShopWorkOrder and fromUpdateShopWorkOrder, right? - Hubert --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: Hubert: Can you elaborate that In othe words, how do I do everything that the function submitForm() does to dynamically pick an action all within the html:form tag? -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:36 PM To: Struts Users Mailing List Subject: Re: Must have action=. in html:form tag? Specify the Action associated with fromCreateShopWorkOrder or fromUpdateShopWorkOrder in the html:form attribute. --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: Hi: My html:form tag doesn't allow me to skip an 'action' attribue. If you look at my code below, I move the assignment of the 'form action' to the javascript function so which action to take is dynamically depends on the form element 'whichAction'. But the compiler insist I have to have the 'action' property right inside the html:form tag. But that doesn't allow me to choose the action dynamically. Does anyone have any suggestion? script language = Javascript function submitForm(frm) { var whichAction=frm.elements(whichAction) if (whichAction == create) { document.theForm.action = /app/fdd/shopWorkOrder/fromCreateShopWorkOrder; } else { document.theForm.action = /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder; } return true; } /script jsp:useBean id=ShopWorkOrderBean scope=request class=com.cat.sdl.fdd.formBean.shopWorkOrder.ShopWorkOrderForm/ html:form name=theForm method=post onSubmit=return submitForm(document.theForm) I got the following error with the above code: Parsing of JSP File '/app/fdd/shopWorkOrder/CreateTLFPart.jsp' failed: /app/fdd/shopWorkOrder/CreateTLFPart.jsp(28): required attribute 'action' not specified for tag 'form' probably occurred due to an error in /app/fdd/shopWorkOrder/CreateTLFPart.jsp line 28: html:form name=theForm method=post onSubmit=return submitForm(document.theForm) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools - To unsubscribe, e-mail: [EMAIL PROTECTED
RE: Must have action=..... in html:form tag?
Just a suggestion. Not sure if I'm right... Instead of using onSubmit() event of your html:form, why don't you call the Javascript when the user clicks/submits the associcated HTML component - Create/Update button, and set the action accordingly. HTH, Shyam --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: But I don't always want /app/fdd/shopWorkOrder/fromCreateShopWorkOrder to be my action all the time. I want the action for the form to be dynamic and depends on the form field whichAction. That's why I created the javascript function submitForm(frm) to pick the action dynamically. In other words, I have action mapping in my struts-config.xml file for both path /app/fdd/shopWorkOrder/fromCreateShopWorkOrder and /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder. But I want whichever one to be chosen to be dynamically. So how I do that all within the html:form tag? -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:58 PM To: Struts Users Mailing List Subject: RE: Must have action=. in html:form tag? I never said anything close to what you're asking me. All I said is choose one of your two possible outcomes (doesn't matter which one), take the path that you gave it in the struts-config.xml, then use that in your html:form. Let's say you have the ff entry in your struts-config: action path=/fromCreateShopWorkOrder ... name=theForm forward .../ /action then in your html:form, specify that action: html:form action=/fromCreateShopWorkOrder method=post onSubmit=return submitForm(document.theForm) ... /html:form You do have action's associated with fromCreateShopWorkOrder and fromUpdateShopWorkOrder, right? - Hubert --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: Hubert: Can you elaborate that In othe words, how do I do everything that the function submitForm() does to dynamically pick an action all within the html:form tag? -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:36 PM To: Struts Users Mailing List Subject: Re: Must have action=. in html:form tag? Specify the Action associated with fromCreateShopWorkOrder or fromUpdateShopWorkOrder in the html:form attribute. --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: Hi: My html:form tag doesn't allow me to skip an 'action' attribue. If you look at my code below, I move the assignment of the 'form action' to the javascript function so which action to take is dynamically depends on the form element 'whichAction'. But the compiler insist I have to have the 'action' property right inside the html:form tag. But that doesn't allow me to choose the action dynamically. Does anyone have any suggestion? script language = Javascript function submitForm(frm) { var whichAction=frm.elements(whichAction) if (whichAction == create) { document.theForm.action = /app/fdd/shopWorkOrder/fromCreateShopWorkOrder; } else { document.theForm.action = /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder; } return true; } /script jsp:useBean id=ShopWorkOrderBean scope=request class=com.cat.sdl.fdd.formBean.shopWorkOrder.ShopWorkOrderForm/ html:form name=theForm method=post onSubmit=return submitForm(document.theForm) I got the following error with the above code: Parsing of JSP File '/app/fdd/shopWorkOrder/CreateTLFPart.jsp' failed: /app/fdd/shopWorkOrder/CreateTLFPart.jsp(28): required attribute 'action' not specified for tag 'form' probably occurred due to an error in /app/fdd/shopWorkOrder/CreateTLFPart.jsp line 28: html:form name=theForm method=post onSubmit=return submitForm(document.theForm) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
RE: Must have action=..... in html:form tag?
Paul and Hubert: If I do the following, just choose one of the paths to be the html:form action=..., you mean the form action can still be dynamically overwritten by what is actually picked in the submitForm() action? I thought I tried that and didn't work. script language = Javascript function submitForm(frm) { var whichAction=frm.elements(whichAction) if (whichAction == create) { document.theForm.action = /app/fdd/shopWorkOrder/fromCreateShopWorkOrder; } else { document.theForm.action = /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder; } return true; } /script jsp:useBean id=ShopWorkOrderBean scope=request class=com.cat.sdl.fdd.formBean.shopWorkOrder.ShopWorkOrderForm/ html:form name=theForm action=/app/fdd/shopWorkOrder/fromUpdateShopWorkOrder method=post onSubmit=return submitForm(document.theForm) -Original Message- From: Paul, R. Chip [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 5:23 PM To: 'Struts Users Mailing List' Subject: RE: Must have action=. in html:form tag? You can't. Correct me if I'm wrong, but the html:form action= property is what let's struts know which Form object to map your .jsp to. I'm don't think this will work for you unless all the possible urls you'd submit to share the same Form. What you may want to do instead then is look at something along the lines of DispatchAction, and pass a parameter that tells Struts which logical action it should forward to after hitting the for submit action (which would be a subclass of DispatchAction or something similar). Of course you could do as the previous poster said and change the action to submit to in your javascript onSubmit function: function onSubmit() { forms[0].action=/Some/New/Action.do; return true; } And then you'd put logic to decide where to actually submit to inside the onSubmit function. -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:13 PM To: 'Struts Users Mailing List' Subject: RE: Must have action=. in html:form tag? But I don't always want /app/fdd/shopWorkOrder/fromCreateShopWorkOrder to be my action all the time. I want the action for the form to be dynamic and depends on the form field whichAction. That's why I created the javascript function submitForm(frm) to pick the action dynamically. In other words, I have action mapping in my struts-config.xml file for both path /app/fdd/shopWorkOrder/fromCreateShopWorkOrder and /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder. But I want whichever one to be chosen to be dynamically. So how I do that all within the html:form tag? -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:58 PM To: Struts Users Mailing List Subject: RE: Must have action=. in html:form tag? I never said anything close to what you're asking me. All I said is choose one of your two possible outcomes (doesn't matter which one), take the path that you gave it in the struts-config.xml, then use that in your html:form. Let's say you have the ff entry in your struts-config: action path=/fromCreateShopWorkOrder ... name=theForm forward .../ /action then in your html:form, specify that action: html:form action=/fromCreateShopWorkOrder method=post onSubmit=return submitForm(document.theForm) ... /html:form You do have action's associated with fromCreateShopWorkOrder and fromUpdateShopWorkOrder, right? - Hubert --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: Hubert: Can you elaborate that In othe words, how do I do everything that the function submitForm() does to dynamically pick an action all within the html:form tag? -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:36 PM To: Struts Users Mailing List Subject: Re: Must have action=. in html:form tag? Specify the Action associated with fromCreateShopWorkOrder or fromUpdateShopWorkOrder in the html:form attribute. --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: Hi: My html:form tag doesn't allow me to skip an 'action' attribue. If you look at my code below, I move the assignment of the 'form action' to the javascript function so which action to take is dynamically depends on the form element 'whichAction'. But the compiler insist I have to have the 'action' property right inside the html:form tag. But that doesn't allow me to choose the action dynamically. Does anyone have any suggestion? script language = Javascript function submitForm(frm) { var whichAction=frm.elements(whichAction) if (whichAction == create) { document.theForm.action = /app/fdd/shopWorkOrder/fromCreateShopWorkOrder; } else { document.theForm.action = /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder
RE: Must have action=..... in html:form tag?
It may not, I was just filling in details from Hubert's post. I've always used one action that forwarded out to multiple ones based on some parameter, or had multiple execute method's in my Action and used DispatchActions or in 1.0 a bunch of control logic like: String action = mapping.getParameter(); if(action.equals(blah)) return myExecute(mapping, form, request, response); else if (action.equals(foo)) return otherExecute(mapping, form, request, response); In a create vs update switch this has always been enough for my uses, is there some reason why this has to be done via javascript? Chip -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:52 PM To: 'Struts Users Mailing List' Subject: RE: Must have action=. in html:form tag? Paul and Hubert: If I do the following, just choose one of the paths to be the html:form action=..., you mean the form action can still be dynamically overwritten by what is actually picked in the submitForm() action? I thought I tried that and didn't work. script language = Javascript function submitForm(frm) { var whichAction=frm.elements(whichAction) if (whichAction == create) { document.theForm.action = /app/fdd/shopWorkOrder/fromCreateShopWorkOrder; } else { document.theForm.action = /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder; } return true; } /script jsp:useBean id=ShopWorkOrderBean scope=request class=com.cat.sdl.fdd.formBean.shopWorkOrder.ShopWorkOrderForm/ html:form name=theForm action=/app/fdd/shopWorkOrder/fromUpdateShopWorkOrder method=post onSubmit=return submitForm(document.theForm) -Original Message- From: Paul, R. Chip [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 5:23 PM To: 'Struts Users Mailing List' Subject: RE: Must have action=. in html:form tag? You can't. Correct me if I'm wrong, but the html:form action= property is what let's struts know which Form object to map your .jsp to. I'm don't think this will work for you unless all the possible urls you'd submit to share the same Form. What you may want to do instead then is look at something along the lines of DispatchAction, and pass a parameter that tells Struts which logical action it should forward to after hitting the for submit action (which would be a subclass of DispatchAction or something similar). Of course you could do as the previous poster said and change the action to submit to in your javascript onSubmit function: function onSubmit() { forms[0].action=/Some/New/Action.do; return true; } And then you'd put logic to decide where to actually submit to inside the onSubmit function. -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:13 PM To: 'Struts Users Mailing List' Subject: RE: Must have action=. in html:form tag? But I don't always want /app/fdd/shopWorkOrder/fromCreateShopWorkOrder to be my action all the time. I want the action for the form to be dynamic and depends on the form field whichAction. That's why I created the javascript function submitForm(frm) to pick the action dynamically. In other words, I have action mapping in my struts-config.xml file for both path /app/fdd/shopWorkOrder/fromCreateShopWorkOrder and /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder. But I want whichever one to be chosen to be dynamically. So how I do that all within the html:form tag? -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:58 PM To: Struts Users Mailing List Subject: RE: Must have action=. in html:form tag? I never said anything close to what you're asking me. All I said is choose one of your two possible outcomes (doesn't matter which one), take the path that you gave it in the struts-config.xml, then use that in your html:form. Let's say you have the ff entry in your struts-config: action path=/fromCreateShopWorkOrder ... name=theForm forward .../ /action then in your html:form, specify that action: html:form action=/fromCreateShopWorkOrder method=post onSubmit=return submitForm(document.theForm) ... /html:form You do have action's associated with fromCreateShopWorkOrder and fromUpdateShopWorkOrder, right? - Hubert --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: Hubert: Can you elaborate that In othe words, how do I do everything that the function submitForm() does to dynamically pick an action all within the html:form tag? -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:36 PM To: Struts Users Mailing List Subject: Re: Must have action=. in html:form tag? Specify the Action associated with fromCreateShopWorkOrder or fromUpdateShopWorkOrder in the html:form attribute. --- Au-Yeung, Stella H [EMAIL
RE: Must have action=..... in html:form tag?
That's what I have on one of my forms right now. I have a form which points to one of my actions, and there are some links (column headings/filter options) that the user can select so the form will get submitted to another action. The requirement that Roy Paul said must be met: the two actions must be using the same form. And as Roy suggested, you might also want to take a look at DispatchAction. That might make it easier for you to make this work, and will also ensure that you're using the same form for both logic branches. If you wanna try to make the javascript approach work, make sure you get the URL correct, and that it points to the URL of the action as the browser would see it. This means including any extension or path that you use to map to the Struts ActionServlet. If you're using .do, you might try /app/fdd/shopWorkOrder/fromCreateShopWorkOrder.do hth, Hubert --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: Paul and Hubert: If I do the following, just choose one of the paths to be the html:form action=..., you mean the form action can still be dynamically overwritten by what is actually picked in the submitForm() action? I thought I tried that and didn't work. script language = Javascript function submitForm(frm) { var whichAction=frm.elements(whichAction) if (whichAction == create) { document.theForm.action = /app/fdd/shopWorkOrder/fromCreateShopWorkOrder; } else { document.theForm.action = /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder; } return true; } /script jsp:useBean id=ShopWorkOrderBean scope=request class=com.cat.sdl.fdd.formBean.shopWorkOrder.ShopWorkOrderForm/ html:form name=theForm action=/app/fdd/shopWorkOrder/fromUpdateShopWorkOrder method=post onSubmit=return submitForm(document.theForm) -Original Message- From: Paul, R. Chip [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 5:23 PM To: 'Struts Users Mailing List' Subject: RE: Must have action=. in html:form tag? You can't. Correct me if I'm wrong, but the html:form action= property is what let's struts know which Form object to map your .jsp to. I'm don't think this will work for you unless all the possible urls you'd submit to share the same Form. What you may want to do instead then is look at something along the lines of DispatchAction, and pass a parameter that tells Struts which logical action it should forward to after hitting the for submit action (which would be a subclass of DispatchAction or something similar). Of course you could do as the previous poster said and change the action to submit to in your javascript onSubmit function: function onSubmit() { forms[0].action=/Some/New/Action.do; return true; } And then you'd put logic to decide where to actually submit to inside the onSubmit function. -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:13 PM To: 'Struts Users Mailing List' Subject: RE: Must have action=. in html:form tag? But I don't always want /app/fdd/shopWorkOrder/fromCreateShopWorkOrder to be my action all the time. I want the action for the form to be dynamic and depends on the form field whichAction. That's why I created the javascript function submitForm(frm) to pick the action dynamically. In other words, I have action mapping in my struts-config.xml file for both path /app/fdd/shopWorkOrder/fromCreateShopWorkOrder and /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder. But I want whichever one to be chosen to be dynamically. So how I do that all within the html:form tag? -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:58 PM To: Struts Users Mailing List Subject: RE: Must have action=. in html:form tag? I never said anything close to what you're asking me. All I said is choose one of your two possible outcomes (doesn't matter which one), take the path that you gave it in the struts-config.xml, then use that in your html:form. Let's say you have the ff entry in your struts-config: action path=/fromCreateShopWorkOrder ... name=theForm forward .../ /action then in your html:form, specify that action: html:form action=/fromCreateShopWorkOrder method=post onSubmit=return submitForm(document.theForm) ... /html:form You do have action's associated with fromCreateShopWorkOrder and fromUpdateShopWorkOrder, right? - Hubert --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: Hubert: Can you elaborate that In othe words, how do I do everything that the function submitForm() does to dynamically pick an action all within the html:form tag? -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:36 PM
RE: Must have action=..... in html:form tag?
Shyam: I am not sure what you mean, can you elaborate that? The current form only has one 'submit' button. After the user fills in data on the current form, I want the data to be submitted to the DB and then automatically be taken back to the 'previous' screen. This previous screen can be a 'Create main screen' or an 'Update main screen'. I use a hidden field 'whichAction' to remember which is the 'previous' screen. So when the user submits the input data on the cuurrent form, that's when the javascript submitForm() function decides which screen (/app/fdd/shopWorkOrder/fromCreateShopWorkOrder or /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder) to return to. Example: Create Main screen use 'theForm' to input data return back to Create main Update Main screen - use 'theForm' to input data return back to Update main (this screen 'theForm' is where I decide which precious screen to return to based on the hidden field whichAction. That's why form action has to be dynamic My user only wants ONE submit button on theForm and the application should be smart enough to return to the correct 'previous' page. -Original Message- From: Shyam A [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 5:31 PM To: Struts Users Mailing List Subject: RE: Must have action=. in html:form tag? Just a suggestion. Not sure if I'm right... Instead of using onSubmit() event of your html:form, why don't you call the Javascript when the user clicks/submits the associcated HTML component - Create/Update button, and set the action accordingly. HTH, Shyam --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: But I don't always want /app/fdd/shopWorkOrder/fromCreateShopWorkOrder to be my action all the time. I want the action for the form to be dynamic and depends on the form field whichAction. That's why I created the javascript function submitForm(frm) to pick the action dynamically. In other words, I have action mapping in my struts-config.xml file for both path /app/fdd/shopWorkOrder/fromCreateShopWorkOrder and /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder. But I want whichever one to be chosen to be dynamically. So how I do that all within the html:form tag? -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:58 PM To: Struts Users Mailing List Subject: RE: Must have action=. in html:form tag? I never said anything close to what you're asking me. All I said is choose one of your two possible outcomes (doesn't matter which one), take the path that you gave it in the struts-config.xml, then use that in your html:form. Let's say you have the ff entry in your struts-config: action path=/fromCreateShopWorkOrder ... name=theForm forward .../ /action then in your html:form, specify that action: html:form action=/fromCreateShopWorkOrder method=post onSubmit=return submitForm(document.theForm) ... /html:form You do have action's associated with fromCreateShopWorkOrder and fromUpdateShopWorkOrder, right? - Hubert --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: Hubert: Can you elaborate that In othe words, how do I do everything that the function submitForm() does to dynamically pick an action all within the html:form tag? -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:36 PM To: Struts Users Mailing List Subject: Re: Must have action=. in html:form tag? Specify the Action associated with fromCreateShopWorkOrder or fromUpdateShopWorkOrder in the html:form attribute. --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: Hi: My html:form tag doesn't allow me to skip an 'action' attribue. If you look at my code below, I move the assignment of the 'form action' to the javascript function so which action to take is dynamically depends on the form element 'whichAction'. But the compiler insist I have to have the 'action' property right inside the html:form tag. But that doesn't allow me to choose the action dynamically. Does anyone have any suggestion? script language = Javascript function submitForm(frm) { var whichAction=frm.elements(whichAction) if (whichAction == create) { document.theForm.action = /app/fdd/shopWorkOrder/fromCreateShopWorkOrder; } else { document.theForm.action = /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder; } return true; } /script jsp:useBean id=ShopWorkOrderBean scope=request class=com.cat.sdl.fdd.formBean.shopWorkOrder.ShopWorkOrderForm/ html:form name=theForm method=post onSubmit=return
Re: Must have action=..... in html:form tag?
Stella: Any time you incorporate Javascript into your app, you have to wonder if things will work now/ever/always in this/that/other browser. So avoiding everything except the most basic javascript may be a good idea. What you want to do can be done more cleanly (just in my opinion though) in the following way: Write an interface say MyRequestHandler with just one method: public String handleRequest(MyForm); write classes like UpdateShopWorkOrderRequestHandler and CreateShopWorkOrderRequestHandler which implement MyRequestHandler: all the work gets done here: You have access to the form bean (via the argument) and in the end you will return a string (which will be used to create your ActionForward). Write a suingleton class MyRequestHandlerFactory: all it does is have a hashmap mapping actionCommand strings to appropraite instances of the RequestHandler: For example: you may have an entry in the hashmap as: myHandlerMap.put(updateShopWorkOrder, new UpdateShopWorkOrderRequestHandler()); myHandlerMap.put(createShopWorkOrder, new CreateShopWorkOrderRequestHandler()); Write a constructor which will construct your hashmap, and write a getInstance method in the usual way: public static MyrequestHandlerFactory getInstance() as well as a public MyRequestHandler getRequestHandler (String actionCommand) which just consults the hashamp and returns the appropriate handler. Finally, write a superAction so: public class MySuperAction extends Action { public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { String actionCommand = request.getParameter(actionCommand); MyRequestHandler requestHandler = MyRequestHandlerFactory.getInstance().getRequestHandler(actionCommand); String forwardString = requestHandler.handleRequest((MyForm) form); if (mapping.findForward(forwardString) == null) log.debug(path is null!); //this si probably an error condition! else log.debug(Path is : + mapping.findForward(forwardString).getPath()); //bingo! return mapping.findForward(forwardString); } I think this method works quite well and has the advantage of simplicity too.. Hope this helps.. Good luck and let me know if you'd like any more elaboration..:) Geeta Au-Yeung, Stella H wrote: Paul and Hubert: If I do the following, just choose one of the paths to be the html:form action=..., you mean the form action can still be dynamically overwritten by what is actually picked in the submitForm() action? I thought I tried that and didn't work. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Must have action=..... in html:form tag?
Well, as the others said DispatchAction is the way to go. Since, you already have two separate Actions defined, I thought it may be worthwhile to give my idea a try. What I meant was, instead of a submit button html:submit, use a normal button input type=button. You can display a create or update button based on the previous screen, i.e. logic:equal name=formName property=whichAction value =create input type=button name=Create onClick=submitForm /logic:equal logic:equal name=formName property=whichAction value =update input type=button name=Update onClick=submitForm /logic:equal Then, in your submitForm() Javascript, check for which button is clicked, or check for whichAction as you're doin now, and set the action accordingly. (Sorry, I'm not an expert in Javascript!) HTH, Shyam --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: Shyam: I am not sure what you mean, can you elaborate that? The current form only has one 'submit' button. After the user fills in data on the current form, I want the data to be submitted to the DB and then automatically be taken back to the 'previous' screen. This previous screen can be a 'Create main screen' or an 'Update main screen'. I use a hidden field 'whichAction' to remember which is the 'previous' screen. So when the user submits the input data on the cuurrent form, that's when the javascript submitForm() function decides which screen (/app/fdd/shopWorkOrder/fromCreateShopWorkOrder or /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder) to return to. Example: Create Main screen use 'theForm' to input data return back to Create main Update Main screen - use 'theForm' to input data return back to Update main (this screen 'theForm' is where I decide which precious screen to return to based on the hidden field whichAction. That's why form action has to be dynamic My user only wants ONE submit button on theForm and the application should be smart enough to return to the correct 'previous' page. -Original Message- From: Shyam A [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 5:31 PM To: Struts Users Mailing List Subject: RE: Must have action=. in html:form tag? Just a suggestion. Not sure if I'm right... Instead of using onSubmit() event of your html:form, why don't you call the Javascript when the user clicks/submits the associcated HTML component - Create/Update button, and set the action accordingly. HTH, Shyam __ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Must have action=..... in html:form tag?
I'm not sure this but you can try... Create Main screen (define a attribute in your form which holds the value of which screen and set update/create before dispatch) use 'theForm' to input data (here check that attribute value whether it is create/update and assign the same to the action path either your JavaScript sumbit or whatever ) return back to Create main -R -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 6:08 PM To: 'Struts Users Mailing List' Subject: RE: Must have action=. in html:form tag? Shyam: I am not sure what you mean, can you elaborate that? The current form only has one 'submit' button. After the user fills in data on the current form, I want the data to be submitted to the DB and then automatically be taken back to the 'previous' screen. This previous screen can be a 'Create main screen' or an 'Update main screen'. I use a hidden field 'whichAction' to remember which is the 'previous' screen. So when the user submits the input data on the cuurrent form, that's when the javascript submitForm() function decides which screen (/app/fdd/shopWorkOrder/fromCreateShopWorkOrder or /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder) to return to. Example: Create Main screen use 'theForm' to input data return back to Create main Update Main screen - use 'theForm' to input data return back to Update main (this screen 'theForm' is where I decide which precious screen to return to based on the hidden field whichAction. That's why form action has to be dynamic My user only wants ONE submit button on theForm and the application should be smart enough to return to the correct 'previous' page. -Original Message- From: Shyam A [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 5:31 PM To: Struts Users Mailing List Subject: RE: Must have action=. in html:form tag? Just a suggestion. Not sure if I'm right... Instead of using onSubmit() event of your html:form, why don't you call the Javascript when the user clicks/submits the associcated HTML component - Create/Update button, and set the action accordingly. HTH, Shyam --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: But I don't always want /app/fdd/shopWorkOrder/fromCreateShopWorkOrder to be my action all the time. I want the action for the form to be dynamic and depends on the form field whichAction. That's why I created the javascript function submitForm(frm) to pick the action dynamically. In other words, I have action mapping in my struts-config.xml file for both path /app/fdd/shopWorkOrder/fromCreateShopWorkOrder and /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder. But I want whichever one to be chosen to be dynamically. So how I do that all within the html:form tag? -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:58 PM To: Struts Users Mailing List Subject: RE: Must have action=. in html:form tag? I never said anything close to what you're asking me. All I said is choose one of your two possible outcomes (doesn't matter which one), take the path that you gave it in the struts-config.xml, then use that in your html:form. Let's say you have the ff entry in your struts-config: action path=/fromCreateShopWorkOrder ... name=theForm forward .../ /action then in your html:form, specify that action: html:form action=/fromCreateShopWorkOrder method=post onSubmit=return submitForm(document.theForm) ... /html:form You do have action's associated with fromCreateShopWorkOrder and fromUpdateShopWorkOrder, right? - Hubert --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: Hubert: Can you elaborate that In othe words, how do I do everything that the function submitForm() does to dynamically pick an action all within the html:form tag? -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:36 PM To: Struts Users Mailing List Subject: Re: Must have action=. in html:form tag? Specify the Action associated with fromCreateShopWorkOrder or fromUpdateShopWorkOrder in the html:form attribute. --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: Hi: My html:form tag doesn't allow me to skip an 'action' attribue. If you look at my code below, I move the assignment of the 'form action' to the javascript function so which action to take is dynamically depends on the form element 'whichAction'. But the compiler insist I have to have the 'action' property right inside the html:form tag. But that doesn't allow me to choose the action dynamically. Does anyone have any
RE: Must have action=..... in html:form tag?
Ramadoss: That's what I did already in one of my original version. My reason of posting to this group is because html:form doesn't allow me to use a dynamically assigned action (such as one I set in my Javascript function to replace the one I have within the html:form tag. -Original Message- From: Ramadoss Chinnakuzhandai [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 7:10 PM To: Struts Users Mailing List Subject: RE: Must have action=. in html:form tag? I'm not sure this but you can try... Create Main screen (define a attribute in your form which holds the value of which screen and set update/create before dispatch) use 'theForm' to input data (here check that attribute value whether it is create/update and assign the same to the action path either your JavaScript sumbit or whatever ) return back to Create main -R -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 6:08 PM To: 'Struts Users Mailing List' Subject: RE: Must have action=. in html:form tag? Shyam: I am not sure what you mean, can you elaborate that? The current form only has one 'submit' button. After the user fills in data on the current form, I want the data to be submitted to the DB and then automatically be taken back to the 'previous' screen. This previous screen can be a 'Create main screen' or an 'Update main screen'. I use a hidden field 'whichAction' to remember which is the 'previous' screen. So when the user submits the input data on the cuurrent form, that's when the javascript submitForm() function decides which screen (/app/fdd/shopWorkOrder/fromCreateShopWorkOrder or /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder) to return to. Example: Create Main screen use 'theForm' to input data return back to Create main Update Main screen - use 'theForm' to input data return back to Update main (this screen 'theForm' is where I decide which precious screen to return to based on the hidden field whichAction. That's why form action has to be dynamic My user only wants ONE submit button on theForm and the application should be smart enough to return to the correct 'previous' page. -Original Message- From: Shyam A [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 5:31 PM To: Struts Users Mailing List Subject: RE: Must have action=. in html:form tag? Just a suggestion. Not sure if I'm right... Instead of using onSubmit() event of your html:form, why don't you call the Javascript when the user clicks/submits the associcated HTML component - Create/Update button, and set the action accordingly. HTH, Shyam --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: But I don't always want /app/fdd/shopWorkOrder/fromCreateShopWorkOrder to be my action all the time. I want the action for the form to be dynamic and depends on the form field whichAction. That's why I created the javascript function submitForm(frm) to pick the action dynamically. In other words, I have action mapping in my struts-config.xml file for both path /app/fdd/shopWorkOrder/fromCreateShopWorkOrder and /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder. But I want whichever one to be chosen to be dynamically. So how I do that all within the html:form tag? -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:58 PM To: Struts Users Mailing List Subject: RE: Must have action=. in html:form tag? I never said anything close to what you're asking me. All I said is choose one of your two possible outcomes (doesn't matter which one), take the path that you gave it in the struts-config.xml, then use that in your html:form. Let's say you have the ff entry in your struts-config: action path=/fromCreateShopWorkOrder ... name=theForm forward .../ /action then in your html:form, specify that action: html:form action=/fromCreateShopWorkOrder method=post onSubmit=return submitForm(document.theForm) ... /html:form You do have action's associated with fromCreateShopWorkOrder and fromUpdateShopWorkOrder, right? - Hubert --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: Hubert: Can you elaborate that In othe words, how do I do everything that the function submitForm() does to dynamically pick an action all within the html:form tag? -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:36 PM To: Struts Users Mailing List Subject: Re: Must have action=. in html:form tag? Specify the Action associated with fromCreateShopWorkOrder or fromUpdateShopWorkOrder in the html:form attribute. --- Au-Yeung, Stella H
RE: Must have action=..... in html:form tag?
Why can't you just use DispatchAction ?? Then, you can have methods like: Create() Update() Delete() And set the correct token during the submit ?? Khalid -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 7:07 PM To: 'Struts Users Mailing List' Subject: RE: Must have action=. in html:form tag? Ramadoss: That's what I did already in one of my original version. My reason of posting to this group is because html:form doesn't allow me to use a dynamically assigned action (such as one I set in my Javascript function to replace the one I have within the html:form tag. -Original Message- From: Ramadoss Chinnakuzhandai [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 7:10 PM To: Struts Users Mailing List Subject: RE: Must have action=. in html:form tag? I'm not sure this but you can try... Create Main screen (define a attribute in your form which holds the value of which screen and set update/create before dispatch) use 'theForm' to input data (here check that attribute value whether it is create/update and assign the same to the action path either your JavaScript sumbit or whatever ) return back to Create main -R -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 6:08 PM To: 'Struts Users Mailing List' Subject: RE: Must have action=. in html:form tag? Shyam: I am not sure what you mean, can you elaborate that? The current form only has one 'submit' button. After the user fills in data on the current form, I want the data to be submitted to the DB and then automatically be taken back to the 'previous' screen. This previous screen can be a 'Create main screen' or an 'Update main screen'. I use a hidden field 'whichAction' to remember which is the 'previous' screen. So when the user submits the input data on the cuurrent form, that's when the javascript submitForm() function decides which screen (/app/fdd/shopWorkOrder/fromCreateShopWorkOrder or /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder) to return to. Example: Create Main screen use 'theForm' to input data return back to Create main Update Main screen - use 'theForm' to input data return back to Update main (this screen 'theForm' is where I decide which precious screen to return to based on the hidden field whichAction. That's why form action has to be dynamic My user only wants ONE submit button on theForm and the application should be smart enough to return to the correct 'previous' page. -Original Message- From: Shyam A [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 5:31 PM To: Struts Users Mailing List Subject: RE: Must have action=. in html:form tag? Just a suggestion. Not sure if I'm right... Instead of using onSubmit() event of your html:form, why don't you call the Javascript when the user clicks/submits the associcated HTML component - Create/Update button, and set the action accordingly. HTH, Shyam --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: But I don't always want /app/fdd/shopWorkOrder/fromCreateShopWorkOrder to be my action all the time. I want the action for the form to be dynamic and depends on the form field whichAction. That's why I created the javascript function submitForm(frm) to pick the action dynamically. In other words, I have action mapping in my struts-config.xml file for both path /app/fdd/shopWorkOrder/fromCreateShopWorkOrder and /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder. But I want whichever one to be chosen to be dynamically. So how I do that all within the html:form tag? -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:58 PM To: Struts Users Mailing List Subject: RE: Must have action=. in html:form tag? I never said anything close to what you're asking me. All I said is choose one of your two possible outcomes (doesn't matter which one), take the path that you gave it in the struts-config.xml, then use that in your html:form. Let's say you have the ff entry in your struts-config: action path=/fromCreateShopWorkOrder ... name=theForm forward .../ /action then in your html:form, specify that action: html:form action=/fromCreateShopWorkOrder method=post onSubmit=return submitForm(document.theForm) ... /html:form You do have action's associated with fromCreateShopWorkOrder and fromUpdateShopWorkOrder, right? - Hubert --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: Hubert: Can you elaborate that In othe words, how do I do everything that the function submitForm() does to dynamically pick an action all within the html:form tag
RE: Must have action=..... in html:form tag?
I understand DispatchAction fairly well. But because there are certain extra things I need to do that DispatchAction won't help. Anyway, Shyam's suggestion of using logic:equal to display the appropriate button with associate action should take care of my problem and I think it will be pretty simple. Thanks Shyam. I would also like to thank everyone who has responded to my plead for help (Geeta, Paul, Hubert,Ramadoss and Khalid etc.) Thanks you all. -Original Message- From: Shyam A [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 6:34 PM To: Struts Users Mailing List Subject: RE: Must have action=. in html:form tag? Well, as the others said DispatchAction is the way to go. Since, you already have two separate Actions defined, I thought it may be worthwhile to give my idea a try. What I meant was, instead of a submit button html:submit, use a normal button input type=button. You can display a create or update button based on the previous screen, i.e. logic:equal name=formName property=whichAction value =create input type=button name=Create onClick=submitForm /logic:equal logic:equal name=formName property=whichAction value =update input type=button name=Update onClick=submitForm /logic:equal Then, in your submitForm() Javascript, check for which button is clicked, or check for whichAction as you're doin now, and set the action accordingly. (Sorry, I'm not an expert in Javascript!) HTH, Shyam --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: Shyam: I am not sure what you mean, can you elaborate that? The current form only has one 'submit' button. After the user fills in data on the current form, I want the data to be submitted to the DB and then automatically be taken back to the 'previous' screen. This previous screen can be a 'Create main screen' or an 'Update main screen'. I use a hidden field 'whichAction' to remember which is the 'previous' screen. So when the user submits the input data on the cuurrent form, that's when the javascript submitForm() function decides which screen (/app/fdd/shopWorkOrder/fromCreateShopWorkOrder or /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder) to return to. Example: Create Main screen use 'theForm' to input data return back to Create main Update Main screen - use 'theForm' to input data return back to Update main (this screen 'theForm' is where I decide which precious screen to return to based on the hidden field whichAction. That's why form action has to be dynamic My user only wants ONE submit button on theForm and the application should be smart enough to return to the correct 'previous' page. -Original Message- From: Shyam A [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 5:31 PM To: Struts Users Mailing List Subject: RE: Must have action=. in html:form tag? Just a suggestion. Not sure if I'm right... Instead of using onSubmit() event of your html:form, why don't you call the Javascript when the user clicks/submits the associcated HTML component - Create/Update button, and set the action accordingly. HTH, Shyam __ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html link tag
I just did an example strust project in JBuilder, and it works. I have a jsp with a form that issues an action that forwards to itself and it works. Now I wanted to just do a html link to call the action from a new generic jsp page and it doesn't work. html:link page=/do/myactionAdd An Employee/html:link but it says error resource not available. From what I read a form or link can call an action, and this action, called myaction, being a servlet should just be able to be called. So what do I have wrong with my syntax? Below is the struts config and the form that does work. action-mappings action name=empForm path=/myaction scope=session type=strutstest1.Myaction forward name=forward path=/myjsp.jsp redirect=true / /action /action-mappings Below is the form code that does work: html:form action=/myaction.do method=POST html:text property=name/ html:submit property=submit value=Submit/br /html:form - Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want.
Conditional tag for method results
Hello All, I'm fairly new to the world of struts so pardon me if this has already been asked. Could someone tell me if I can replace the following with a much better looking tag library usage: % if( foo.method( xyz ) ) { % html:submit value=Submit Submit /html:submit % } % You can assume that foo exists in the scope of the page. Thanks and Regards Avinash - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Conditional tag for method results
Yo can either use the Struts logic tags, or the standard tag library (JSTL) JSTL: http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html Struts Logic Tags: http://jakarta.apache.org/struts/userGuide/struts-logic.html Niall - Original Message - From: Avinash Gangadharan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 18, 2004 8:43 PM Subject: Conditional tag for method results Hello All, I'm fairly new to the world of struts so pardon me if this has already been asked. Could someone tell me if I can replace the following with a much better looking tag library usage: % if( foo.method( xyz ) ) { % html:submit value=Submit Submit /html:submit % } % You can assume that foo exists in the scope of the page. Thanks and Regards Avinash - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Conditional tag for method results
I did look at those earlier, unfortunately I could not figure out how can I pass in a method call with a paramater passed to it, as the expression for comparison. The tags allow bean properties, cookie , request parameter etc... Could you tell me how can I use a method call with a parameter that I pass from within the JSP for evaluating the result. Thx A -Original Message- From: Niall Pemberton To: Struts Users Mailing List Sent: 2/18/2004 1:07 PM Subject: Re: Conditional tag for method results Yo can either use the Struts logic tags, or the standard tag library (JSTL) JSTL: http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html Struts Logic Tags: http://jakarta.apache.org/struts/userGuide/struts-logic.html Niall - Original Message - From: Avinash Gangadharan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 18, 2004 8:43 PM Subject: Conditional tag for method results Hello All, I'm fairly new to the world of struts so pardon me if this has already been asked. Could someone tell me if I can replace the following with a much better looking tag library usage: % if( foo.method( xyz ) ) { % html:submit value=Submit Submit /html:submit % } % You can assume that foo exists in the scope of the page. Thanks and Regards Avinash - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Conditional tag for method results
You will need to create a simple custom tag for this. Its pretty simple, plenty of samples are available. -jayash -Original Message- From: Avinash Gangadharan [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 18, 2004 1:20 PM To: '[EMAIL PROTECTED]' Subject: RE: Conditional tag for method results I did look at those earlier, unfortunately I could not figure out how can I pass in a method call with a paramater passed to it, as the expression for comparison. The tags allow bean properties, cookie , request parameter etc... Could you tell me how can I use a method call with a parameter that I pass from within the JSP for evaluating the result. Thx A -Original Message- From: Niall Pemberton To: Struts Users Mailing List Sent: 2/18/2004 1:07 PM Subject: Re: Conditional tag for method results Yo can either use the Struts logic tags, or the standard tag library (JSTL) JSTL: http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html Struts Logic Tags: http://jakarta.apache.org/struts/userGuide/struts-logic.html Niall - Original Message - From: Avinash Gangadharan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 18, 2004 8:43 PM Subject: Conditional tag for method results Hello All, I'm fairly new to the world of struts so pardon me if this has already been asked. Could someone tell me if I can replace the following with a much better looking tag library usage: % if( foo.method( xyz ) ) { % html:submit value=Submit Submit /html:submit % } % You can assume that foo exists in the scope of the page. Thanks and Regards Avinash - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Conditional tag for method results
Exactly I thought so and that is why in my question I asked if I can replace the following with a much better looking tag library usage I wanted to make sure there is'nt something already out there which I can simply use. Moreover I do think that the struts logic tag should have a generic attribute which takes any runtime exression and evaluated it's result for comparison. -Original Message- From: Gopalakrishnan, Jayesh To: Struts Users Mailing List Sent: 2/18/2004 1:33 PM Subject: RE: Conditional tag for method results You will need to create a simple custom tag for this. Its pretty simple, plenty of samples are available. -jayash -Original Message- From: Avinash Gangadharan [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 18, 2004 1:20 PM To: '[EMAIL PROTECTED]' Subject: RE: Conditional tag for method results I did look at those earlier, unfortunately I could not figure out how can I pass in a method call with a paramater passed to it, as the expression for comparison. The tags allow bean properties, cookie , request parameter etc... Could you tell me how can I use a method call with a parameter that I pass from within the JSP for evaluating the result. Thx A -Original Message- From: Niall Pemberton To: Struts Users Mailing List Sent: 2/18/2004 1:07 PM Subject: Re: Conditional tag for method results Yo can either use the Struts logic tags, or the standard tag library (JSTL) JSTL: http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html Struts Logic Tags: http://jakarta.apache.org/struts/userGuide/struts-logic.html Niall - Original Message - From: Avinash Gangadharan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 18, 2004 8:43 PM Subject: Conditional tag for method results Hello All, I'm fairly new to the world of struts so pardon me if this has already been asked. Could someone tell me if I can replace the following with a much better looking tag library usage: % if( foo.method( xyz ) ) { % html:submit value=Submit Submit /html:submit % } % You can assume that foo exists in the scope of the page. Thanks and Regards Avinash - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Conditional tag for method results
Either provide a getter in your foo object [i.e. getMethod()] and then you can do logic:equals name=foo property=method value=xyz or if you can't change foo, do the method in your action and store the results somewhere (form, request, session) and then test that Niall - Original Message - From: Gopalakrishnan, Jayesh [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, February 18, 2004 9:33 PM Subject: RE: Conditional tag for method results You will need to create a simple custom tag for this. Its pretty simple, plenty of samples are available. -jayash -Original Message- From: Avinash Gangadharan [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 18, 2004 1:20 PM To: '[EMAIL PROTECTED]' Subject: RE: Conditional tag for method results I did look at those earlier, unfortunately I could not figure out how can I pass in a method call with a paramater passed to it, as the expression for comparison. The tags allow bean properties, cookie , request parameter etc... Could you tell me how can I use a method call with a parameter that I pass from within the JSP for evaluating the result. Thx A -Original Message- From: Niall Pemberton To: Struts Users Mailing List Sent: 2/18/2004 1:07 PM Subject: Re: Conditional tag for method results Yo can either use the Struts logic tags, or the standard tag library (JSTL) JSTL: http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html Struts Logic Tags: http://jakarta.apache.org/struts/userGuide/struts-logic.html Niall - Original Message - From: Avinash Gangadharan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 18, 2004 8:43 PM Subject: Conditional tag for method results Hello All, I'm fairly new to the world of struts so pardon me if this has already been asked. Could someone tell me if I can replace the following with a much better looking tag library usage: % if( foo.method( xyz ) ) { % html:submit value=Submit Submit /html:submit % } % You can assume that foo exists in the scope of the page. Thanks and Regards Avinash - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html link tag
Hi! Replace html:link page=/do/myactionAdd An Employee/html:link by html:link page=/myaction.doAdd An Employee/html:link and it should work.. Regards, Geeta struts fox wrote: I just did an example strust project in JBuilder, and it works. I have a jsp with a form that issues an action that forwards to itself and it works. Now I wanted to just do a html link to call the action from a new generic jsp page and it doesn't work. html:link page=/do/myactionAdd An Employee/html:link but it says error resource not available. From what I read a form or link can call an action, and this action, called myaction, being a servlet should just be able to be called. So what do I have wrong with my syntax? Below is the struts config and the form that does work. action-mappings action name=empForm path=/myaction scope=session type=strutstest1.Myaction forward name=forward path=/myjsp.jsp redirect=true / /action /action-mappings Below is the form code that does work: html:form action=/myaction.do method=POST html:text property=name/ html:submit property=submit value=Submit/br /html:form - Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want.
Struts tag external resource?
I need to configure my IDE with an external link, as well as local, to the tld tag files, so I was just wondering which URI I can use for the external resource files? Regards, BTJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Error Start Tag Exception
html:errors changed from processing ActionErrors/ActionError to ActionMessages/ActionMessage from struts 1.1 to struts 1.2 - the most obvious cause of this is your app generating ActionMessages/ActionMessage messages but the tag is struts 1.1 version. Are you sure you are deploying the nightly build jars to your servlet container rather than the struts 1.1 jars? Niall - Original Message - From: Betty Koon [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, February 16, 2004 6:20 AM Subject: Error Start Tag Exception Any one has any idea why this exception happens? I am using 1.2 nightly build currently. My jsp is simply using the following: logic:messagesPresent html:errors / /logic:messagesPresent java.lang.ClassCastException at org.apache.struts.taglib.html.ErrorsTag.doStartTag(ErrorsTag.java:215) at org.apache.jsp.action_feedback_jsp._jspx_meth_html_errors_0(action_feedback_ jsp.java:694) at org.apache.jsp.action_feedback_jsp._jspx_meth_logic_messagesPresent_1(action _feedback_jsp.java:672) at org.apache.jsp.action_feedback_jsp._jspService(action_feedback_jsp.java:469) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 10) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher. java:684) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch er.java:432) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher .java:356) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10 69) at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcesso r.java:274) at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProces sor.java:455) at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequ estProcessor.java:320) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at com.adobe.edc.server.presentation.auth.AuthenticationFilter.doFilter(Authent icationFilter.java:143) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2 46) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641
Re: Error Start Tag Exception
Hi Betty, I think you need to set the 'message' attribute to false here, as the tag is looking for an ActionMessage instance, not an ActionError one (which is what you get in the loop created by the html:errors / tag). Here's a snippet of an implementation I've used: logic:messagesPresent message=false td class=small3 colspan=2 html:messages id=error message=false c:out value=${error} escapeXml=false /br / /html:messages /td /logic:messagesPresent HTH, Curtis -- c dot tee at verizon dot net Betty Koon wrote: Any one has any idea why this exception happens? I am using 1.2 nightly build currently. My jsp is simply using the following: logic:messagesPresent html:errors / /logic:messagesPresent java.lang.ClassCastException - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: nested tag problem - image not shown
prolem found: need to use relative path : nested:image src=images/tree/km_plus.gif property=toggle/ ~~~ --- hi, i am trying the nexted MOnkey example, everything works fine except that the image is not shown. In my TreeNode.jsp: nested:image src=/images/tree/km_plus.gif property=toggle/ The only difference is that TreeNode is a Tile now. I am using IE 6.0, Win XP, Struts 1.1 thanks in advance, li xin __ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Error Start Tag Exception
Thanks for the reply. I figurd out what happened. I upgraded my code to use struts 1.2 but some how the jar file got reverted back to 1.1. -Betty -Original Message- From: Curtis Taylor [mailto:[EMAIL PROTECTED] Sent: Monday, February 16, 2004 8:32 AM To: Struts Users Mailing List Subject: Re: Error Start Tag Exception Hi Betty, I think you need to set the 'message' attribute to false here, as the tag is looking for an ActionMessage instance, not an ActionError one (which is what you get in the loop created by the html:errors / tag). Here's a snippet of an implementation I've used: logic:messagesPresent message=false td class=small3 colspan=2 html:messages id=error message=false c:out value=${error} escapeXml=false /br / /html:messages /td /logic:messagesPresent HTH, Curtis -- c dot tee at verizon dot net Betty Koon wrote: Any one has any idea why this exception happens? I am using 1.2 nightly build currently. My jsp is simply using the following: logic:messagesPresent html:errors / /logic:messagesPresent java.lang.ClassCastException - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]