JSP with textarea/Form getter and german special character problem
Hello, I have got a JSP with an textarea. Whene i read out the value over the getter from the related formBean, i get wrong characters for german spezial characters: äöüÄÖÜß ( right encoding is auml; ouml; uuml; Auml; szlig; becomes to äöüÃ?Ã?Ã?Ã? Can anybody tell me, what to do to get the characters in the rigth encoding? I am relatively new to web programming. Hence I am not that fitt in encodings and things like this. Thanks in advance, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [SHALE] prerender() never called..?
Craig McClanahan wrote: On 8/28/05, Bjørn T Johansen [EMAIL PROTECTED] wrote: Ok, that I did not know... Tonight's nightly build will include Javadocs for ViewController that make this requirement much more explicit -- you're not the first person to run into it. I am trying to access the download area, http://cvs.apache.org/builds/struts/nightly/struts-shale/core-library/ but all I get is this..: Not Found The requested URL /builds/struts/nightly/struts-shale/core-library/ was not found on this server. Apache/2.1.7-dev (Unix) SVN/1.2.2-dev mod_ssl/2.1.7-dev OpenSSL/0.9.7e DAV/2 Server at cvs.apache.org Port 80 But now I have changed the name of my managed bean to correspond to this naming scheme, but still no methods is called...? Am I missing more...? Without more details about what you're doing, it's impossible to tell what is going wrong -- but one thing you should *not* be worrying about is explicitly declaring the Shale ViewController. That happens automatically when shale-core.jar is included in your webapp. What I have, is a view called /protected/cyradm/admin.jsp and a managed bean called protected$cyradm$admin that implements ViewController.. In the prerender() method (and the other methods), I just have a line that log some text, to test if the method is called.. in the faces-config.xml I have the following..: application . view-handlerorg.apache.shale.faces.ShaleViewHandler/view-handler . /application I also have tried to include lifecycle phase-listenerorg.apache.shale.faces.ShalePhaseListener/phase-listener /lifecycle But still no methods in the ViewController is called... And in my view, I just use my managed bean as a managed bean, do I need to do/call something from my view? Does the use cases example app work for you? Well, I have just tried it once and it appeared to work but I haven't done any research to check if the ViewController works as expected... BTJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [SHALE] prerender() never called..?
From: Bjørn T Johansen [EMAIL PROTECTED] I am trying to access the download area, http://cvs.apache.org/builds/struts/nightly/struts-shale/core-library/ but all I get is this..: Not Found Back up one directory, Craig recently changed the way the nightly builds are packaged: http://cvs.apache.org/builds/struts/nightly/struts-shale/ -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [SHALE] prerender() never called..?
On 8/28/05, Wendy Smoak [EMAIL PROTECTED] wrote: From: Bjørn T Johansen [EMAIL PROTECTED] I am trying to access the download area, http://cvs.apache.org/builds/struts/nightly/struts-shale/core-library/ but all I get is this..: Not Found Back up one directory, Craig recently changed the way the nightly builds are packaged: http://cvs.apache.org/builds/struts/nightly/struts-shale/ Sorry ... I only announced this to the Struts dev list. The nightly builds for Shale now include all the source and binary content, for all of the four subpackages that used to be uploaded separately. See the link Wendy posted above. This is the format I intend to use for the 1.0.0 Shale milestone release as well, so please provide any feedback on whether that meets your needs or not. Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [SHALE] prerender() never called..?
That did the trick... But maybe this should be updated as well...: http://struts.apache.org/shale/index.html#download BTJ Craig McClanahan wrote: On 8/28/05, Wendy Smoak [EMAIL PROTECTED] wrote: From: Bjørn T Johansen [EMAIL PROTECTED] I am trying to access the download area, http://cvs.apache.org/builds/struts/nightly/struts-shale/core-library/ but all I get is this..: Not Found Back up one directory, Craig recently changed the way the nightly builds are packaged: http://cvs.apache.org/builds/struts/nightly/struts-shale/ Sorry ... I only announced this to the Struts dev list. The nightly builds for Shale now include all the source and binary content, for all of the four subpackages that used to be uploaded separately. See the link Wendy posted above. This is the format I intend to use for the 1.0.0 Shale milestone release as well, so please provide any feedback on whether that meets your needs or not. Craig - 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: [SHALE] prerender() never called..?
But now I have changed the name of my managed bean to correspond to this naming scheme, but still no methods is called...? Am I missing more...? Without more details about what you're doing, it's impossible to tell what is going wrong -- but one thing you should *not* be worrying about is explicitly declaring the Shale ViewController. That happens automatically when shale-core.jar is included in your webapp. I have now downloaded the latest release and read some more documentation, and I found out I was missing some declarations in my web.xml file... I needed to include these..: filter filter-nameshale/filter-name filter-classorg.apache.shale.faces.ShaleApplicationFilter/filter-class /filter filter-mapping filter-nameshale/filter-name url-pattern/*/url-pattern /filter-mapping and listener listener-classorg.apache.commons.chain.web.ChainListener/listener-class /listener and now it's working... :) BTJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP with textarea/Form getter and german special character problem
Sorry, but what do you mean with read out. You have Ä in the jsp but ä in the console? If its a Win/DOS console, it doesn't matter, because windows uses it's own encoding. (cp1250) If its a unix/linux console, try to set the encoding of the console to iso-8859-1. You also have to save the encoding of the database (if any) to iso. If you have wrong values in the jsp, then: what's your jsp page encoding? try set the page directive to: %@ page contentType=text/html;charset=iso-8859-1 session=true % or use iso-8859-15 is you want the €-sign regards Leon On Mon, 2005-08-29 at 08:37 +0200, Andreas Scheucher wrote: Hello, I have got a JSP with an textarea. Whene i read out the value over the getter from the related formBean, i get wrong characters for german spezial characters: äöüÄÖÜß ( right encoding is auml; ouml; uuml; Auml; szlig; becomes to äöüÃ?Ã?Ã?Ã? Can anybody tell me, what to do to get the characters in the rigth encoding? I am relatively new to web programming. Hence I am not that fitt in encodings and things like this. Thanks in advance, Andreas - 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: JSP with textarea/Form getter and german special character problem
Thanks! Problem solved :-) My jsp was encoded in UTF-8. Changing to iso-8859-1 fixed it. read out should mean, use the getField() of the Form... Leon Rosenberg schrieb: Sorry, but what do you mean with read out. You have Ä in the jsp but ä in the console? If its a Win/DOS console, it doesn't matter, because windows uses it's own encoding. (cp1250) If its a unix/linux console, try to set the encoding of the console to iso-8859-1. You also have to save the encoding of the database (if any) to iso. If you have wrong values in the jsp, then: what's your jsp page encoding? try set the page directive to: %@ page contentType=text/html;charset=iso-8859-1 session=true % or use iso-8859-15 is you want the €-sign regards Leon On Mon, 2005-08-29 at 08:37 +0200, Andreas Scheucher wrote: Hello, I have got a JSP with an textarea. Whene i read out the value over the getter from the related formBean, i get wrong characters for german spezial characters: äöüÄÖÜß ( right encoding is auml; ouml; uuml; Auml; szlig; becomes to äöüÃ?Ã?Ã?Ã? Can anybody tell me, what to do to get the characters in the rigth encoding? I am relatively new to web programming. Hence I am not that fitt in encodings and things like this. Thanks in advance, Andreas - 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]
dynaforms and BeanUtils.copyProperties()
For initializing a formbean with data from another already existing bean, I would like to use the BeanUtils.copyProperties() method - Does anyone know, if there is a possibility to use the BeanUtils.copyProperties() method also with Dynaforms - I don't think so, as Dynaforms have only the generic getter and setter methods but maybe there is some solution to this? thanks a lot, karin. -- DI Karin Schellner Research Studios Austria - Digital Memory Engineering ARC Seibersdorf research GmbH Thurngasse 8/20, A-1090 Wien M. +43.664.825-1105 T. +43.1.585-0537 F. +43.1.585-3741 http://dme.researchstudio.at - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dynaforms and BeanUtils.copyProperties()
Yes you can. BeanUtils will work. DynaProperty[] dynaProperties = bean.getDynaClass().getDynaProperties(); for (DynaProperty property : dynaProperties) { use property.getName() and BeanUtils.copyProperties() } You may use BeanUtils.populate(). As for me, all the BeanUtils package works fine with DynaForms. Rémi Le Lundi 29 Août 2005 10:06, Karin Schellner a écrit : For initializing a formbean with data from another already existing bean, I would like to use the BeanUtils.copyProperties() method - Does anyone know, if there is a possibility to use the BeanUtils.copyProperties() method also with Dynaforms - I don't think so, as Dynaforms have only the generic getter and setter methods but maybe there is some solution to this? thanks a lot, karin. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
using a collection of checkboxes using layout
Hello all Is it possible to use a collection of checkboxes using layout tag?Can we keep the property associated with these(as in html:multibox) empty initially but to be populated on submission of form? Thanks Anuradha
Passing variable to javascript function
I had posted this problem a few days back, but I couldn't find a solution to this. So I'm posting this again, since I need to implemen this urgently. script function validateDelete() { return confirm(Delete Data); } /script html:link action=deleteData name=deleteDataParams scope=page onclick=return validateDelete() Delete Data /html:link To the validateDelete() Javascript function, I want to pass a java variable. How do I do it? Once I pass the variable, my javascript function has to be : script function validateDelete(data) { return confirm(Delete Data+data); } /script
RE: Passing variable to javascript function
Hi Anuradha, I think this will work: onclick=return validateDelete('bean:write name=abc/') where abc is the java variable that you put in request/session. With best regards, Anjishnu. -Original Message- From: Anuradha S.Athreya [mailto:[EMAIL PROTECTED] Sent: Monday, August 29, 2005 2:26 PM To: [EMAIL PROTECTED] Apache. Org Subject: Passing variable to javascript function I had posted this problem a few days back, but I couldn't find a solution to this. So I'm posting this again, since I need to implemen this urgently. script function validateDelete() { return confirm(Delete Data); } /script html:link action=deleteData name=deleteDataParams scope=page onclick=return validateDelete() Delete Data /html:link To the validateDelete() Javascript function, I want to pass a java variable. How do I do it? Once I pass the variable, my javascript function has to be : script function validateDelete(data) { return confirm(Delete Data+data); } /script CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
Re: Navigating back to a previous page
Can it be done if the back button of IE goes to the page (menu page) before the input form? I do not want a common back page. It seems that I have to extend the back button of IE or something else? Can it be defined in JSP or struts-config.xml? Thanks 2005/8/28, Martin Gainty [EMAIL PROTECTED]: Javascript:go.history(-1) will accomplish this.. but beware you will lose the contents of the previous form Unless you know of a way to retain all the information by pressing/clicking the back button ? M- - Original Message - From: Leon Rosenberg [EMAIL PROTECTED] To: 'Struts Users Mailing List' user@struts.apache.org Sent: Saturday, August 27, 2005 9:45 AM Subject: Re: Navigating back to a previous page Hmm Correct me if I wrong, but I think the reset method of the form will help you only if you want to get back to the input page of the form. In the described usecase Jonathan wants to get back to ANY other page he could came from. So how you can ensure that he have a form at all? Regards Leon -Ursprüngliche Nachricht- Von: Martin Gainty [mailto:[EMAIL PROTECTED] Gesendet: Samstag, 27. August 2005 15:20 An: Struts Users Mailing List Betreff: Re: Navigating back to a previous page Jonathan- If you want to preserve the values when back button is pressed you will have to override reset method in your (Dyna)ActionForm Take a look at http://64.233.161.104/search?q=cache:dHwd5qvFAJ4J:www.javapass ion.com/j2ee/StrutsAdvanced_speakernoted.pdf+Struts+and+%22ove rride+reset%22+AND+%22example%22hl=en Martin- - Original Message - From: jonathan gilmore [EMAIL PROTECTED] To: user@struts.apache.org Sent: Saturday, August 27, 2005 6:41 AM Subject: Navigating back to a previous page I have a common screen that is navigated to by many other screens. Does Struts have support for remembering the previous screen so that my common screen needs only one 'back' button to return the user to their original location? I have looked through the docs and havn't found anything. Any comments much appreciated - 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: Navigating back to a previous page
I guess javascript:history.back() should help you. Regds.- Ravi -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, August 29, 2005 2:51 PM To: Struts Users Mailing List; Martin Gainty Subject: Re: Navigating back to a previous page Can it be done if the back button of IE goes to the page (menu page) before the input form? I do not want a common back page. It seems that I have to extend the back button of IE or something else? Can it be defined in JSP or struts-config.xml? Thanks 2005/8/28, Martin Gainty [EMAIL PROTECTED]: Javascript:go.history(-1) will accomplish this.. but beware you will lose the contents of the previous form Unless you know of a way to retain all the information by pressing/clicking the back button ? M- - Original Message - From: Leon Rosenberg [EMAIL PROTECTED] To: 'Struts Users Mailing List' user@struts.apache.org Sent: Saturday, August 27, 2005 9:45 AM Subject: Re: Navigating back to a previous page Hmm Correct me if I wrong, but I think the reset method of the form will help you only if you want to get back to the input page of the form. In the described usecase Jonathan wants to get back to ANY other page he could came from. So how you can ensure that he have a form at all? Regards Leon -Ursprüngliche Nachricht- Von: Martin Gainty [mailto:[EMAIL PROTECTED] Gesendet: Samstag, 27. August 2005 15:20 An: Struts Users Mailing List Betreff: Re: Navigating back to a previous page Jonathan- If you want to preserve the values when back button is pressed you will have to override reset method in your (Dyna)ActionForm Take a look at http://64.233.161.104/search?q=cache:dHwd5qvFAJ4J:www.javapass ion.com/j2ee/StrutsAdvanced_speakernoted.pdf+Struts+and+%22ove rride+reset%22+AND+%22example%22hl=en Martin- - Original Message - From: jonathan gilmore [EMAIL PROTECTED] To: user@struts.apache.org Sent: Saturday, August 27, 2005 6:41 AM Subject: Navigating back to a previous page I have a common screen that is navigated to by many other screens. Does Struts have support for remembering the previous screen so that my common screen needs only one 'back' button to return the user to their original location? I have looked through the docs and havn't found anything. Any comments much appreciated - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Passing variable to javascript function
Unfortunately it's not so easy, because you can't use a tag as an attribute to the tag. html:link action=deleteData name=deleteDataParams scope=page onclick=return validateDelete(bean:write name=data/) This can't work, because the attribute (onclick) will not be evaluated. There could be two possible solutions. First, leave the html taglib and drop back to normal a href... Second: store the variable value in a javascript variable: script var myData = 'bean:write name=data/'; /script html:link action=deleteData name=deleteDataParams scope=page onclick=return validateDelete(myData) Of course this only works if you have the value of myData at page generating time. If the value is changed by something the user does on page, like checking a checkbox, i would store it in a hidden field in the form and read per javascript in validateDelete(), like this: for (var i=0;i document.formname.elements.length;i++){ var e = document.formname.elements[i]; if (e.value == 'set' e.checked==true){ doSubmit=true; myData = e.value; } } the above javascript is only an example how to iterate over form fields with javascript, it has not the required functionality. regards Leon On Mon, 2005-08-29 at 14:28 +0530, Anjishnu Bandyopadhyay wrote: Hi Anuradha, I think this will work: onclick=return validateDelete('bean:write name=abc/') where abc is the java variable that you put in request/session. With best regards, Anjishnu. -Original Message- From: Anuradha S.Athreya [mailto:[EMAIL PROTECTED] Sent: Monday, August 29, 2005 2:26 PM To: [EMAIL PROTECTED] Apache. Org Subject: Passing variable to javascript function I had posted this problem a few days back, but I couldn't find a solution to this. So I'm posting this again, since I need to implemen this urgently. script function validateDelete() { return confirm(Delete Data); } /script html:link action=deleteData name=deleteDataParams scope=page onclick=return validateDelete() Delete Data /html:link To the validateDelete() Javascript function, I want to pass a java variable. How do I do it? Once I pass the variable, my javascript function has to be : script function validateDelete(data) { return confirm(Delete Data+data); } /script CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS*** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Passing variable to javascript function
Thanks , this was very informative. Regards Anuradha -Original Message- From: Leon Rosenberg [mailto:[EMAIL PROTECTED] Sent: Monday, August 29, 2005 4:09 PM To: user@struts.apache.org Subject: RE: Passing variable to javascript function Unfortunately it's not so easy, because you can't use a tag as an attribute to the tag. html:link action=deleteData name=deleteDataParams scope=page onclick=return validateDelete(bean:write name=data/) This can't work, because the attribute (onclick) will not be evaluated. There could be two possible solutions. First, leave the html taglib and drop back to normal a href... Second: store the variable value in a javascript variable: script var myData = 'bean:write name=data/'; /script html:link action=deleteData name=deleteDataParams scope=page onclick=return validateDelete(myData) Of course this only works if you have the value of myData at page generating time. If the value is changed by something the user does on page, like checking a checkbox, i would store it in a hidden field in the form and read per javascript in validateDelete(), like this: for (var i=0;i document.formname.elements.length;i++){ var e = document.formname.elements[i]; if (e.value == 'set' e.checked==true){ doSubmit=true; myData = e.value; } } the above javascript is only an example how to iterate over form fields with javascript, it has not the required functionality. regards Leon On Mon, 2005-08-29 at 14:28 +0530, Anjishnu Bandyopadhyay wrote: Hi Anuradha, I think this will work: onclick=return validateDelete('bean:write name=abc/') where abc is the java variable that you put in request/session. With best regards, Anjishnu. -Original Message- From: Anuradha S.Athreya [mailto:[EMAIL PROTECTED] Sent: Monday, August 29, 2005 2:26 PM To: [EMAIL PROTECTED] Apache. Org Subject: Passing variable to javascript function I had posted this problem a few days back, but I couldn't find a solution to this. So I'm posting this again, since I need to implemen this urgently. script function validateDelete() { return confirm(Delete Data); } /script html:link action=deleteData name=deleteDataParams scope=page onclick=return validateDelete() Delete Data /html:link To the validateDelete() Javascript function, I want to pass a java variable. How do I do it? Once I pass the variable, my javascript function has to be : script function validateDelete(data) { return confirm(Delete Data+data); } /script CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS*** - 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 nested:text within nested:iterate
Hi all, I have a nested:iterate where I am iterating over a list of objects. Each object has a property label, which is being displayed as a textbox. Now, I have a hidden field hdnField, for each row of object. I want to call a _javascript_ function fnUpdate onChange of the textbox to update the hidden field. So, I need to pass the index (row number) of the particular row to the _javascript_ function, so that, the particular hidden field for the particular row can be updated. I am trying something as follows: nested:iterate id=functionalities name=functionalities indexId=indxFunc nested:text styleClass=label maxlength=100 name=functionalities property=label indexed=true name=indxFunc/');/ nested:hidden name=functionalities property=hdnField indexed=true/ /nested:iterate (The above code snippet is also in the attached .txt file, in case there is a problem in reading). But it is not identifying indxFunc for nested:text in nested:iterate. It works fine for static tags like img or a in nested:iterate, eg. img src="" name=indxFunc/'); / Any way to solve the problem? A work-around is to update the hidden field in each row just before submitting the form. But I was wondering if the problem can be solved the way I am trying. Thanks for your time, Anjishnu. CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS*** nested:iterate id=functionalities name=functionalities indexId=indxFunc nested:text styleClass=label maxlength=100 name=functionalities property=label indexed=true onChange=fnUpdate('bean:write name=indxFunc/');/ nested:hidden name=functionalities property=hdnField indexed=true/ /nested:iterate - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Reset for DynaActionForm.
Hi List, How shall we reset the DynaActionForm as we do reset while sing Actionform ? Thankx best regds, AMOL YADWADKAR | Software Engineer | M P H A S I S Architecting Value| IT SERVICES 2nd Floor, The Leela Business Park, Andheri Kurla Road, Andheri(E), Mumbai 400059| Tel: 91 22 5677 Extn 5356 | Fax: 91 22 5600| Cell : 9819011934 | www.mphasis.com BLOCKED::http://www.mphasis.com Information transmitted by this e-mail is proprietary to MphasiS and/ or its Customers and is intended for use only by the individual or entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If you are not the intended recipient or it appears that this mail has been forwarded to you without proper authority, you are notified that any use or dissemination of this information in any manner is strictly prohibited. In such cases, please notify us immediately at [EMAIL PROTECTED] BLOCKED::mailto:[EMAIL PROTECTED] and delete this mail from your records.
RE: Passing variable to javascript function
You can also use JSTL Notation. bean:define id=myVar name=form property=field/ html:link action="" name=deleteDataParams scope=page validateDelete('${myVar}') Leon Rosenberg [EMAIL PROTECTED] Leon Rosenberg [EMAIL PROTECTED] 08/29/2005 06:39 AM Please respond to Struts Users Mailing List user@struts.apache.org To user@struts.apache.org cc Subject RE: Passing variable to _javascript_ function Unfortunately it's not so easy, because you can't use a tag as an attribute to the tag. html:link action="" name=deleteDataParams scope=page validateDelete(bean:write name=data/) This can't work, because the attribute (onclick) will not be evaluated. There could be two possible solutions. First, leave the html taglib and drop back to normal a href... Second: store the variable value in a _javascript_ variable: script var myData = 'bean:write name=data/'; /script html:link action="" name=deleteDataParams scope=page validateDelete(myData) Of course this only works if you have the value of myData at page generating time. If the value is changed by something the user does on page, like checking a checkbox, i would store it in a hidden field in the form and read per _javascript_ in validateDelete(), like this: for (var i=0;i document.formname.elements.length;i++){ var e = document.formname.elements[i]; if (e.value == 'set' e.checked==true){ doSubmit=true; myData = e.value; } } the above _javascript_ is only an example how to iterate over form fields with _javascript_, it has not the required functionality. regards Leon On Mon, 2005-08-29 at 14:28 +0530, Anjishnu Bandyopadhyay wrote: Hi Anuradha, I think this will work: validateDelete('bean:write name=abc/') where abc is the java variable that you put in request/session. With best regards, Anjishnu. -Original Message- From: Anuradha S.Athreya [mailto:[EMAIL PROTECTED] Sent: Monday, August 29, 2005 2:26 PM To: [EMAIL PROTECTED] Apache. Org Subject: Passing variable to _javascript_ function I had posted this problem a few days back, but I couldn't find a solution to this. So I'm posting this again, since I need to implemen this urgently. script function validateDelete() { return confirm(Delete Data); } /script html:link action="" name=deleteDataParams scope=page validateDelete() Delete Data /html:link To the validateDelete() _javascript_ function, I want to pass a java variable. How do I do it? Once I pass the variable, my _javascript_ function has to be : script function validateDelete(data) { return confirm(Delete Data+data); } /script CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS*** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
re:passing variable to javascript
Hi Anuradha try using el.I mean you may use struts-html-el.tld and it will be a lot easier. For e.g. html-el:link href=javascript:CancelX('${beanname.property}') so the $ will indicate that beanname.property has to be evaluated.You will need jstl.jar,standard.jar and struts-el for this. Warm Regards Anuradha
File Upload
Hello, I am using Struts Upload. I want to understand the intricacies of using File upload using Struts. In our JSP/ HTML, we use a form with enctype =multipart/form-data and the HTML - file to upload a file using HTTP post. Now, If I were to spcify the same request in the Browser;s address bar, what should it be? http://localhost:2/myApp/uploadDocument.do?name=myFilefile=test.txtenc type=multipart/form-data My Action form has the field : name and file. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
how to init forms?
Hi, I just started implementing a webapplication using Struts and could not find a good solution for the following (- not so uncommon as I would guess -) problem: Each authenticated user has a userprofile with personal data which he/she can edit via a PersdataForm. The initial values for this form should be retrieved from the database, i.e. there is a BO somewhere containing these data. There is a PersdataAction writing the changed values back to the BO. How would I best initiate the form? - the FormBeans reset method seems not to be the right place because it is called too often - should I use another Action? but how would the configuration look like in such a scenario? Thanks in advance for your ideas on this problem! karin. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to init forms?
Check out Rick's Struttin with Struts lessons. Lesson 2 covers form prepopulation. http://www.reumann.net/struts/lesson2.do Hubert On 8/29/05, Karin Schellner [EMAIL PROTECTED] wrote: Hi, I just started implementing a webapplication using Struts and could not find a good solution for the following (- not so uncommon as I would guess -) problem: Each authenticated user has a userprofile with personal data which he/she can edit via a PersdataForm. The initial values for this form should be retrieved from the database, i.e. there is a BO somewhere containing these data. There is a PersdataAction writing the changed values back to the BO. How would I best initiate the form? - the FormBeans reset method seems not to be the right place because it is called too often - should I use another Action? but how would the configuration look like in such a scenario? Thanks in advance for your ideas on this problem! karin. - 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: File Upload
You can't upload a document using a GET request. Stick with your HTTP post form. Hubert On 8/29/05, Anuradha S.Athreya [EMAIL PROTECTED] wrote: Hello, I am using Struts Upload. I want to understand the intricacies of using File upload using Struts. In our JSP/ HTML, we use a form with enctype =multipart/form-data and the HTML - file to upload a file using HTTP post. Now, If I were to spcify the same request in the Browser;s address bar, what should it be? http://localhost:2/myApp/uploadDocument.do?name=myFilefile=test.txtenc type=multipart/form-data My Action form has the field : name and file. - 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: problem with nested:text within nested:iterate
Your problem is trying to use a JSP tag within a JSP tag: nested:text styleClass=label maxlength=100 name=functionalities property=label indexed=true onChange=fnUpdate('bean:write name=indxFunc/');/ Try something like: onChange=%= fnUpdate(' + bean:write name=indxFunc/ + ') %/ On 8/29/05, Anjishnu Bandyopadhyay [EMAIL PROTECTED] wrote: Hi all, I have a nested:iterate where I am iterating over a list of objects. Each object has a property label, which is being displayed as a textbox. Now, I have a hidden field hdnField, for each row of object. I want to call a javascript function fnUpdate onChange of the textbox to update the hidden field. So, I need to pass the index (row number) of the particular row to the javascript function, so that, the particular hidden field for the particular row can be updated. I am trying something as follows: nested:iterate id=functionalities name=functionalities indexId=indxFunc nested:text styleClass=label maxlength=100 name=functionalities property=label indexed=true onChange=fnUpdate('bean:write name=indxFunc/');/ nested:hidden name=functionalities property=hdnField indexed=true/ /nested:iterate (The above code snippet is also in the attached .txt file, in case there is a problem in reading). But it is not identifying indxFunc for nested:text in nested:iterate. It works fine for static tags like img or a in nested:iterate, eg. img src=find.gif onclick=fn('bean:write name=indxFunc/'); / Any way to solve the problem? A work-around is to update the hidden field in each row just before submitting the form. But I was wondering if the problem can be solved the way I am trying. Thanks for your time, Anjishnu. CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS*** nested:iterate id=functionalities name=functionalities indexId=indxFunc nested:text styleClass=label maxlength=100 name=functionalities property=label indexed=true onChange=fnUpdate('bean:write name=indxFunc/');/ nested:hidden name=functionalities property=hdnField indexed=true/ /nested:iterate - 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: File Upload
I yeah I figured that out... But if I were to have my java program do the Post job, How do I specify the file details? Rgds Anu -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Monday, August 29, 2005 6:21 PM To: Struts Users Mailing List Subject: Re: File Upload You can't upload a document using a GET request. Stick with your HTTP post form. Hubert On 8/29/05, Anuradha S.Athreya [EMAIL PROTECTED] wrote: Hello, I am using Struts Upload. I want to understand the intricacies of using File upload using Struts. In our JSP/ HTML, we use a form with enctype =multipart/form-data and the HTML - file to upload a file using HTTP post. Now, If I were to spcify the same request in the Browser;s address bar, what should it be? http://localhost:2/myApp/uploadDocument.do?name=myFilefile=test.t xtenc type=multipart/form-data My Action form has the field : name and file. - 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: File Upload
That part I'm not familiar with. If someone doesn't provide you with a response, maybe google for some HTTP upload tutorials or technical documentation. On 8/29/05, Anuradha S.Athreya [EMAIL PROTECTED] wrote: I yeah I figured that out... But if I were to have my java program do the Post job, How do I specify the file details? Rgds Anu -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Monday, August 29, 2005 6:21 PM To: Struts Users Mailing List Subject: Re: File Upload You can't upload a document using a GET request. Stick with your HTTP post form. Hubert On 8/29/05, Anuradha S.Athreya [EMAIL PROTECTED] wrote: Hello, I am using Struts Upload. I want to understand the intricacies of using File upload using Struts. In our JSP/ HTML, we use a form with enctype =multipart/form-data and the HTML - file to upload a file using HTTP post. Now, If I were to spcify the same request in the Browser;s address bar, what should it be? http://localhost:2/myApp/uploadDocument.do?name=myFilefile=test.t xtenc type=multipart/form-data My Action form has the field : name and file. - 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: how to init forms?
This is something which is kind of awkward in Struts 1.2. I think we've got a pretty decent approach in Struts 1.3, but I guess we'll have to wait until more people start checking that out to find out. Basically, the approach is to prepare a FormBean instance in an action and populate its values with those you want to see in the form. If the FormBean is in the right place, then when the page draws, the form tag and its child elements will be populated based on the FormBean instance. The right place is dependent on the name and scope of the action in the html:form's action attribute. Specifically, the bean should be in either request or session scope (accordingly) under an attribute name which matches the Form Bean's name. First, how it should be done in Struts 1.3, because it's more straightforward; below that, the gist of how to do it in Struts 1.2. Before midway through the Struts 1.2 development line, there was even less API support, so I won't get into the details -- hopefully there aren't a lot of people still using Struts 1.1, but if you needed, you could probably work out the gist of it from what comes below. So, in Struts 1.3, there is a generic command, CopyFormToContext. If you configure this command simply with the submission destination (action path) of the form you want to prefill, Struts will create a form bean (or reuse an existing one if possible) and put it where it needs to be for the form to use it as a prefill source. You then need to follow that command with another which would be customized to your needs and which would perform the prefilling logic. You can configure CopyFormToContext so that besides putting the form where the html:form tag needs it, it can also put a reference under any arbitrary Context key, so that your population command can find it easily. I won't get into the details of configuring chains and commands here, except to note that you can hook a command to any action or forward, so that this behavior is executed en route to your view. I'll be happy to answer follow-on questions as necessary, but first, a bit more about how this works in Struts 1.2 (which is what the above does behind the scenes.) The problem is that in Struts 1.2, you need to hard-code more than I really like about the config files into your actions, and the API is not entirely straightforward. There are methods in ModuleUtils and RequestUtils to get a hold of the relevant objects and ultimately get a form instance, but the responsibility for putting that form bean back into the correct scope under the correct key is still not centralized. (It's actually not universally centralized in Struts 1.3 either, but still, there's a enough support for this specific task that it's not such a big deal.) I recommend using the API for getting a form bean instance because it's pretty cumbersome to instantiate dynaforms yourself. The steps are: get the ModuleConfig (static, only requires an instance of HttpServletRequest), then from the module config, get the ActionMapping (aka ActionConfig) (just takes the action path of the submit destination of the form you want to prepare), and then get the Form instance using the static RequestUtils.createActionForm(request, mapping, moduleConfig, servlet). Now you have the bean you wish to populate, After you populate it, there is no specific Struts API method, but you can use the ActionMapping (the one you looked up, not the one passed in to your preparation action) to find the correct scope and name. ModuleUtils.getModuleConfig(request) http://struts.apache.org/api/org/apache/struts/util/ModuleUtils.html#getModuleConfig(javax.servlet.http.HttpServletRequest) ModuleConfig.findActionConfig http://struts.apache.org/api/org/apache/struts/config/ModuleConfig.html#findActionConfig(java.lang.String) RequestUtils.createActionForm(request, mapping, moduleConfig, servlet) http://struts.apache.org/api/org/apache/struts/util/RequestUtils.html#createActionForm(javax.servlet.http.HttpServletRequest,%20org.apache.struts.action.ActionMapping,%20org.apache.struts.config.ModuleConfig,%20org.apache.struts.action.ActionServlet) I hope this helps. The relative difficulty of achieving this compared to the regularity with which it is needed has been bothering me for years, and I hope that people will agree that it is getting easier in newer versions of Struts. Joe At 2:44 PM +0200 8/29/05, Karin Schellner wrote: Hi, I just started implementing a webapplication using Struts and could not find a good solution for the following (- not so uncommon as I would guess -) problem: Each authenticated user has a userprofile with personal data which he/she can edit via a PersdataForm. The initial values for this form should be retrieved from the database, i.e. there is a BO somewhere containing these data. There is a PersdataAction writing the changed values back to the BO. How would I best initiate the form?
core struts -- best practise fundementals
Hi all, I am trying to understand the motivation behind seperation of logic and presentation in struts framework. I was wondering if any of you can provide some light if I am thinking in right direction. Now, if you write scriptlets in JSP, that is a bad practice.., however if you hide that functionality in a tag class and implement that tag like struts tags or any other tags.. thats a good practice. For example, I want to send a concatenated string instead of a hashmap to display as per key-value relationship. I meant send [EMAIL PROTECTED] string rather than a hashmap and want to parse it for display. If I write a scriptlet that I use to substring and display only that user is concerned with -- that is bad practice. If I use a tag lib that looks more like logic:substring name=hashArr digits=4, -- good. Am I getting this whole thing wrong? Pls excuse if I sound too stupid and this is my first post here.. --Ashrita - Yahoo! Mail for Mobile Take Yahoo! Mail with you! Check email on your mobile phone.
Re: File Upload
You need to send the HTTP POST request using the multipart/form-data encoding. In other words, the POST body should be in multipart MIME format. If you're using an HTTP library to construct the request it probably already has built in support for this. Otherwise you'll need to read up on the details of submitting multipart/form-data formatted requests. L. Anuradha S.Athreya wrote: I yeah I figured that out... But if I were to have my java program do the Post job, How do I specify the file details? Rgds Anu -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Monday, August 29, 2005 6:21 PM To: Struts Users Mailing List Subject: Re: File Upload You can't upload a document using a GET request. Stick with your HTTP post form. Hubert On 8/29/05, Anuradha S.Athreya [EMAIL PROTECTED] wrote: Hello, I am using Struts Upload. I want to understand the intricacies of using File upload using Struts. In our JSP/ HTML, we use a form with enctype =multipart/form-data and the HTML - file to upload a file using HTTP post. Now, If I were to spcify the same request in the Browser;s address bar, what should it be? http://localhost:2/myApp/uploadDocument.do?name=myFilefile=test.t xtenc type=multipart/form-data My Action form has the field : name and file. - 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] -- Laurie Harper Open Source advocate, Java geek: http://www.holoweb.net/laurie Founder, Zotech Software: http://www.zotechsoftware.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: core struts -- best practise fundementals
The tag library allows reuse whereas scriptlets lead to copy/paste oriented programming ;-). Separation of concerns is one of the main principles of OOAD. It allows you to change the logic and presentation layer objects independent of each other. It is easier to develop, maintain and extend a system that conforms to this principle. Bala -Original Message- From: peru cheppanu [mailto:[EMAIL PROTECTED] Sent: Monday, August 29, 2005 12:42 PM To: user@struts.apache.org Subject: core struts -- best practise fundementals Hi all, I am trying to understand the motivation behind seperation of logic and presentation in struts framework. I was wondering if any of you can provide some light if I am thinking in right direction. Now, if you write scriptlets in JSP, that is a bad practice.., however if you hide that functionality in a tag class and implement that tag like struts tags or any other tags.. thats a good practice. For example, I want to send a concatenated string instead of a hashmap to display as per key-value relationship. I meant send [EMAIL PROTECTED] string rather than a hashmap and want to parse it for display. If I write a scriptlet that I use to substring and display only that user is concerned with -- that is bad practice. If I use a tag lib that looks more like logic:substring name=hashArr digits=4, -- good. Am I getting this whole thing wrong? Pls excuse if I sound too stupid and this is my first post here.. --Ashrita - Yahoo! Mail for Mobile Take Yahoo! Mail with you! Check email on your mobile phone. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: core struts -- best practise fundementals
For the most part you are correct. However, it is a little more straight forward than that. Logic should be wrappered in a logic object. The Tag Library can bridge the presentation to this generic logic. This is so that the generic logic can be used universally from either a presentation screen or from another logic object that needs the same functionallity. This is good practice because it allows you to write the code once and reuse it in many places. This saves on memory, Maintenance time, Development time, etc. The reason you want to extract presentation from logic, is because many companies rebrand themselves often on the internet. New look and feel keeps thing nice and fresh, but is a nightmare if you have to rewrite your applications just to take on a new layout. Additionally, after a site is released, you often find the users do not use the application as you expected during development. By rearranging the screen layout and application flow, you can make the users more productive and generally happier. If you tie your logic to your screen this becomes much more complex. The key to any object oriented language is to develop small compartmentalized objects. These objects should focus on just the functionallity it needs to complete its task. A fell defined set of interfaces should handle getting the information to and from the little back box. This is where Struts, Taglibraries, JSF, etc come into play. peru cheppanu [EMAIL PROTECTED] peru cheppanu [EMAIL PROTECTED] 08/29/2005 12:41 PM Please respond to Struts Users Mailing List user@struts.apache.org To user@struts.apache.org cc Subject core struts -- best practise fundementals Hi all, I am trying to understand the motivation behind seperation of logic and presentation in struts framework. I was wondering if any of you can provide some light if I am thinking in right direction. Now, if you write scriptlets in JSP, that is a bad practice.., however if you hide that functionality in a tag class and implement that tag like struts tags or any other tags.. thats a good practice. For example, I want to send a concatenated string instead of a hashmap to display as per key-value relationship. I meant send [EMAIL PROTECTED] string rather than a hashmap and want to parse it for display. If I write a scriptlet that I use to substring and display only that user is concerned with -- that is bad practice. If I use a tag lib that looks more like logic:substring name=hashArr digits=4, -- good. Am I getting this whole thing wrong? Pls excuse if I sound too stupid and this is my first post here.. --Ashrita - Yahoo! Mail for Mobile Take Yahoo! Mail with you! Check email on your mobile phone.
What Is the URL to Join the Discussion of JSF?
I start using the JSF. But, I cannot find the place where I can join the discussion of JSF at the jakarta.apache.org. What is the exact URL? Please help. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: What Is the URL to Join the Discussion of JSF?
On 8/29/05, Caroline Jen [EMAIL PROTECTED] wrote: I start using the JSF. But, I cannot find the place where I can join the discussion of JSF at the jakarta.apache.org. What is the exact URL? Please help. There is not really a the place at Apache to discuss JSF, but your best bet for general questions about it (and an open source implementation you can use) is at MyFaces (http://myfaces.apache.org). The user mailing list there has people that can answer questions about JSF in general, as well as about the MyFaces extended components -- follow the mailing lists link on that page for info on how to subscribe. Links to some external sources of resources about JSF are also listed on the Shale Wiki page: http://wiki.apache.org/struts/StrutsShale In particular, the forum links there might prove useful pointers to additional places you can ask questions. Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Struts] - How to put a nested object inside a set, that's inside a ActionForm
Hi everyone I'm trying to build a search, accessing a nested object, in a JSP, that is inside a set nested in the a POJO, to perform a search in the page. For example, I have a PersonForm p - Set purchases - Product product - Brand brand - brand name I was trying this approach: td align=left appfuse:label key=personForm.purchases.product.brand.name/ /td td align=left html:text property=purchases.product.brand.name size=15/ (full or partial) /td How can I do it? Best Regards Rafael Mauricio Nami - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Integrating two applications
Hello: I have two applications that have front-ends developed using the struts framework. They both run on weblogic application servers. Each application has its own controller. They operate in two different physical environments. In the MVC paradigm, it's two independent MVCs. I should be able to bring up pages that are controlled by one Application from within the other. They have to share sessions. This is because authenticated users on one system should be respected in the other. They share the same security infrastructure. Any ideas are welcome. Venki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts-Layout DispatchAction problem.
Hello, I am new to Struts Framework. I am developing a Struts based JSR 168 portlet on WepSphere Portal 5.1 platform. I needed some help with an error I am getting in designing a Tree based hierarchial View in the portlet. I am using Struts DispatchAction class to forward the user to the Tree based navigation. This is the jsp code fragment for this. html:form urlType=standard action=Login.do Here I am calling the unspecified method in my DispatchAction class. This works fine and the tree is populated inside my Action class and displayed through a JSP (ActionForward). Now I am trying to associate action handling with the links within Tree View (MenuComponent) doing something like this in my Action Class. channel.setLocation(Login.do?method=selectCMAFormcellPointId= + form.getChannel()); Here channel is my MenuComponent -- the last node within the tree.. This dosent seem to work and selectCMAForm method within the Action class is not called. I tried to call any outside link through my action class like channel.setLocation(http://www.google.com;); This works. I also tried to call my DispatchAction method directly through the jsp like html:form urlType=standard action=Login.do?method=selectCMAFormcellPointId=customer This also works and the selectCMAForm method is called. May be I am missing something here. I would appreciate any help or tips with this problem. I am using an ActionForm which is getting populated inside the Action class. Thanks - Kunjal. - Start your day with Yahoo! - make it your home page
Re: core struts -- best practise fundementals
Although the previous two answers are basically correct, I don't think they really contain the response to Peru's initial question. I hope that the elders of this list will clarify things a bit for him. :-) I considered that I'd better avoid responding myself to this, as one that sometime ago was asking (myself and others) why should using the logic:equals or logic:iterate be better than using the equivalent java code - which was also faster for me to do than learning the new tags Still... In this specific case, maybe the answer is not writing a whole new custom tag at all. It wouldn't be very efficient anyway, especially if the parsing mentioned is done in one or two particular places only. It might show that maybe a model layer does not exist for the application, and maybe the data is directly retrieved from a (probably legacy) database. (Forgive me if I'm wrong.) At least that parsing could be done in the Action that prepares the view, and the data stored in a form that is easier to display. Even if you will still chose to use a custom tag for that, attaching it to the struts standard logic taglib wouldn't be a good choice ( if that was what you meant by a tag used as logic:substring ...) Radu - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
re: Integrating two applications
aehm... 1. the easy (or quick and very dirty) solution: As soon as the user logins in app1, login him into app2 via iframe or hidden javascript link and vice versa. Embed screens from the second application via iframe or similar into the first application. Ensure you have reloads of dummy pages, so the session doesn't time out. In one word: integrate on html level. It's a very quick and pretty dirty solution. But it will work. 2. Write an access control layer, maybe with your own cookie, a crypted string (blowfishJ) or a crypted cookie and use it from both applications to identify the user. User logs in on app1, it sets the cookie with user permissions and a timestamp, on each request to both apps the cookie is checked. 3. The right one. Merge both applications :-) Hope that helps Regards Leon -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Montag, 29. August 2005 21:04 An: user@struts.apache.org Betreff: Integrating two applications Hello: I have two applications that have front-ends developed using the struts framework. They both run on weblogic application servers. Each application has its own controller. They operate in two different physical environments. In the MVC paradigm, it's two independent MVCs. I should be able to bring up pages that are controlled by one Application from within the other. They have to share sessions. This is because authenticated users on one system should be respected in the other. They share the same security infrastructure. Any ideas are welcome. Venki - 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]
RowSetDynaClass weird problem
Hello all, I've done it before, in one project it works perfectly in the other it doesn't so I was hoping I could get some help from you. This new project tries to create a Radiobutton table on the fly using RowSetDynaClass I have an action that calls a DAO which returns a RowSetDynaClass like this: *public* ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { *DataSource* dataSource = *null*; *Connection* conn = *null*; RowSetDynaClass rowSet = *null*; *try* { dataSource = getDataSource(request,ds1); conn = dataSource.getConnection(); CategoryDAO dao = *new* CategoryDAO(); *String* SQL = SELECT catID,Title FROM tbl_catSimple; rowSet = dao.getUsersRowSet(dataSource,SQL); *if* (!rowSet.getRows().isEmpty()) { request.setAttribute(rowCatSet,rowSet); } } *catch* (*SQLException* sqle) { getServlet().log(Connection process ,sqle); } *catch* (*Exception* e) { getServlet().log(Exception ,e); } *finally* { *try* { *if* (conn != *null*) { conn.close(); } } *catch* (*SQLException* e) { getServlet().log(Connection close ,e); } } *if* (request.getSession().getAttribute(userid) != *null*) { DynaActionForm catForm = (DynaActionForm) request.getSession().getAttribute(catForm); *if* (catForm.getString(cat_ID) != *null*) { request.setAttribute(cat_ID,catForm.getString(cat_ID)); } *return* mapping.findForward(form); } *return* mapping.findForward(error); } The CategoryDao class has the following method which returns a RowSetDynaClass * public* RowSetDynaClass getUsersRowSet(*DataSource* dataSource, *String* SQL) *throws* *Exception* { *Connection* conn= *null*; *ResultSet* rs = *null*; *Statement* stm = *null*; RowSetDynaClass rowSet = *null*; *try* { conn = dataSource.getConnection(); stm = conn.createStatement(); rs = stm.executeQuery(SQL); rowSet = *new* RowSetDynaClass(rs); } *catch* (*SQLException* sqle) { ///getServlet().log(Connection process ,sqle);/ } *finally* { *if* (conn != *null*) { conn.close(); } } *return* rowSet; } The action works perfectly, the rowSet is saved on the request scope as rowCatSet and the findForward(form) is called which is my catform.jsp. The JSP content is as follows: *%* *if* (request.getAttribute(rowCatSet) != *null*) { *%* form method=post action=category.do table width=88% border=0 *bean:define* id=cols name=rowCatSet property=dynaProperties*/* tr *logic:iterate* id=col name=cols** th*bean:write* name=col property=name*/*/th */logic:iterate* /tr *logic:iterate* id=row name=rowCatSet property=rows** tr td width=6% bgcolor=#CCinput name=cat_ID type=radio value=*bean:write* name=row property=catID*/*/td td bgcolor=#CCspan class=style32*bean:write* name=row property=Title*/*/span/td /tr */logic:iterate* tr td bgcolor=#D5D5FFinput name=cat_ID type=radio value=4/td td bgcolor=#D5D5FFspan class=style32motorcycles/span/td /tr /table /form *%* } *% Please notice, that I first check to see if rowCatSet is null, since it is not I do the iteration. However I get the following error: No getter method for property catID of bean row! If I erase it I have the same error for the second property Title. * What is going on with this RowSetDynaClass? What have I done wrong? Why is that my row does not have a property named catID if it is specified on the SQL statement and does return correctly? Thanks, C.F. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RowSetDynaClass weird problem
Never mind. It was fixed by using low caps property names for the bean. Thanks. C.F. Scheidecker Antunes wrote: Hello all, I've done it before, in one project it works perfectly in the other it doesn't so I was hoping I could get some help from you. This new project tries to create a Radiobutton table on the fly using RowSetDynaClass I have an action that calls a DAO which returns a RowSetDynaClass like this: *public* ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { *DataSource* dataSource = *null*; *Connection* conn = *null*; RowSetDynaClass rowSet = *null*; *try* { dataSource = getDataSource(request,ds1); conn = dataSource.getConnection(); CategoryDAO dao = *new* CategoryDAO(); *String* SQL = SELECT catID,Title FROM tbl_catSimple; rowSet = dao.getUsersRowSet(dataSource,SQL); *if* (!rowSet.getRows().isEmpty()) { request.setAttribute(rowCatSet,rowSet); } } *catch* (*SQLException* sqle) { getServlet().log(Connection process ,sqle); } *catch* (*Exception* e) { getServlet().log(Exception ,e); } *finally* { *try* { *if* (conn != *null*) { conn.close(); } } *catch* (*SQLException* e) { getServlet().log(Connection close ,e); } } *if* (request.getSession().getAttribute(userid) != *null*) { DynaActionForm catForm = (DynaActionForm) request.getSession().getAttribute(catForm); *if* (catForm.getString(cat_ID) != *null*) { request.setAttribute(cat_ID,catForm.getString(cat_ID)); } *return* mapping.findForward(form); } *return* mapping.findForward(error); } The CategoryDao class has the following method which returns a RowSetDynaClass * public* RowSetDynaClass getUsersRowSet(*DataSource* dataSource, *String* SQL) *throws* *Exception* { *Connection* conn= *null*; *ResultSet* rs = *null*; *Statement* stm = *null*; RowSetDynaClass rowSet = *null*; *try* { conn = dataSource.getConnection(); stm = conn.createStatement(); rs = stm.executeQuery(SQL); rowSet = *new* RowSetDynaClass(rs); } *catch* (*SQLException* sqle) { ///getServlet().log(Connection process ,sqle);/ } *finally* { *if* (conn != *null*) { conn.close(); } } *return* rowSet; } The action works perfectly, the rowSet is saved on the request scope as rowCatSet and the findForward(form) is called which is my catform.jsp. The JSP content is as follows: *%* *if* (request.getAttribute(rowCatSet) != *null*) { *%* form method=post action=category.do table width=88% border=0 *bean:define* id=cols name=rowCatSet property=dynaProperties*/* tr *logic:iterate* id=col name=cols** th*bean:write* name=col property=name*/*/th */logic:iterate* /tr *logic:iterate* id=row name=rowCatSet property=rows** tr td width=6% bgcolor=#CCinput name=cat_ID type=radio value=*bean:write* name=row property=catID*/*/td td bgcolor=#CCspan class=style32*bean:write* name=row property=Title*/*/span/td /tr */logic:iterate* tr td bgcolor=#D5D5FFinput name=cat_ID type=radio value=4/td td bgcolor=#D5D5FFspan class=style32motorcycles/span/td /tr /table /form *%* } *% Please notice, that I first check to see if rowCatSet is null, since it is not I do the iteration. However I get the following error: No getter method for property catID of bean row! If I erase it I have the same error for the second property Title. * What is going on with this RowSetDynaClass? What have I done wrong? Why is that my row does not have a property named catID if it is specified on the SQL statement and does return correctly? Thanks, C.F. - 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]
check radiobutton option based on value posted to the session 2
Hello all, I have a radiobutton group called categID. Once the form is submited it goes to the following form bean: *form-bean* name=catForm type=org.apache.struts.action.DynaActionForm** *form-property* name=categID type=java.lang.String*/* */form-bean* That is the catForm has an attribute called categID with the value posted. This is a DynaActionForm that resides on the session scope. Once the form is submited I need to show the radio group again on the next page with the one selected already checked. How can I check this DynaActionForm from the session on the JSP and see if the corresponding radiobutton is to be checked or not? My JSP is as follows: logic:iterate id=row name=rowCatSet property=rows tr td width=6% bgcolor=#CCinput name=cat_ID type=radio value=bean:write name=row property=catID//td td bgcolor=#CCspan class=style32bean:write name=row property=Title//span/td /tr /logic:iterate The problem is that I am already iterating a bean to fill up the value of the radiobuttons. If I am to use the html:radio/ tag then I would need a way to have the bean row catID property value inside the tag. How can I accomplish it? Thanks, C.F. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Struts] - How to put a nested object inside a set, that's inside a ActionForm
Rafael Nami wrote: I'm trying to build a search, accessing a nested object, in a JSP, that is inside a set nested in the a POJO, to perform a search in the page. For example, I have a PersonForm p - Set purchases - Product product - Brand brand - brand name I was trying this approach: [...] html:text property=purchases.product.brand.name size=15/ [...] How can I do it? The short answer is, you can't: there's no way to access members of a set directly like this. You'll need to change your form bean to store your purchases as an indexed property so you can address them with something like html:text property=purchases[0].product.brand.name size=15/ L. -- Laurie Harper Open Source advocate, Java geek: http://www.holoweb.net/laurie Founder, Zotech Software: http://www.zotechsoftware.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Struts] - How to put a nested object inside a set, that's inside a ActionForm
I've done this: Added to PersonForm a brandName - now I just have to get the Hibernate CriteriaQuery running. Thanks Laurie Rafael Mauricio Nami 2005/8/29, Laurie Harper [EMAIL PROTECTED]: Rafael Nami wrote: I'm trying to build a search, accessing a nested object, in a JSP, that is inside a set nested in the a POJO, to perform a search in the page. For example, I have a PersonForm p - Set purchases - Product product - Brand brand - brand name I was trying this approach: [...] html:text property=purchases.product.brand.name size=15/ [...] How can I do it? The short answer is, you can't: there's no way to access members of a set directly like this. You'll need to change your form bean to store your purchases as an indexed property so you can address them with something like html:text property=purchases[0].product.brand.name size=15/ L. -- Laurie Harper Open Source advocate, Java geek: http://www.holoweb.net/laurie Founder, Zotech Software: http://www.zotechsoftware.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Java - Assim no Server como no Palm iJava - thus in the Server as it is in Palm - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] HTML slideshows: S5 slideshow system
For those of you doing presentations, this may be of interest: http://www.meyerweb.com/eric/tools/s5/ Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] HTML slideshows: S5 slideshow system
That's pretty cool. -- James Mitchell Software Engineer / Open Source Evangelist Consulting / Mentoring / Freelance EdgeTech, Inc. http://www.edgetechservices.net/ 678.910.8017 AIM: jmitchtx Yahoo: jmitchtx MSN: [EMAIL PROTECTED] Skype: callto://jmitchtx On Aug 29, 2005, at 8:40 PM, Michael Jouravlev wrote: For those of you doing presentations, this may be of interest: http://www.meyerweb.com/eric/tools/s5/ Michael. - 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: [OT] HTML slideshows: S5 slideshow system
Michael i did'nt know you could email P.M. Blair??? is / are there any XFN spiders released? M - Original Message - From: Michael Jouravlev [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, August 29, 2005 8:40 PM Subject: [OT] HTML slideshows: S5 slideshow system For those of you doing presentations, this may be of interest: http://www.meyerweb.com/eric/tools/s5/ Michael. - 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]
[OT] How To Hard Code Data in JSF h:dataTable ...?
I am trying to arbitrarily type in some values for a datatable that is coded using JSF. I am new to the JSF and please help me. 1. Do I set it correctly (see the code below)? 2. I have to hard code some data in the h:dataTable .. that I create. How do I do it (i.e. how do I modify the code shown below)? My presentation JSP looks like: %@ taglib uri=http://java.sun.com/jsf/html; prefix=h % %@ taglib uri=http://java.sun.com/jsf/core; prefix=f % html head titleList of Personnel Candidates for Departure/title /head body f:view h:form id=selectedPersonnel h:dataTable value=#{personnelList.personnel} var=personnelBean binding=#{SelectedBean.table} h:column f:facet name=header h:outputText value=Selected/ /f:facet h:selectBooleanCheckbox id=selected binding=#{SelectedBean.selected}/ /h:column h:column f:facet name=header h:outputText value=SSN/ /f:facet h:outputText id=ssn value=#{personnelBean.ssn}/ /h:column h:column f:facet name=header h:outputText value=OPLAN/ /f:facet h:outputText id=oplan value=#{personnelBean.oplan}/ /h:column /h:dataTable h:commandButton id=Depart value=DEPART action=#{SelectedBean.updateDeparturePersonnel}/ /h:form /f:view /body /html The personnelList is the managed bean. And the personnel is an ArrayList. I have a Java class that loads data into this ArrayList personnel. The Java class is called Table: public class Table { ArrayList personnel; public ArrayList getPersonnel() { PersonnelBean pb = new PersonnelBean(); pb.setOplan( ); pb.setSsn( ); personnel.add( pb ); return personnel; } public void setPersonnel( ArrayList personnel ) { this.personnel = personnel; } } The PersonnelBean is a Java bean that get and set the attributes: public class PersonnelBean { String ssn; String oplan; public PersonnelBean() { //Empty Constructor } public String getSsn() { return ssn; } public void setSsn( String data ) { this.ssn = data; } public String getOplan() { return oplan; } public void setOplan( String data ) { this.oplan = data; } } __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: check radiobutton option based on value posted to the session 2
From: C.F. Scheidecker Antunes [EMAIL PROTECTED] Once the form is submited I need to show the radio group again on the next page with the one selected already checked. How can I check this DynaActionForm from the session on the JSP and see if the corresponding radiobutton is to be checked or not? You shouldn't have to... if you use the Struts tags, the framework will automatically render the correct radio button as on. Is the second page using the same session-scoped form bean? logic:iterate id=row name=rowCatSet property=rows input name=cat_ID type=radio value=bean:write name=row property=catID/ bean:write name=row property=Title/ /logic:iterate The problem is that I am already iterating a bean to fill up the value of the radiobuttons. If I am to use the html:radio/ tag then I would need a way to have the bean row catID property value inside the tag. How can I accomplish it? I'd do it with Struts-EL and JSTL... I can only find a multibox example at the moment: c:forEach items=${accountMap} var=item html-el:multibox property=accounts value=${item.key}/ c:out value=${item.key}/ /c:forEach I haven't used it, but the docs say there is an 'idName' parameter for html:radio that might be useful. As usual, I can't quite work out what value you should use for the attribute: When the idName attribute is present, the value attribute is used as the name of the property on the idName bean that will return the value of the radio tag for this iteration. http://struts.apache.org/userGuide/struts-html.html#radio -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
back button does not function?
I add a button to a page, hope it will go back to the menu page, but it fails. 1) The button text cannot obtain the value from MessageResources.properties. 2) When mouse goes up, the page forward does not work. How can they be resolved? Thanks JSP: td html:button property=backButton value=form.button.back.label onmouseup=backToUserProfile.do/ /td struts-config.xml: form-bean name=blankForm type=org.apache.struts.action.DynaActionForm/ action path=/backToUserProfile type=org.apache.struts.actions.ForwardAction name=blankForm scope=request validate=false parameter=userProfileMaintPath.do?groupId=USERPROFILEMAINT/ actionpath=/userProfileMaintPath type=com.common.misc.SetAttributeGroupId scope=request forward name=success path=user.userProfileMaint / /action Where com.common.misc.SetAttributeGroupId extends ForwardAction - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts Validator Framework
Hi, I'm reposting this mail with the hope that I can get response from someone. If anyone of you have any clue on the question mentioned below, kindly get back. Thanks, Ashutosh -Original Message- From: Ashutosh Satyam Sent: Thursday, August 25, 2005 11:28 PM To: Struts Users Mailing List Subject: RE: Struts Validator Framework Hi Hubert, Thanks for your response. It worked the way you told by using dot delimiters to point out the nested object. On the same lines, I have one more question. How do I validate an array of objects. This is my class strucutre. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Class X{ String a; Y b; } Class Y{ String i; String[] j; } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - I could reference the nested element 'i' in class Y by using b.i, but I couldn't validate j; I tried the following with the indexedListProperty construct: field property=b.j indexedListProperty=b.j depends=required ---failed field property=b.j indexedListProperty=j depends=required ---failed field property=j indexedListProperty=b.j depends=required ---failed but each time I got an exception: java.lang.NullPointerException at org.apache.commons.validator.Field.getIndexedProperty(Field.java:780) at org.apache.commons.validator.Field.validate(Field.java:875) at org.apache.commons.validator.Form.validate(Form.java:174) at org.apache.commons.validator.Validator.validate(Validator.java:367) Could you tell me where am I doing wrong. Regards, Ashutosh -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Thu 8/25/2005 1:36 AM To: Struts Users Mailing List Cc: Subject: Re: Struts Validator Framework I've never used Validator outside of Struts, but I do know I've successfully referenced nested elements while validating, by using dot notation. In your case, you can refer to fields a, b, obj.i, obj.j, obj.obj.k. Hubert On 8/24/05, Ashutosh Satyam [EMAIL PROTECTED] wrote: Hi, I am using the Struts Validator(Commons Validator) outside the Struts framework, to do validation. I would like to know how to validate an object when it has objects nested within it, and I need to validate the fields in those nested objects, too. Precisely I intend to achieve the following. A pseudo code of my requirement. I am passing object of class X to the validator., as shown below - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Class X{ String a; String b; Y obj; } Class Y{ String i; String j; Z obj; } Class Z{ String k; } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - I am trying to validate an object of class X, and I need to validate the enclosed object of Class Y, and the object of class Z further encapsulated in Y. Is it doable using the existing Validator framework. Is there a way to specify this kind of nested validation in the validation-rules.xml ( configuration file used by validator ) If yes can anyone give me a pointer on the same. Regards, Ashutosh - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re-use field validations?
Fyi, Struts 1.3 is moving to a Validator 1.2 dependency. This version includes support for the form extends attribute which provides just what you were asking for. Hubert On 8/26/05, Laurie Harper [EMAIL PROTECTED] wrote: Quinn Stone wrote: Is there any way to define the validation for a common form field once in validation.xml and re-use the validation in other form blocks? This would allow validation.xml to be updated in one place rather than many places, if validation requirements change for a field that is used on many forms. It would also help ensure that I (or others) won't accidentally incorrectly code different validations for the same field on different forms. The benefits will compound if I start writing custom validation routines. I am new to Struts, and this is my first project using it, so I hope I'm not missing something obvious. I guess what you're looking for is the ability to specify a list/set of validations (e.g. 'depends=required,mask') and associated parameters, messages, etc. once for a field and have that same configuration applied on different forms using that field, right? Unfortunately, as far as I know, validator doesn't provide any facility to accomplish that directly. However, I can think of one or two ways you could achieve it. The first would be using XML entities to setup and reference your re-used validations, something like: DOCTYPE ... [ !ENTITY field1 field name=loginid depends=required... ] ... form ... field1; ... /form (it may take some fiddling with syntax in the entity definition, and using external entities might be easier). The second would be to define custom validation rules that encapsulate the required composition and parameterization under a single name so that everywhere the field is used you'd specify 'depends=my-composite-validation'. If there are any better ways to do this, I'd be interested to hear about them too :-) L. -- Laurie Harper Open Source advocate, Java geek: http://www.holoweb.net/laurie Founder, Zotech Software: http://www.zotechsoftware.com/ - 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: Re-use field validations?
I should also add that you cannot use external XML entities in validator XML files for any released version of Struts. However, Struts 1.3, as of tonight, will include code, dependent on Validator 1.2, which will allow their use. Don On 8/29/05, Hubert Rabago [EMAIL PROTECTED] wrote: Fyi, Struts 1.3 is moving to a Validator 1.2 dependency. This version includes support for the form extends attribute which provides just what you were asking for. Hubert On 8/26/05, Laurie Harper [EMAIL PROTECTED] wrote: Quinn Stone wrote: Is there any way to define the validation for a common form field once in validation.xml and re-use the validation in other form blocks? This would allow validation.xml to be updated in one place rather than many places, if validation requirements change for a field that is used on many forms. It would also help ensure that I (or others) won't accidentally incorrectly code different validations for the same field on different forms. The benefits will compound if I start writing custom validation routines. I am new to Struts, and this is my first project using it, so I hope I'm not missing something obvious. I guess what you're looking for is the ability to specify a list/set of validations (e.g. 'depends=required,mask') and associated parameters, messages, etc. once for a field and have that same configuration applied on different forms using that field, right? Unfortunately, as far as I know, validator doesn't provide any facility to accomplish that directly. However, I can think of one or two ways you could achieve it. The first would be using XML entities to setup and reference your re-used validations, something like: DOCTYPE ... [ !ENTITY field1 field name=loginid depends=required... ] ... form ... field1; ... /form (it may take some fiddling with syntax in the entity definition, and using external entities might be easier). The second would be to define custom validation rules that encapsulate the required composition and parameterization under a single name so that everywhere the field is used you'd specify 'depends=my-composite-validation'. If there are any better ways to do this, I'd be interested to hear about them too :-) L. -- Laurie Harper Open Source advocate, Java geek: http://www.holoweb.net/laurie Founder, Zotech Software: http://www.zotechsoftware.com/ - 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]