RE: Action Form: HashMap
Try looking at the source of the generate page. See that all looks correct. I am also not sure if leading spaces between the name of the property name 'stringMapped' and the () chars are legal... -- Erez -Original Message- From: Zhu He [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2003 4:04 PM To: Struts Users Mailing List Subject: Re: Action Form: HashMap if you are using map backed actionForm, make sure getXXX() setXXX() where XXX matches the name of the map. In you case function names should be getMap() setMap() - Original Message - From: Ray Madigan [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, June 06, 2003 9:37 AM Subject: RE: Action Form: HashMap OK, I made the following changes, and it didn't do what I expected. HELP! I added to the ActionForm: /** * The form HashMap */ private HashMap map = new HashMap ( ); public Object getStringMapped ( String key ) { return map.get ( key ); } public void setStringMapped ( String key, String value ) { map.put ( key, value ); } I modified the jsp as: html:form action='Foo.do' c:forEach var='element' items='${elements}' html-el:text property='stringMapped ( ${element.element} )' value='${element.value}'/ /c:forEach ... /thml:form When I look at the form in my DispatchAction map is always empty. Any help would be appreciated! -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:13 AM To: [EMAIL PROTECTED] Subject: Re: Action Form: HashMap Read the mapped properties section here: http://jakarta.apache.org/struts/faqs/indexedprops.html David From: Ray Madigan [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Action Form: HashMap Date: Thu, 5 Jun 2003 11:00:12 -0700 I have a form that has elements that I do not know the names of ahead of time. I want to have struts scrape the form into a map so the key is the name of the element and the value is the value of the element when it was submitted. I looked for an action form that acted like this. Has anyone done it before, or is there a better way? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail - 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: Action Form: HashMap
I mean the HTML view source after the page has been generated. I am working with the Mapped Properties methods and it works fine so hang on there, it will work at the end... :) -- Erez -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2003 7:28 PM To: 'Struts Users Mailing List' Subject: RE: Action Form: HashMap Try looking at the source of the generate page. See that all looks correct. I am also not sure if leading spaces between the name of the property name 'stringMapped' and the () chars are legal... -- Erez -Original Message- From: Zhu He [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2003 4:04 PM To: Struts Users Mailing List Subject: Re: Action Form: HashMap if you are using map backed actionForm, make sure getXXX() setXXX() where XXX matches the name of the map. In you case function names should be getMap() setMap() - Original Message - From: Ray Madigan [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, June 06, 2003 9:37 AM Subject: RE: Action Form: HashMap OK, I made the following changes, and it didn't do what I expected. HELP! I added to the ActionForm: /** * The form HashMap */ private HashMap map = new HashMap ( ); public Object getStringMapped ( String key ) { return map.get ( key ); } public void setStringMapped ( String key, String value ) { map.put ( key, value ); } I modified the jsp as: html:form action='Foo.do' c:forEach var='element' items='${elements}' html-el:text property='stringMapped ( ${element.element} )' value='${element.value}'/ /c:forEach ... /thml:form When I look at the form in my DispatchAction map is always empty. Any help would be appreciated! -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:13 AM To: [EMAIL PROTECTED] Subject: Re: Action Form: HashMap Read the mapped properties section here: http://jakarta.apache.org/struts/faqs/indexedprops.html David From: Ray Madigan [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Action Form: HashMap Date: Thu, 5 Jun 2003 11:00:12 -0700 I have a form that has elements that I do not know the names of ahead of time. I want to have struts scrape the form into a map so the key is the name of the element and the value is the value of the element when it was submitted. I looked for an action form that acted like this. Has anyone done it before, or is there a better way? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail - 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]
How to refer to the name of the form within a html:form block?
Is there a way to refer or get the name of the form inside the html:form ? I am trying to do something like the following: html:form logic:iterate id=item name=??name-of-form?? Property=items ... /logic:iterate /html:form Thanks, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to refer to the name of the form within a html:form blo ck?
Thanks for the reply, but it doesn't work if I remove the 'name=myFormName' part. Should I be using the nested:iterate tag? Erez -Original Message- From: Sukhenko, Mikhail (Contr) [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 12:30 AM To: 'Struts Users Mailing List' Subject: RE: How to refer to the name of the form within a html:form blo ck? you don't need to, leave the name attribute out, the iterate tag will automatically associate name with the name of the form that it is inside. Hope this helps -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 27, 2003 5:44 PM To: 'Struts Users Mailing List' Subject: How to refer to the name of the form within a html:form block? Is there a way to refer or get the name of the form inside the html:form ? I am trying to do something like the following: html:form logic:iterate id=item name=??name-of-form?? Property=items ... /logic:iterate /html:form Thanks, Erez - 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 refer to the name of the form within a html:form blo ck?
Ok it's working when I am using the nested:iterate tag. -- Erez -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 1:38 AM To: 'Struts Users Mailing List' Subject: RE: How to refer to the name of the form within a html:form blo ck? Thanks for the reply, but it doesn't work if I remove the 'name=myFormName' part. Should I be using the nested:iterate tag? Erez -Original Message- From: Sukhenko, Mikhail (Contr) [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 12:30 AM To: 'Struts Users Mailing List' Subject: RE: How to refer to the name of the form within a html:form blo ck? you don't need to, leave the name attribute out, the iterate tag will automatically associate name with the name of the form that it is inside. Hope this helps -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 27, 2003 5:44 PM To: 'Struts Users Mailing List' Subject: How to refer to the name of the form within a html:form block? Is there a way to refer or get the name of the form inside the html:form ? I am trying to do something like the following: html:form logic:iterate id=item name=??name-of-form?? Property=items ... /logic:iterate /html:form Thanks, Erez - 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]
what is wrong here?
I keep getting errors on the following: (I am using 1.1 beta 3) bean:define id=col value='%= 6 / 4 + 1 %' / Can someone tell me what is wrong here? Thanks, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Action Form: HashMap
Well I am glad it works now... and all I can say is that SPACE problems are truly invisible sometimes :) -Original Message- From: Ray Madigan [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2003 6:49 PM To: Struts Users Mailing List Subject: RE: Action Form: HashMap I am using frames so i can't look at the source. I took out the spaces, and I looked at the DEBUG Log and there is a line from BeanUtils setProperty ( Form, stringMapped(bbb), [xxx] ) And it worked! Thanks for your help Ray Madigan -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2003 10:31 AM To: 'Struts Users Mailing List' Subject: RE: Action Form: HashMap I mean the HTML view source after the page has been generated. I am working with the Mapped Properties methods and it works fine so hang on there, it will work at the end... :) -- Erez -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2003 7:28 PM To: 'Struts Users Mailing List' Subject: RE: Action Form: HashMap Try looking at the source of the generate page. See that all looks correct. I am also not sure if leading spaces between the name of the property name 'stringMapped' and the () chars are legal... -- Erez -Original Message- From: Zhu He [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2003 4:04 PM To: Struts Users Mailing List Subject: Re: Action Form: HashMap if you are using map backed actionForm, make sure getXXX() setXXX() where XXX matches the name of the map. In you case function names should be getMap() setMap() - Original Message - From: Ray Madigan [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, June 06, 2003 9:37 AM Subject: RE: Action Form: HashMap OK, I made the following changes, and it didn't do what I expected. HELP! I added to the ActionForm: /** * The form HashMap */ private HashMap map = new HashMap ( ); public Object getStringMapped ( String key ) { return map.get ( key ); } public void setStringMapped ( String key, String value ) { map.put ( key, value ); } I modified the jsp as: html:form action='Foo.do' c:forEach var='element' items='${elements}' html-el:text property='stringMapped ( ${element.element} )' value='${element.value}'/ /c:forEach ... /thml:form When I look at the form in my DispatchAction map is always empty. Any help would be appreciated! -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:13 AM To: [EMAIL PROTECTED] Subject: Re: Action Form: HashMap Read the mapped properties section here: http://jakarta.apache.org/struts/faqs/indexedprops.html David From: Ray Madigan [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Action Form: HashMap Date: Thu, 5 Jun 2003 11:00:12 -0700 I have a form that has elements that I do not know the names of ahead of time. I want to have struts scrape the form into a map so the key is the name of the element and the value is the value of the element when it was submitted. I looked for an action form that acted like this. Has anyone done it before, or is there a better way? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JAAS Struts JBoss + Tomcat
Hi, I am trying to integrate the JAAS into my Struts application running on JBoss 3.0.7 + Tomcat. I am a newbie here, and I would appreciate your help on several questions: 1. From what I read here, I saw that I should probably use the FORM auth method, and that this page should not use any of the Struts tags. Is that right? 2. In my application, the first thing a user does is passing a registration wizard. How can I set different set of permissions using the web.xml to the registration wizard pages and to the rest of the application, where both are handled by the struts ActionServlet servlet? 3. Regarding more to JBoss + Tomcat, I don't understand what happens when a web client accesses a protected page. Does JBossSX which implements the authentication takes over and perform the authentication? After the authentication is done, does my Struts action can invoke EJB methods freely or should they authenticate as well? Thanks in advance, -- Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JAAS Struts JBoss + Tomcat
Thanks a lot Paul for the answers. -- Erez -Original Message- From: Paul Thomas [mailto:[EMAIL PROTECTED] Sent: Saturday, July 05, 2003 2:49 PM To: struts-user Subject: Re: JAAS Struts JBoss + Tomcat On 04/07/2003 16:16 Erez Efrati wrote: Hi, I am trying to integrate the JAAS into my Struts application running on JBoss 3.0.7 + Tomcat. I am a newbie here, and I would appreciate your help on several questions: 1. From what I read here, I saw that I should probably use the FORM auth method, and that this page should not use any of the Struts tags. Is that right? html:form might be a problem but bean:message works fine for me. 2. In my application, the first thing a user does is passing a registration wizard. How can I set different set of permissions using the web.xml to the registration wizard pages and to the rest of the application, where both are handled by the struts ActionServlet servlet? The ActionServlet doesn't really enter into it. You define constaints against urls. So you might have a url /register.do for your registration wizard and /showdetails.do to show some detail page. Each would have its own declared contraints in web.xml. I recommend reading the 2.3 servlet specs. 3. Regarding more to JBoss + Tomcat, I don't understand what happens when a web client accesses a protected page. Does JBossSX which implements the authentication takes over and perform the authentication? After the authentication is done, does my Struts action can invoke EJB methods freely or should they authenticate as well? I can't answer that I'm afraid. I would suggest you get a sample app working under Tomcat alone then try deploying it under JBoss. HTH -- Paul Thomas +--+ -+ | Thomas Micro Systems Limited | Software Solutions for the Smaller Business | | Computer Consultants | http://www.thomas-micro-systems-ltd.co.uk | +--+ -+ - 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]
Login Form
Hi, My question is a bit off Struts but still since I am using Struts and it's too urgent for me I thought to try my luck here, maybe someone had stumbled on this issue too. I am running JBoss/Tomcat/Struts using the JAAS for handling the application security aspects. I have used the auth-methodFORM/auth-method clauses inside the Web.xml file. In my web site I want to have the site home page to have also a small login form where the user could enter username and password and login to the site. The home page, contains other links as well, which lead to other parts of the site or even to external pages on other sites. From what I've read so far, it seems to me that the FORM method is activated only when the web user tries to access a protected page. Then the Web Server (Tomcat in my case) returns the loginPage stated in the Web.xml file, and only after the login is performed (j_security_check) the Tomcat then redirects the web user to the original portected page. Is it possible to have the site home page as the login page still using mechanisms of FORM and JAAS? If so I would really appreciate any help on how to do it, and what are the configurations required. Thanks, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Login Form
Yansheng Lin, I didn't understand, sorry. All I want to do is enable the users to login into my site from the starting page of the web site. Is it possible to post the a form action='j_security_check'? I mean before accessing a protected page which the Tomcat protects and sends me the my login page. I want to note here that I am using the JAAS. Thanks, Erez -Original Message- From: Yansheng Lin [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 5:47 PM To: 'Struts Users Mailing List' Subject: RE: Login Form Not sure if I understand it entirely. But you can use an iframe for the login form(protected page) on the site home page. Something like: iframe name='logon_frame' id='logon_frame' style='width:100%; height:120;' SCROLLING='no' src='https://localhost:8443/logon_iframe.jsp'/iframe Hope this helps. -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: July 8, 2003 10:11 AM To: 'Struts Users Mailing List' Subject: Login Form Hi, My question is a bit off Struts but still since I am using Struts and it's too urgent for me I thought to try my luck here, maybe someone had stumbled on this issue too. I am running JBoss/Tomcat/Struts using the JAAS for handling the application security aspects. I have used the auth-methodFORM/auth-method clauses inside the Web.xml file. In my web site I want to have the site home page to have also a small login form where the user could enter username and password and login to the site. The home page, contains other links as well, which lead to other parts of the site or even to external pages on other sites. From what I've read so far, it seems to me that the FORM method is activated only when the web user tries to access a protected page. Then the Web Server (Tomcat in my case) returns the loginPage stated in the Web.xml file, and only after the login is performed (j_security_check) the Tomcat then redirects the web user to the original portected page. Is it possible to have the site home page as the login page still using mechanisms of FORM and JAAS? If so I would really appreciate any help on how to do it, and what are the configurations required. Thanks, Erez - 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: Login Form
Thanks Sean, I looked at it and it does avoid the BIG limitation posed by the standard spec in fact. Still I cannot use it since it disables the passing of the principal identity through calls to EJB methods. Now, I am new to the web development and it amazes me that such a basic feature is missing from the Servlet spec and is not addressed. Why is it that way? Is it so unusual to want to have the login fields on the start page?? Thanks, Erez -Original Message- From: Sean Radford [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 8:21 PM To: Struts Users Mailing List Subject: RE: Login Form Have a look at this (you may find what you want): http://sourceforge.net/projects/securityfilter/ Sean -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: July 8, 2003 10:11 AM To: 'Struts Users Mailing List' Subject: Login Form Hi, My question is a bit off Struts but still since I am using Struts and it's too urgent for me I thought to try my luck here, maybe someone had stumbled on this issue too. I am running JBoss/Tomcat/Struts using the JAAS for handling the application security aspects. I have used the auth-methodFORM/auth-method clauses inside the Web.xml file. In my web site I want to have the site home page to have also a small login form where the user could enter username and password and login to the site. The home page, contains other links as well, which lead to other parts of the site or even to external pages on other sites. From what I've read so far, it seems to me that the FORM method is activated only when the web user tries to access a protected page. Then the Web Server (Tomcat in my case) returns the loginPage stated in the Web.xml file, and only after the login is performed (j_security_check) the Tomcat then redirects the web user to the original portected page. Is it possible to have the site home page as the login page still using mechanisms of FORM and JAAS? If so I would really appreciate any help on how to do it, and what are the configurations required. Thanks, Erez - 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] -- Dr. Sean Radford, MBBS, MSc [EMAIL PROTECTED] http://bladesys.demon.co.uk/ Blade Systems - 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: Login Form
Sean, many thanks for keeping up with my questions - appreciate it. And yes you are correct. I am using JBoss 3.0.7 / Tomcat 4.1.24. By the way have you got any idea if this issue is about to be resolved at the Servlet Container Spec ? Thanks, Erez -Original Message- From: Sean Radford [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 11:19 AM To: Struts Users Mailing List Subject: RE: Login Form On Tue, 2003-07-08 at 20:34, Erez Efrati wrote: Thanks Sean, I looked at it and it does avoid the BIG limitation posed by the standard spec in fact. Still I cannot use it since it disables the passing of the principal identity through calls to EJB methods. That's what it says in the introductory documentation, but... You're using JBoss/Tomcat right? Well give me a day and I'll email you a class that should do all you want... It's a RealmAdaptor for securityfilter/Jboss that uses the JBoss security extension and so correctly instantiates the Principal for the EJB layer. It works for me with JBoss4/Jetty, so you should give it a try. (I'm waiting on some code from another guy whose done similar and so just want to compare - if his stuff doesn't arrive shortly, I'll send mine as it) Now, I am new to the web development and it amazes me that such a basic feature is missing from the Servlet spec and is not addressed. Why is it that way? Is it so unusual to want to have the login fields on the start page?? Not unusual at all... And many Java sites have it that way, but they don't necessarily use container authentication and they probably don't use EJB's (many people steer clear - deep seated reservations from 1.0 are still abound). If I get time I'm going to try and get the Jetty guys to 'surface' their web Authenticators to allow developers to roll their own... I've looked at the code and shouldn't be too difficult - one or two areas I'm not sure about, but... Thanks, Erez -Original Message- From: Sean Radford [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 8:21 PM To: Struts Users Mailing List Subject: RE: Login Form Have a look at this (you may find what you want): http://sourceforge.net/projects/securityfilter/ Sean -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: July 8, 2003 10:11 AM To: 'Struts Users Mailing List' Subject: Login Form Hi, My question is a bit off Struts but still since I am using Struts and it's too urgent for me I thought to try my luck here, maybe someone had stumbled on this issue too. I am running JBoss/Tomcat/Struts using the JAAS for handling the application security aspects. I have used the auth-methodFORM/auth-method clauses inside the Web.xml file. In my web site I want to have the site home page to have also a small login form where the user could enter username and password and login to the site. The home page, contains other links as well, which lead to other parts of the site or even to external pages on other sites. From what I've read so far, it seems to me that the FORM method is activated only when the web user tries to access a protected page. Then the Web Server (Tomcat in my case) returns the loginPage stated in the Web.xml file, and only after the login is performed (j_security_check) the Tomcat then redirects the web user to the original portected page. Is it possible to have the site home page as the login page still using mechanisms of FORM and JAAS? If so I would really appreciate any help on how to do it, and what are the configurations required. Thanks, Erez - 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] -- Dr. Sean Radford, MBBS, MSc [EMAIL PROTECTED] http://bladesys.demon.co.uk/ Blade Systems - 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: Login Form
Sean, Thanks for the code. I have downloaded everything and I am about to start playing with it. But from reading still, I am a bit confused here. Is this code + SecurityFilter replaces the container security configuration of JBoss/Tomcat in ejb-jar.xml, web.xml, jboss.xml, jboss-web.xml ? Thanks, Erez -Original Message- From: Sean Radford [mailto:[EMAIL PROTECTED] Sent: Thursday, July 10, 2003 11:26 AM To: Struts Users Mailing List Subject: RE: Login Form All, Please find attached my securityfilter realm adaptor. The other code I was waiting for hasn't materialised, so I couldn't do any comparison - but it seems to work for me... Good luck, and any probs just shout. And nope, I have know idea if the extra functionality is to be resolved in the near future within an updated container specification. Any one know how we could 'force' the issue? Regards, Sean -- Dr. Sean Radford, MBBS, MSc [EMAIL PROTECTED] http://bladesys.demon.co.uk/ Blade Systems On Wed, 2003-07-09 at 15:33, Erez Efrati wrote: Sean, many thanks for keeping up with my questions - appreciate it. And yes you are correct. I am using JBoss 3.0.7 / Tomcat 4.1.24. By the way have you got any idea if this issue is about to be resolved at the Servlet Container Spec ? Thanks, Erez -Original Message- From: Sean Radford [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 11:19 AM To: Struts Users Mailing List Subject: RE: Login Form On Tue, 2003-07-08 at 20:34, Erez Efrati wrote: Thanks Sean, I looked at it and it does avoid the BIG limitation posed by the standard spec in fact. Still I cannot use it since it disables the passing of the principal identity through calls to EJB methods. That's what it says in the introductory documentation, but... You're using JBoss/Tomcat right? Well give me a day and I'll email you a class that should do all you want... It's a RealmAdaptor for securityfilter/Jboss that uses the JBoss security extension and so correctly instantiates the Principal for the EJB layer. It works for me with JBoss4/Jetty, so you should give it a try. (I'm waiting on some code from another guy whose done similar and so just want to compare - if his stuff doesn't arrive shortly, I'll send mine as it) Now, I am new to the web development and it amazes me that such a basic feature is missing from the Servlet spec and is not addressed. Why is it that way? Is it so unusual to want to have the login fields on the start page?? Not unusual at all... And many Java sites have it that way, but they don't necessarily use container authentication and they probably don't use EJB's (many people steer clear - deep seated reservations from 1.0 are still abound). If I get time I'm going to try and get the Jetty guys to 'surface' their web Authenticators to allow developers to roll their own... I've looked at the code and shouldn't be too difficult - one or two areas I'm not sure about, but... Thanks, Erez -Original Message- From: Sean Radford [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 8:21 PM To: Struts Users Mailing List Subject: RE: Login Form Have a look at this (you may find what you want): http://sourceforge.net/projects/securityfilter/ Sean -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: July 8, 2003 10:11 AM To: 'Struts Users Mailing List' Subject: Login Form Hi, My question is a bit off Struts but still since I am using Struts and it's too urgent for me I thought to try my luck here, maybe someone had stumbled on this issue too. I am running JBoss/Tomcat/Struts using the JAAS for handling the application security aspects. I have used the auth-methodFORM/auth-method clauses inside the Web.xml file. In my web site I want to have the site home page to have also a small login form where the user could enter username and password and login to the site. The home page, contains other links as well, which lead to other parts of the site or even to external pages on other sites. From what I've read so far, it seems to me that the FORM method is activated only when the web user tries to access a protected page. Then the Web Server (Tomcat in my case) returns the loginPage stated in the Web.xml file, and only after the login is performed (j_security_check) the Tomcat then redirects the web user to the original portected page. Is it possible to have the site home page as the login page still using mechanisms of FORM and JAAS? If so I would really appreciate any help on how to do it, and what are the configurations required. Thanks, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
RE: Login Form
Thanks a lot Sean, I will try it and let you know how it works. Thanks for your great help, Erez -Original Message- From: Sean Radford [mailto:[EMAIL PROTECTED] Sent: Thursday, July 10, 2003 12:28 PM To: Struts Users Mailing List Subject: RE: Login Form Erez, Things you need to do: 1. Get your EJB's installed and working with your JAAS plugin (or one of the supplied JBoss ones). So standard J2EE settings in ejb-jar.xml, and a standard jboss.xml (your security-domain in particular). 2. Create your web app as per the security filter instructions. That means moving the security defintions that are normally in web.xml to the securityfilter-config.xml file, and defining the Filter in web.xml. And in jboss-web.xml you need to define the security-domain. Then you just need to specify 'my' class as the realm in the securityfilter-config.xml: realm className=com.aegeus.securityfilter.JBossRealmAdapter/realm Hope that helps, Sean -- Dr. Sean Radford, MBBS, MSc [EMAIL PROTECTED] http://bladesys.demon.co.uk/ Blade Systems On Thu, 2003-07-10 at 12:01, Erez Efrati wrote: Sean, Thanks for the code. I have downloaded everything and I am about to start playing with it. But from reading still, I am a bit confused here. Is this code + SecurityFilter replaces the container security configuration of JBoss/Tomcat in ejb-jar.xml, web.xml, jboss.xml, jboss-web.xml ? Thanks, Erez -Original Message- From: Sean Radford [mailto:[EMAIL PROTECTED] Sent: Thursday, July 10, 2003 11:26 AM To: Struts Users Mailing List Subject: RE: Login Form All, Please find attached my securityfilter realm adaptor. The other code I was waiting for hasn't materialised, so I couldn't do any comparison - but it seems to work for me... Good luck, and any probs just shout. And nope, I have know idea if the extra functionality is to be resolved in the near future within an updated container specification. Any one know how we could 'force' the issue? Regards, Sean - 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: Login Form
Sean, I have tried out the SecurityFilter web examples and they are working just fine. I have started to integrate it into my project, but I am getting compilation errors on the JBossRealmAdapter.java. It can't seem to find AuthenticationManager, RealmManager, SubjectSecurityManager. Just for some background info: I am using JBuilder 8.0EE and I am using the JBoss 3.0.7 , Does that have anything to do with the compilation errors? Do I need a later version of JBoss? Thanks, Erez -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: Thursday, July 10, 2003 4:44 PM To: 'Struts Users Mailing List' Subject: RE: Login Form Thanks a lot Sean, I will try it and let you know how it works. Thanks for your great help, Erez -Original Message- From: Sean Radford [mailto:[EMAIL PROTECTED] Sent: Thursday, July 10, 2003 12:28 PM To: Struts Users Mailing List Subject: RE: Login Form Erez, Things you need to do: 1. Get your EJB's installed and working with your JAAS plugin (or one of the supplied JBoss ones). So standard J2EE settings in ejb-jar.xml, and a standard jboss.xml (your security-domain in particular). 2. Create your web app as per the security filter instructions. That means moving the security defintions that are normally in web.xml to the securityfilter-config.xml file, and defining the Filter in web.xml. And in jboss-web.xml you need to define the security-domain. Then you just need to specify 'my' class as the realm in the securityfilter-config.xml: realm className=com.aegeus.securityfilter.JBossRealmAdapter/realm Hope that helps, Sean -- Dr. Sean Radford, MBBS, MSc [EMAIL PROTECTED] http://bladesys.demon.co.uk/ Blade Systems On Thu, 2003-07-10 at 12:01, Erez Efrati wrote: Sean, Thanks for the code. I have downloaded everything and I am about to start playing with it. But from reading still, I am a bit confused here. Is this code + SecurityFilter replaces the container security configuration of JBoss/Tomcat in ejb-jar.xml, web.xml, jboss.xml, jboss-web.xml ? Thanks, Erez -Original Message- From: Sean Radford [mailto:[EMAIL PROTECTED] Sent: Thursday, July 10, 2003 11:26 AM To: Struts Users Mailing List Subject: RE: Login Form All, Please find attached my securityfilter realm adaptor. The other code I was waiting for hasn't materialised, so I couldn't do any comparison - but it seems to work for me... Good luck, and any probs just shout. And nope, I have know idea if the extra functionality is to be resolved in the near future within an updated container specification. Any one know how we could 'force' the issue? Regards, Sean - 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: Login Form
,org.apache.struts.validator.FieldChecks 21:20:11,732 INFO [ValidatorResources] Add ValidatorAction: minlength,org.apache.struts.validator.FieldChecks 21:20:11,742 INFO [ValidatorResources] Add ValidatorAction: maxlength,org.apache.struts.validator.FieldChecks 21:20:11,782 INFO [ValidatorResources] Add ValidatorAction: mask,org.apache.struts.validator.FieldChecks 21:20:11,852 INFO [ValidatorResources] Add ValidatorAction: byte,org.apache.struts.validator.FieldChecks 21:20:11,862 INFO [ValidatorResources] Add ValidatorAction: short,org.apache.struts.validator.FieldChecks 21:20:11,882 INFO [ValidatorResources] Add ValidatorAction: integer,org.apache.struts.validator.FieldChecks 21:20:11,902 INFO [ValidatorResources] Add ValidatorAction: long,org.apache.struts.validator.FieldChecks 21:20:11,942 INFO [ValidatorResources] Add ValidatorAction: float,org.apache.struts.validator.FieldChecks 21:20:11,952 INFO [ValidatorResources] Add ValidatorAction: double,org.apache.struts.validator.FieldChecks 21:20:11,972 INFO [ValidatorResources] Add ValidatorAction: date,org.apache.struts.validator.FieldChecks 21:20:11,982 INFO [ValidatorResources] Add ValidatorAction: range,org.apache.struts.validator.FieldChecks 21:20:11,992 INFO [ValidatorResources] Add ValidatorAction: intRange,org.apache.struts.validator.FieldChecks 21:20:11,992 INFO [ValidatorResources] Add ValidatorAction: floatRange,org.apache.struts.validator.FieldChecks 21:20:12,002 INFO [ValidatorResources] Add ValidatorAction: creditCard,org.apache.struts.validator.FieldChecks 21:20:12,042 INFO [ValidatorResources] Add ValidatorAction: email,org.apache.struts.validator.FieldChecks 21:20:12,052 INFO [ValidatorPlugIn] Loading validation rules file from '/WEB-INF/validation.xml' -Original Message- From: Sean Radford [mailto:[EMAIL PROTECTED] Sent: Thursday, July 10, 2003 6:27 PM To: Struts Users Mailing List Subject: RE: Login Form Just need to include the relevant JBoss jar(s) on your classpath in JBuilder... For JBoss 4 it is simply jboss.jar (found in JBOSS_HOME/server/CONFIG/lib) :-) Sean -- Dr. Sean Radford, MBBS, MSc [EMAIL PROTECTED] http://bladesys.demon.co.uk/ Blade Systems On Thu, 2003-07-10 at 17:59, Erez Efrati wrote: Sean, I have tried out the SecurityFilter web examples and they are working just fine. I have started to integrate it into my project, but I am getting compilation errors on the JBossRealmAdapter.java. It can't seem to find AuthenticationManager, RealmManager, SubjectSecurityManager. Just for some background info: I am using JBuilder 8.0EE and I am using the JBoss 3.0.7 , Does that have anything to do with the compilation errors? Do I need a later version of JBoss? Thanks, Erez -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: Thursday, July 10, 2003 4:44 PM To: 'Struts Users Mailing List' Subject: RE: Login Form Thanks a lot Sean, I will try it and let you know how it works. Thanks for your great help, Erez -Original Message- From: Sean Radford [mailto:[EMAIL PROTECTED] Sent: Thursday, July 10, 2003 12:28 PM To: Struts Users Mailing List Subject: RE: Login Form Erez, Things you need to do: 1. Get your EJB's installed and working with your JAAS plugin (or one of the supplied JBoss ones). So standard J2EE settings in ejb-jar.xml, and a standard jboss.xml (your security-domain in particular). 2. Create your web app as per the security filter instructions. That means moving the security defintions that are normally in web.xml to the securityfilter-config.xml file, and defining the Filter in web.xml. And in jboss-web.xml you need to define the security-domain. Then you just need to specify 'my' class as the realm in the securityfilter-config.xml: realm className=com.aegeus.securityfilter.JBossRealmAdapter/realm Hope that helps, Sean - 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]
action forward to real jsps under Tiles
I am new to Tiles: 1) What are the downsides over writing your own? 2) While using the Tiles+Struts, is it possible to put forward an action to a real JSP file rather than a Tiles definition? Would it (Tiles request processor) know the difference? Thanks, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: module / tiles problems
Just by looking and I am new to tiles... That the set-property property=moduleAware value=false / The VALUE should be set to TRUE not false. Hope it helps, Erez -Original Message- From: Nathan Coast [mailto:[EMAIL PROTECTED] Sent: Sunday, July 13, 2003 2:12 PM To: struts-user Subject: module / tiles problems Hi, I tried setting up a web application with configuration files. init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml,/WEB-INF/struts-config-logweb.xm l/param-value /init-param both referred to their own tiles-defs files with tiles plugins plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-config value=/WEB-INF/tiles-defs.xml / set-property property=definitions-parser-validate value=true / set-property property=moduleAware value=false / /plug-in and plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-config value=/WEB-INF/tiles-defs-logweb.xml / set-property property=definitions-parser-validate value=true / set-property property=moduleAware value=false / /plug-in the tiles-defs were only loaded for the file listed in the first config file (struts-config.xml) Am I doing something wrong? thanks Nathan - 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]
Tiles:getAsString tag
Is there a way to give tiles:getAsString a key instead of a literal string ? Just like bean:message key=welcome it will use the key to retrieve the string from the message resources. If not, how hard is it to make it work? Thanks, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tiles:getAsString tag
You're absolutely correct, I forgot all about it, Thanks, Erez -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Monday, July 14, 2003 6:43 PM To: Struts Users Mailing List Subject: Re: Tiles:getAsString tag why not tiles:useAttribute followed by a bean:message name= sandeep --- Erez Efrati [EMAIL PROTECTED] wrote: Is there a way to give tiles:getAsString a key instead of a literal string ? Just like bean:message key=welcome it will use the key to retrieve the string from the message resources. If not, how hard is it to make it work? Thanks, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.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]
Tiles and %@ taglib
In tiles, where should I be best putting the %@ taglib uri=required lib %? Each tile jsp with its own tags or put them all in the layout JSP I use? Thanks, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tiles and %@ taglib
I want to make sure I got you right. So, you mean you put in each JSP tile its required [EMAIL PROTECTED] taglibs? Erez -Original Message- From: Chen, Gin [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 15, 2003 7:01 PM To: 'Struts Users Mailing List' Subject: RE: Tiles and %@ taglib That's a matter of preference and application server capabilities. I prefer to keep them all in the same layout.jsp but I'm using jboss-3.2.0 with jetty and it doesn't support it that way. From what I know, only JRun currently supports that option. (Correct me if I'm wrong someone). Once you find an application server that supports both styles, however, it really becomes a matter of preference. -Tim -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 15, 2003 1:56 PM To: 'Struts Users Mailing List' Subject: Tiles and %@ taglib In tiles, where should I be best putting the %@ taglib uri=required lib %? Each tile jsp with its own tags or put them all in the layout JSP I use? Thanks, Erez - 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]
html:html dir attribute
My project is based on struts, and I use the 'dir' attribute in the html dir=rtl tag. Why doesn't the struts html:html support the 'dir' attribute? And more important is how can I combine the html:html locale=true with the 'dir' attribute? Currently I had to use the non-struts html tag. Thanks, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
actions best practice question
I have a login page with a link with forgot password? for users to retrieve the passwords to their email account in case they forgot it. It's pretty trivial but still using struts what is the best practice? Should the link inside the login page point to the ForgotPassword.jsp or to a ForgotPassword.do action? Currently I used a ForgotPassword.do, and in the action I check if there's an 'action' parameter with the value of 'send'. If the 'action' parameter does not exist then I locally forward to the ForgotPassword.jsp using struts-config.xml local forwards configuration. If it does exist and equals to 'send' then I perform the actual operation of going to the EJB layer and do what is necessary to do. Is this the way to do it, or am I missing the point here? Any comment would be greatly appreciated here, Thanks, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: actions best practice question
Nico, I agree with that, and that is basically how I did. But I was wondering for the first time the action is called, basically just for displaying the page letting the user type in the fields values and click submit, what action do you use, if any? Cause, it's only the next time the action is called that the action is going to do real action. Erez -Original Message- From: Nicolas De Loof [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 2:24 PM To: Struts Users Mailing List Subject: Re: actions best practice question According to MVC pattern ,alway link to action, not to JSP. This way you controler always knows what the user is doing, and you can add some logic if needed. Using a request parameter to addapt action behaviour is a common Struts use (take a look at DispatchAction). Nico. I have a login page with a link with forgot password? for users to retrieve the passwords to their email account in case they forgot it. It's pretty trivial but still using struts what is the best practice? Should the link inside the login page point to the ForgotPassword.jsp or to a ForgotPassword.do action? Currently I used a ForgotPassword.do, and in the action I check if there's an 'action' parameter with the value of 'send'. If the 'action' parameter does not exist then I locally forward to the ForgotPassword.jsp using struts-config.xml local forwards configuration. If it does exist and equals to 'send' then I perform the actual operation of going to the EJB layer and do what is necessary to do. Is this the way to do it, or am I missing the point here? Any comment would be greatly appreciated here, Thanks, Erez - 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: actions best practice question
Nico, thanks a lot for the prompt answers. Do you use for that the org.apache.struts.actions.ForwardAction ? Erez -Original Message- From: Nicolas De Loof [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 2:48 PM To: Struts Users Mailing List Subject: Re: actions best practice question I use to set a specialized action-mapping for such init request, that is a simple forward (no Action class needed) /newUser/init.do = forward to newUser.jsp /newUser/register.do = RegiterUserAction = welcome.jsp^ if needed, forward to newUser.jsp can be easily changed by a full Action class (to init a form-bean with some default values for example) Nico. Nico, I agree with that, and that is basically how I did. But I was wondering for the first time the action is called, basically just for displaying the page letting the user type in the fields values and click submit, what action do you use, if any? Cause, it's only the next time the action is called that the action is going to do real action. Erez -Original Message- From: Nicolas De Loof [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 2:24 PM To: Struts Users Mailing List Subject: Re: actions best practice question According to MVC pattern ,alway link to action, not to JSP. This way you controler always knows what the user is doing, and you can add some logic if needed. Using a request parameter to addapt action behaviour is a common Struts use (take a look at DispatchAction). Nico. I have a login page with a link with forgot password? for users to retrieve the passwords to their email account in case they forgot it. It's pretty trivial but still using struts what is the best practice? Should the link inside the login page point to the ForgotPassword.jsp or to a ForgotPassword.do action? Currently I used a ForgotPassword.do, and in the action I check if there's an 'action' parameter with the value of 'send'. If the 'action' parameter does not exist then I locally forward to the ForgotPassword.jsp using struts-config.xml local forwards configuration. If it does exist and equals to 'send' then I perform the actual operation of going to the EJB layer and do what is necessary to do. Is this the way to do it, or am I missing the point here? Any comment would be greatly appreciated here, Thanks, Erez - 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: actions best practice question
Thanks again Nico. -Original Message- From: Nicolas De Loof [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 3:06 PM To: Struts Users Mailing List Subject: Re: actions best practice question I use a Forward action-mapping : action path=/newUser/init forward=/newUser.jsp / You can use ForwardAction instead : action path=/newUser/init type=org.apache.struts.actions.ForwardAction parameter=/newUser.jsp/ I think ForwardAction is prefered when you want this request to use a formbean and have validation. Nico. Nico, thanks a lot for the prompt answers. Do you use for that the org.apache.struts.actions.ForwardAction ? Erez -Original Message- From: Nicolas De Loof [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 2:48 PM To: Struts Users Mailing List Subject: Re: actions best practice question I use to set a specialized action-mapping for such init request, that is a simple forward (no Action class needed) /newUser/init.do = forward to newUser.jsp /newUser/register.do = RegiterUserAction = welcome.jsp^ if needed, forward to newUser.jsp can be easily changed by a full Action class (to init a form-bean with some default values for example) Nico. Nico, I agree with that, and that is basically how I did. But I was wondering for the first time the action is called, basically just for displaying the page letting the user type in the fields values and click submit, what action do you use, if any? Cause, it's only the next time the action is called that the action is going to do real action. Erez -Original Message- From: Nicolas De Loof [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 2:24 PM To: Struts Users Mailing List Subject: Re: actions best practice question According to MVC pattern ,alway link to action, not to JSP. This way you controler always knows what the user is doing, and you can add some logic if needed. Using a request parameter to addapt action behaviour is a common Struts use (take a look at DispatchAction). Nico. I have a login page with a link with forgot password? for users to retrieve the passwords to their email account in case they forgot it. It's pretty trivial but still using struts what is the best practice? Should the link inside the login page point to the ForgotPassword.jsp or to a ForgotPassword.do action? Currently I used a ForgotPassword.do, and in the action I check if there's an 'action' parameter with the value of 'send'. If the 'action' parameter does not exist then I locally forward to the ForgotPassword.jsp using struts-config.xml local forwards configuration. If it does exist and equals to 'send' then I perform the actual operation of going to the EJB layer and do what is necessary to do. Is this the way to do it, or am I missing the point here? Any comment would be greatly appreciated here, Thanks, Erez - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
action mapping 'input' question
I guess it's simple, but why can't I put an action /MyAction.do in the 'input' field in a action-mapping in the struts-config.xml? Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: action mapping 'input' question
I am using struts/tiles/validator in my application. Using the following configuration works fine, still I see that on the first invocation the form gets validated and I get validation errors. My ForgotPasswordAction action is used both for the INIT and the SUBMIT operations. The only solution I read about is putting 'validate'=false and control the invocation of the super.validate() in my code. Is this true? action name=ForgotPasswordForm type=web.ForgotPasswordAction validate=true input=.forgotPassword scope=request path=/ForgotPassword forward name=show path=.forgotPassword redirect=false / /action If I use the following: action name=ForgotPasswordForm type=web.ForgotPasswordAction validate=true input=/ForgotPassword.do scope=request path=/ForgotPassword forward name=show path=.forgotPassword redirect=false / /action Then I get the following error: (now it's endless... really so sorry :) javax.servlet.ServletException: Servlet execution threw an exception at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:193) at org.securityfilter.filter.SecurityFilter.doFilter(SecurityFilter.java:19 9) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.ja va:246) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:241 5) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa lve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:59 4) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC onnection(Http11Protocol.java:392) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:56 5) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool .java:619) at java.lang.Thread.run(Thread.java:536) root cause java.lang.StackOverflowError at org.apache.catalina.core.ApplicationHttpRequest.setAttribute(Application HttpRequest.java:247) at org.apache.catalina.core.ApplicationHttpRequest.setAttribute(Application HttpRequest.java:250) at org.apache.catalina.core.ApplicationHttpRequest.setAttribute(Application HttpRequest.java:250) at
RE: JBoss configuration problem with struts
If you just put more information and specify more about what and how did you do. Just for of it, I am working with JBoss and Struts and it all works just fine under the JBoss default. Erez -Original Message- From: Younis, Shahzaib [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 10:45 PM To: 'Struts Users Mailing List' Subject: JBoss configuration problem with struts After I put my war file into JBOSS all direcotry, it works, but before that it was in default directory and it was not extracting prompts from properties file. Any idea wats the difference between JBOSS sub directory defualt and all According to JBoss documentation, the only difference, that all directory configuration includes services of RMI/IIOP and clustering. but that should not affect the extraction of prompts from Properties file. Any help will be appreciated, Thanks. - 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: JBoss configuration problem with struts
What version of JBoss? I personally deploy an EAR file instead of just WAR. I heard something about a problem with WAR deployment a long time ago, but I am not sure if that is still the case. I would advise you to check with the Forums on the JBoss.org site - I find them very efficient and helpful. Erez -Original Message- From: Younis, Shahzaib [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 10:59 PM To: 'Struts Users Mailing List' Subject: RE: JBoss configuration problem with struts Oops! validation.xml code is this one: field property=username depends=required arg0 key=prompt.username resource=true / /field and in the case of validation failure,on the xml end, I get error ???en_US.prompt.username??? is required, instead of User Name is required ApplicationResources.properties snapshot is this: prompt.username = User Name Now the war file is working fine in all directory, but not in default directory, it seems like its not extracting prompts from properties file. -Original Message- From: Younis, Shahzaib [SMTP:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 3:55 PM To: 'Struts Users Mailing List' Subject: RE: JBoss configuration problem with struts Ok here's what I'm trying to do. validation.xml: field property=username depends=required arg0 key=logon.username.error resource=true / /field and in the case of validation failure,on the xml end, I get error ???en_US.prompt.username??? is required, instead of User Name is required ApplicationResources.properties snapshot is this: prompt.username = User Name Now the war file is working fine in all directory, but not in default directory, it seems like its not extracting prompts from properties file. -Original Message- From: Erez Efrati [SMTP:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 4:48 PM To: 'Struts Users Mailing List' Subject:RE: JBoss configuration problem with struts If you just put more information and specify more about what and how did you do. Just for of it, I am working with JBoss and Struts and it all works just fine under the JBoss default. Erez -Original Message- From: Younis, Shahzaib [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 10:45 PM To: 'Struts Users Mailing List' Subject: JBoss configuration problem with struts After I put my war file into JBOSS all direcotry, it works, but before that it was in default directory and it was not extracting prompts from properties file. Any idea wats the difference between JBOSS sub directory defualt and all According to JBoss documentation, the only difference, that all directory configuration includes services of RMI/IIOP and clustering. but that should not affect the extraction of prompts from Properties file. Any help will be appreciated, Thanks. - 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]
Birthdate validation ?
I have a birth date field composed of three different fields of day month and a year. Now, what is the best way to receive those three and combine them into a java.sql.Date class and performing validation using the validator? Hope someone been there done that.. Thanks, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Birthdate validation ?
Thanks for the quick reply, seems pretty easy but a bit long for just a date. Anyway, is there a validator I could use or do I have to write one of my own? And I mean Struts Validator.. Erez -Original Message- From: Alex Shneyderman [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 23, 2003 8:21 PM To: 'Struts Users Mailing List' Subject: RE: Birthdate validation ? Be carefull with that because if you set Feb 29, 2003 your date is going to be March 1, 2003 and Calendar will not say a thing. You should probably fix a birthdate validator. -Original Message- From: Adam Levine [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 23, 2003 2:18 PM To: [EMAIL PROTECTED] Subject: Re: Birthdate validation ? Use Calendar, more than likely the concrete GregorianCalendar. Calendar.setField(field, field value); x3 Calendar.getTime() - Date From: Erez Efrati [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: Birthdate validation ? Date: Wed, 23 Jul 2003 21:03:53 +0200 I have a birth date field composed of three different fields of day month and a year. Now, what is the best way to receive those three and combine them into a java.sql.Date class and performing validation using the validator? Hope someone been there done that.. Thanks, Erez - 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] - 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: Birthdate validation ?
Since I am not an HTML wizard (yet :) ) my first attempt was as follows: What also bugs me is the scriplet iteration using actual java code - any idea how to do it more elegant? !-- birthdate -- tr tdbean:message key=userInfo.birthDate//td td !-- birth year -- html:select property=property(profile-birthYear) html:option value=yearbean:message key=date.year//html:option % for (int i = 17; i 90; i++) { % html:option value=%=Integer.toString(2003-i)% %=2003-i%/html:option % } % /html:select !-- birth month -- html:select property=property(profile-birthMonth) html:option value=monthbean:message key=date.month//html:option % for (int k = 1; k = 12; k++) { % html:option value=%=Integer.toString(k)% %=k%/html:option % } % /html:select !-- birth day -- html:select property=property(profile-birthDay) html:option value=daybean:message key=date.day//html:option % for (int i = 1; i = 31; i++) { % html:option value=%=Integer.toString(i)% %=i%/html:option % } % /html:select /td /tr Erez -Original Message- From: Alex Shneyderman [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 23, 2003 8:30 PM To: 'Struts Users Mailing List' Subject: RE: Birthdate validation ? There is a date validator. I am not sure why a birthdate is any different? How do you present your field to the user is it a one input text? -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 23, 2003 3:25 PM To: 'Struts Users Mailing List'; [EMAIL PROTECTED] Subject: RE: Birthdate validation ? Thanks for the quick reply, seems pretty easy but a bit long for just a date. Anyway, is there a validator I could use or do I have to write one of my own? And I mean Struts Validator.. Erez -Original Message- From: Alex Shneyderman [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 23, 2003 8:21 PM To: 'Struts Users Mailing List' Subject: RE: Birthdate validation ? Be carefull with that because if you set Feb 29, 2003 your date is going to be March 1, 2003 and Calendar will not say a thing. You should probably fix a birthdate validator. -Original Message- From: Adam Levine [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 23, 2003 2:18 PM To: [EMAIL PROTECTED] Subject: Re: Birthdate validation ? Use Calendar, more than likely the concrete GregorianCalendar. Calendar.setField(field, field value); x3 Calendar.getTime() - Date From: Erez Efrati [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: Birthdate validation ? Date: Wed, 23 Jul 2003 21:03:53 +0200 I have a birth date field composed of three different fields of day month and a year. Now, what is the best way to receive those three and combine them into a java.sql.Date class and performing validation using the validator? Hope someone been there done that.. Thanks, Erez - 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] - 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]
Simple Tiles question
A simple question I guess, Is it legal to have the tags like html /html and others in a tile. Meaning, when converting a page to a tile, do I have to remove those html:html header etc. tags? Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Simple Tiles question
It's strange since until now I haven't removed those tags and it just went fine...strange no? -Original Message- From: Mike Jasnowski [mailto:[EMAIL PROTECTED] Sent: Thursday, July 24, 2003 8:52 PM To: Struts Users Mailing List Subject: RE: Simple Tiles question It depends on how the tile is used. If the tile is a standalone page no, but if it's intended to be a fragment of a page, then you'd want to remove those to remove the possbility of having a malformed page. -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: Thursday, July 24, 2003 3:51 PM To: 'Struts Users Mailing List' Subject: Simple Tiles question A simple question I guess, Is it legal to have the tags like html /html and others in a tile. Meaning, when converting a page to a tile, do I have to remove those html:html header etc. tags? Erez - 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: Simple Tiles question
Thank you all for the fast reply. I am trying to use all the struts tags instead of plain HTML tags, but still I am forced to use the plain HTML html tag due to the fact that I make use of the 'dir' attribute. for example html dir=rtl and till now I haven't seen support for that attribute on the html:html Struts tag, or am I wrong? I wish... Erez -Original Message- From: Hue Holleran [mailto:[EMAIL PROTECTED] Sent: Thursday, July 24, 2003 8:59 PM To: Struts Users Mailing List Subject: RE: Simple Tiles question Erez, Tiles are included in the HTML page like any other 'fragment' - the resultant HTML needs to be properly formed. If the outermost tile or page already has html etc. then the included tiles should not have this - so yes - you need to remove this. For simplicity my tiles are normally self-contained tables, i.e. tabletrtd.../td/tr/table but sometimes are just self-contained rows but can be anything - providing the HTML page that is finally generated from all the tiles is valid. Hue. -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: 24 July 2003 20:51 To: 'Struts Users Mailing List' Subject: Simple Tiles question A simple question I guess, Is it legal to have the tags like html /html and others in a tile. Meaning, when converting a page to a tile, do I have to remove those html:html header etc. tags? Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.502 / Virus Database: 300 - Release Date: 18/07/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.502 / Virus Database: 300 - Release Date: 18/07/2003 - 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:base/ in Tiles pages question
I am using Tiles, now, where am I supposed to put the html:base / tag. I would assume inside the mainLayout.jsp, but wouldn't it cause any problems in other tile pages located in different directories? Thanks, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validation and Multi-Page Forms
Peter, You should take a look at the example bundled with Struts - struts-validator it shows exactly how to validate by page basis. For example (taken from my configuration): !-- username -- field property=username) depends=required, mask page=1 msg name=mask key=logon.username.maskMsg/ arg0 key=logon.username/ var var-namemask/var-name var-value${username}/var-value /var /field Hope it helps, Erez -Original Message- From: Norr, Peter [mailto:[EMAIL PROTECTED] Sent: Friday, July 25, 2003 4:08 PM To: 'Struts Users Mailing List' Subject: Validation and Multi-Page Forms I have one form bean in session scope, where the values get populated over time through a series of pages, like a wizard. My question is how do I validate on a page by page basis? I am using the Validator Framework. Thanks, Peter -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - 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: Validation and Multi-Page Forms
Yes it's exactly how it is. -Original Message- From: Gregory F. March [mailto:[EMAIL PROTECTED] Sent: Friday, July 25, 2003 4:55 PM To: Struts Users Mailing List Subject: Re: Validation and Multi-Page Forms On Jul 25, 2003, Erez Efrati [EMAIL PROTECTED] wrote: |You should take a look at the example bundled with Struts - |struts-validator it shows exactly how to validate by page basis. Right, but I thought that it will validate all fields that are = current page? As opposed to fields that are == current page. Is that true? /greg -- Gregory F. March-=-http://www.gfm.net:81/~march-=- AIM:GfmNet - 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: Validation and Multi-Page Forms
Peter, It's hard to tell from so little information, try to specify more. In general it does work. Sorry I couldn't be of more help.. Erez -Original Message- From: Norr, Peter [mailto:[EMAIL PROTECTED] Sent: Friday, July 25, 2003 7:27 PM To: 'Struts Users Mailing List' Subject: RE: Validation and Multi-Page Forms Thanks, this helped. One more problem, the errors are being created but html:errors property=myfiled/ is not displaying them.. Any ideas? Peter -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: Friday, July 25, 2003 11:16 AM To: 'Struts Users Mailing List' Subject: RE: Validation and Multi-Page Forms Peter, You should take a look at the example bundled with Struts - struts-validator it shows exactly how to validate by page basis. For example (taken from my configuration): !-- username -- field property=username) depends=required, mask page=1 msg name=mask key=logon.username.maskMsg/ arg0 key=logon.username/ var var-namemask/var-name var-value${username}/var-value /var /field Hope it helps, Erez -Original Message- From: Norr, Peter [mailto:[EMAIL PROTECTED] Sent: Friday, July 25, 2003 4:08 PM To: 'Struts Users Mailing List' Subject: Validation and Multi-Page Forms I have one form bean in session scope, where the values get populated over time through a series of pages, like a wizard. My question is how do I validate on a page by page basis? I am using the Validator Framework. Thanks, Peter -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - 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] -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - 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]
Working with Struts + Dreamweaver
I have a JBoss/Tomcat/Struts project in which till now I have written all the pages manually with a simple editor. I have recently downloaded Dreamweaver by Macromedia and started playing with it to see what it is capable of doing. Being far from expert in HTML page design my questions are: 1. Is it really necessary to work with such a product? 2. Is it possible to work with Struts and Dreamweaver together? What does it take to do in order to achieve that? 3. Is there other products more integrated with the environment of Struts ,JBoss ,Tomcat? Any other help in the matter would be appreciated. Thanks a lot, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Working with Struts + Dreamweaver
Thank for answer, So what do you usually use? And if the project also uses Tiles? Any help here is blessed.. :) Erez -Original Message- From: Mike Jasnowski [mailto:[EMAIL PROTECTED] Sent: Friday, July 25, 2003 8:30 PM To: Struts Users Mailing List Subject: RE: Working with Struts + Dreamweaver 1. Is it really necessary to work with such a product? It's really up to you, whatever makes you most productive. Have you looked at using utilities like XDoclet to generate some of your code as well? 2. Is it possible to work with Struts and Dreamweaver together? What does it take to do in order to achieve that? I believe so, I don't use DW myself, but there was a post a few days/ about 1 week ago maybe where someone had developed an extension that enabled you to construct your pages with Struts tags, and view them in DW as the HTMl they represent. Or something like that. Although the tags of course are just one aspect of Struts, not even the most criticial in that you can use any tag library with Struts. -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: Friday, July 25, 2003 3:13 PM To: 'Struts Users Mailing List' Subject: Working with Struts + Dreamweaver I have a JBoss/Tomcat/Struts project in which till now I have written all the pages manually with a simple editor. I have recently downloaded Dreamweaver by Macromedia and started playing with it to see what it is capable of doing. Being far from expert in HTML page design my questions are: 1. Is it really necessary to work with such a product? 2. Is it possible to work with Struts and Dreamweaver together? What does it take to do in order to achieve that? 3. Is there other products more integrated with the environment of Struts ,JBoss ,Tomcat? Any other help in the matter would be appreciated. Thanks a lot, Erez - 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: Working with Struts + Dreamweaver
By the way Eric, for Windows, I looked up there but I guess I didn't find it, I only found Linux versions. Erez -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED] Sent: Monday, July 28, 2003 8:06 PM To: Struts Users Mailing List Subject: Re: Working with Struts + Dreamweaver Erez Efrati wrote: I have a JBoss/Tomcat/Struts project in which till now I have written all the pages manually with a simple editor. I have recently downloaded Dreamweaver by Macromedia and started playing with it to see what it is capable of doing. Being far from expert in HTML page design my questions are: 1. Is it really necessary to work with such a product? If you're soliciting opinions, mine is that it is definitely not necessary. Some traditional artists like DW as a sort of web page IDE, and it integrates nicely with Flash and Fireworks*, but I hate the code generated by these kinds of products (WYSIWYGs) -- nearly all table-based layouts, and excessive use of images for navigation elements which are more easily controlled (programmatically) with text. Plus, the JavaScript code for the image rollovers are hideous. Then again I am sort of a web standards bigot when it comes to design (which is why I don't design much, I suppose). I just use a text editor for writing the HTML/CSS/JSP markup that is not generated from other sources (DBs, XML, etc). On Windows I use http://jedit.org/, which is pretty phenomenal (and free/open source), and on MacOSX I use BBEdit. Erik (* I do like Fireworks for producing graphics, but I don't let it generate any code for me.) - 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: NewBie: Iterations for a constant no. of times
%@ taglib uri=http://java.sun.com/jstl/core; prefix=c % c:forEach begin=1 end=5 ... what ever you want here /c:forEach Hope this helps, Erez -Original Message- From: Jitesh Sinha [mailto:[EMAIL PROTECTED] Sent: Sunday, August 03, 2003 5:09 PM To: Struts Users Mailing List Subject: RE: NewBie: Iterations for a constant no. of times That's fine Oz... Actually by looking at your reply,I thought you know that it cannot be done by Struts... Thanks for letting me onto JSTL -Original Message- From: Oguz Kologlu [mailto:[EMAIL PROTECTED] Sent: Sunday, August 03, 2003 8:29 PM To: Struts Users Mailing List Subject: RE: NewBie: Iterations for a constant no. of times Jitesh, I didn't say that. I think you have some misconceptions about what struts is. You were asking how to do a for loop. The answer is to use the Java Standard Tag Library - JSTL. There is no need to use struts tags for this. JSTL and Struts tags play very nicely together. If you are absolutely desperate to use the struts tags instead you'll have to dig out the right tag yourself since I won't waste my time on it. Oz -Original Message- From: Jitesh Sinha [mailto:[EMAIL PROTECTED] Sent: Monday, 4 August 2003 12:35 AM To: Struts Users Mailing List Subject: RE: NewBie: Iterations for a constant no. of times you mean to say there is absolutely no way I can achieve it by using Struts??? If that is the case,struts is not a wise choice to use in our apps..because we don't know what is present there and what is not -Original Message- From: Oguz Kologlu [mailto:[EMAIL PROTECTED] Sent: Sunday, August 03, 2003 7:55 PM To: Struts Users Mailing List Subject: RE: NewBie: Iterations for a constant no. of times You should be using the JSTL for this. Have a look at a concise JSTL reference at: http://www.manning.com/bayern/appendixA.pdf Oz -Original Message- From: Jitesh Sinha [mailto:[EMAIL PROTECTED] Sent: Monday, 4 August 2003 12:06 AM To: Struts Users Mailing List Subject: RE: NewBie: Iterations for a constant no. of times Somebody please answer my question as in the email below.. -Original Message- From: Jitesh Sinha [mailto:[EMAIL PROTECTED] Sent: Sunday, August 03, 2003 3:20 PM To: Struts Users Mailing List Subject: NewBie: Iterations for a constant no. of times I have to show a row of 3 text fields a constant no. (say 5 ) of times . I have the code to show these 3 text fields in place in my jsp which will look like : table tr tdinput type=text name=aTextField/td tdinput type=text name=anotherTextField/td tdinput type=text name=anotherOneTextField/td /tr /table I want this code to be iterated 5 times .which struts tag should I use over this code?? logic:iterate requires a collection as a property of the bean . I don't want to go to bean for this .I know this iteration variable(in this case the value is 5)beforehand .So there is no need to go to bean . Please help. Thanks, Jitesh - 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] - 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: Sessions and ActionForm
Thanks a lot, Erez -Original Message- From: Jones, Marty B. [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 05, 2003 3:03 PM To: Struts Users Mailing List Subject: RE: Sessions and ActionForm See answers below: -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 05, 2003 8:58 AM To: 'Struts Users Mailing List' Subject: Sessions and ActionForm I have a registration wizard where I have a RegForm bean on the session scope. Now if on the second page I decide to quite and I close the browser (MS IE), and I open a new IE browser, and I go to registration, the same form is there containing all the information that I entered in the previous session. 1) Doesn't a session ends (invalidates) once I close the browser? No, The session will stay valid until the webcontainer invalidates it or you programatically invalidate it. Most webcontainers have a default timeout value. 2) What is the best way to handle such situation of needing the registration form always empty? The only thing that comes to my mind is on the RegAction?method=init remove the RegForm from the session and recreate a new one instead, or just call reset on the one that is there on the session context. Will that work? I think that your action will know when you are coming into the registration view for the first time so you can reset your actionform or re-create one. Thanks, Erze - 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: Using Struts Validator on Map-backed ActionForms
Hi Panchasheel, I am working with map backed action forms and the way to work with validation in this case is as follows (a piece of my validation.xml): (on my ActionForm there are getProperty and setProperty interfacing the actual map - as in your case I guess it is 'getVolume() and setVolume()). !-- username -- field property=property(user-username) depends=required, mask msg name=mask key=logon.username.maskMsg/ arg0 key=logon.username/ var var-namemask/var-name var-value${username}/var-value /var /field Hope this helps, Erez -Original Message- From: Gandle, Panchasheel [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 4:48 AM To: 'Struts Users Mailing List' Subject: RE: Using Struts Validator on Map-backed ActionForms Has anybody come up with any validations for map-backed fields field property=??? depends=required arg0 key=/ /field what should go in ??? for % for (int i=0;i5;i++;) { % html:text property=volume(key%=i%) value=/ % } % Thanks Panchasheel -Original Message- From: Cordingley, Charles [mailto:[EMAIL PROTECTED] Sent: Friday, August 01, 2003 1:24 PM To: '[EMAIL PROTECTED]' Subject: Using Struts Validator on Map-backed ActionForms Hi, I am trying to use the Struts Validator to generate Javascript validation on a Map-backed action form, but I keep getting type is null or not an object javascript error (I am using Struts 1.1). Non map-backed properties on the form work fine. In the JSP I am creating text boxes using: html:text style=WIDTH: 75px; text-align: right property='%=volume(+act.getActivityID()+)%' value='%=+scenAct.getActivityVolume()%'/ and have this method on the action form to get it: public void setVolume(String key, Object value) { volumes.put(key, value); } In the validation.xml I have tried: field property=volume() depends=required arg0 key=/ /field and: field property=volume() depends=required arg0 key=/ /field but both result in the error. Does anyone know how to do this? Thanks, Charles. The Royal Bank of Scotland plc ('the Bank') is regulated by the Financial Services Authority and is a member of The Royal Bank of Scotland Marketing Group. The only packaged products (life policies, unit trusts and other collective investment schemes and stakeholder and other pensions) the Bank advises on and sells are those of the Marketing Group, whose other members are Royal Scottish Assurance plc and Royal Bank of Scotland Unit Trust Management Limited, both regulated by the Financial Services Authority. The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB. Agency agreements exist between members of The Royal Bank of Scotland Group. 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] - 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]
validating a html:select box
I have a selection box with options where the first is valued 0 (=not selected) with some label saying: month. How can I use the Struts validator to validate the user has actually chosen a value other than 0? Do I have to write one of my own? I wish the validwhen was around... By the way the 'birthMonth' is an int (not a string). Here is a snip of my page: html:select property=birthMonth html:option value=-1 bean:message key=date.month/ /html:option c:forEach begin=1 end=12 var=m html-el:option value='${m}' c:out value='${m}' / /html-el:option /c:forEach /html:select Thanks a lot, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RE: validating a html:select box
For some reason, the javascript for intRange is not working if the property is a selection html:select. I looked in the javascript code (I am new to that still) but I saw that it only checks for the range if the field is a text or textarea. Is this true? How can I perform the client validation for selection boxes? Change the javascript? Erez -Original Message- From: David G. Friedman [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 5:22 PM To: Struts Users Mailing List Subject: Re: RE: validating a html:select box Erez, In that field validation, you can overload the sentence given back on that error. After arg0 .../ add something like: msg name=intRange key=month.invalid/ Then just add an application resource line such as: month.too.short=Please select a valid month. Or month.too.short=Please select a valid {0} to show the field name you put as arg0 in your validations xml configuration file. Regards, David ---Original Message--- From: Erez Efrati [EMAIL PROTECTED] Sent: 08/06/03 03:06 PM To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: RE: validating a html:select box I guess I'd have to change the msg key to something else than the default message telling the value is out of range. What happens with html:radio? Is this also the way also to validate radio options? If no radio is selected (and I know this is off topic, well a bit) would the browser send a value? Thanks, Erez -Original Message- From: David G. Friedman [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 4:59 PM To: Struts Users Mailing List Subject: Re: validating a html:select box Erez, The Struts Validator has an intRange function. It's in the Validator User Guide: http://jakarta.apache.org/struts/userGuide/dev_validator.html Here's an example from that page so you can set your min max as 1 12 to prevent the zero (label month?) from being submitted: field property=integer depends=required,integer,intRange arg0 key=typeForm.integer.displayname/ arg1 name=range key=${var:min} resource=false/ arg2 name=range key=${var:max} resource=false/ var var-namemin/var-name var-value10/var-value /var var var-namemax/var-name var-value20/var-value /var /field ---Original Message--- From: Erez Efrati [EMAIL PROTECTED] Sent: 08/06/03 02:41 PM To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: validating a html:select box I have a selection box with options where the first is valued 0 (=not selected) with some label saying: month. How can I use the Struts validator to validate the user has actually chosen a value other than 0? Do I have to write one of my own? I wish the validwhen was around... By the way the 'birthMonth' is an int (not a string). Here is a snip of my page: html:select property=birthMonth html:option value=-1 bean:message key=date.month/ /html:option c:forEach begin=1 end=12 var=m html-el:option value='${m}' c:out value='${m}' / /html-el:option /c:forEach /html:select Thanks a lot, Erez - 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: current year in JSP
Thanks it worked fine. Erez -Original Message- From: Bailey, Shane C. [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 05, 2003 7:59 PM To: 'Struts Users Mailing List' Subject: RE: current year in JSP The problem is that something like that (determining current date) should be done somewhere else besides the JSP if you want scriptlets totally out of your JSP. But if you don't want to do it somewhere else then the single expression scriptlets aren't too bad to have in your JSP: bean:define id=currentYear %=(new java.util.GregorianCalendar()).get(java.util.Calendar.YEAR)% /bean:define This is untested code but it should work (or a variation). -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 05, 2003 2:54 PM To: 'Struts Users Mailing List' Subject: current year in JSP I have a scriptlet in my JSP which I wish to rewrite using JSTL and tags and to get rid of the java code. How can I perform this? % for (int i = 30; i 90; i++) { % html:option value=%=Integer.toString(2003-i)% %=2003-i%/html:option % } % I wish to do something like: c:forEach var=age begin=30 end=90 html-el:option value='${CurrentYear - age}' c:out value='${CurrentYear - age}' / /html-el:option How to compute the CurrentYear? Thanks a lot, Erez - 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: RE: validating a html:select box
I hope I am not the first one to push the limit :) because I don't think selection boxes are that rare :) -Original Message- From: Yansheng Lin [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 9:16 PM To: 'Struts Users Mailing List' Subject: RE: RE: validating a html:select box Pushing the limit, eh:). How hard is it to write your own two line JavaScript. Besides, since it's a select box(not a combo), all the options are assumed to be valid from the beginning, why there is an invalid option there:). -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: August 6, 2003 1:39 PM To: 'Struts Users Mailing List' Subject: RE: RE: validating a html:select box For some reason, the javascript for intRange is not working if the property is a selection html:select. I looked in the javascript code (I am new to that still) but I saw that it only checks for the range if the field is a text or textarea. Is this true? How can I perform the client validation for selection boxes? Change the javascript? Erez -Original Message- From: David G. Friedman [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 5:22 PM To: Struts Users Mailing List Subject: Re: RE: validating a html:select box Erez, In that field validation, you can overload the sentence given back on that error. After arg0 .../ add something like: msg name=intRange key=month.invalid/ Then just add an application resource line such as: month.too.short=Please select a valid month. Or month.too.short=Please select a valid {0} to show the field name you put as arg0 in your validations xml configuration file. Regards, David ---Original Message--- From: Erez Efrati [EMAIL PROTECTED] Sent: 08/06/03 03:06 PM To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: RE: validating a html:select box I guess I'd have to change the msg key to something else than the default message telling the value is out of range. What happens with html:radio? Is this also the way also to validate radio options? If no radio is selected (and I know this is off topic, well a bit) would the browser send a value? Thanks, Erez -Original Message- From: David G. Friedman [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 4:59 PM To: Struts Users Mailing List Subject: Re: validating a html:select box Erez, The Struts Validator has an intRange function. It's in the Validator User Guide: http://jakarta.apache.org/struts/userGuide/dev_validator.html Here's an example from that page so you can set your min max as 1 12 to prevent the zero (label month?) from being submitted: field property=integer depends=required,integer,intRange arg0 key=typeForm.integer.displayname/ arg1 name=range key=${var:min} resource=false/ arg2 name=range key=${var:max} resource=false/ var var-namemin/var-name var-value10/var-value /var var var-namemax/var-name var-value20/var-value /var /field ---Original Message--- From: Erez Efrati [EMAIL PROTECTED] Sent: 08/06/03 02:41 PM To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: validating a html:select box I have a selection box with options where the first is valued 0 (=not selected) with some label saying: month. How can I use the Struts validator to validate the user has actually chosen a value other than 0? Do I have to write one of my own? I wish the validwhen was around... By the way the 'birthMonth' is an int (not a string). Here is a snip of my page: html:select property=birthMonth html:option value=-1 bean:message key=date.month/ /html:option c:forEach begin=1 end=12 var=m html-el:option value='${m}' c:out value='${m}' / /html-el:option /c:forEach /html:select Thanks a lot, Erez - 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
RE: RE: Actions Best Practice
Yes David, it would work but it was not what Struts had in mind. I regard your solution as trick, a way around but not something I want to follow as development guidelines. Erez -Original Message- From: David G. Friedman [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 11:54 AM To: Struts Users Mailing List Subject: Re: RE: Actions Best Practice Taking your advice, it means that I would have two different action mappings, one for the init step and the second for the actual action (send). But then I will have to write something like html:link page=/InitForgotPassword.do?action=init which is a bit strange to write again the init, and it is needed cause the ForgotPasswordAction.java needs this 'action' parameter to distinguish between the two. Hmm.. Why not use the Struts Validator, set the validations to use page=1 (or page=2), and just set page=1 (or page=2) in the JSP automatically when the page gets displayed? Then, the first time you go to it, nothing needs to be validated. When you hit submit, the validations occur for that page, or further pages, if you have more in the sequence/step/function/route/click. Regards, David - 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]
current year in JSP
I have a scriptlet in my JSP which I wish to rewrite using JSTL and tags and to get rid of the java code. How can I perform this? % for (int i = 30; i 90; i++) { % html:option value=%=Integer.toString(2003-i)% %=2003-i%/html:option % } % I wish to do something like: c:forEach var=age begin=30 end=90 html-el:option value='${CurrentYear - age}' c:out value='${CurrentYear - age}' / /html-el:option How to compute the CurrentYear? Thanks a lot, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: simple JSTL question
Thanks Yan, Erez -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Yann Cbron Sent: Sunday, August 10, 2003 2:26 PM To: [EMAIL PROTECTED] Subject: Re: simple JSTL question 1) How do I subscribe to the JSTL mailing list? (I rather ask simple dumb questions than stay with dumb answers :) there's no stupid questions ;-) mailto:[EMAIL PROTECTED] 2) What is the latest version of JSTL that I should use? Currently I am using the JSTL and Struts-el in combination. V1.0.3, see http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html Yann - 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: Actions Best Practice
You're right it is a good option. Thanks, Erez -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 3:00 PM To: Struts Users Mailing List Subject: Re: Actions Best Practice That's not necessary. In the action mapping, you can specify the action parameter with parameter=init or parameter=send. Erez Efrati wrote: Taking your advice, it means that I would have two different action mappings, one for the init step and the second for the actual action (send). But then I will have to write something like html:link page=/InitForgotPassword.do?action=init which is a bit strange to write again the init, and it is needed cause the ForgotPasswordAction.java needs this 'action' parameter to distinguish between the two. Hmm.. Erez -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 11:43 AM To: Struts Users Mailing List Subject: Re: Actions Best Practice Erez Efrati wrote: One of the problem I found with 'action=init' method, is that the validation is activated automatically for both cases (both init send), and fails of course on the 'init' cause no field is yet in the form. So I was forced to configure 'validate=false' and call it manually in the Action code. Option B would be compacter. You can write two action mappings in struts-config to distinguish the calls, where one has no validation and the other does. I know some people don't like having extra action mappings in their struts-config, but I believe that is what they are there for. Adam - 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]
Validator real time expression vars
Is there a way to use vars in validation.xml field ... that are not constants in a way that the javascript will use these values? Thanks, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Actions Best Practice
The only thing you cannot do is having a mixture of this solution (having the action-mapping parameter set to the 'init' or else) and the one of DispatchAction class that keeps all the operation under the same roof (class). Erez -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 3:00 PM To: Struts Users Mailing List Subject: Re: Actions Best Practice That's not necessary. In the action mapping, you can specify the action parameter with parameter=init or parameter=send. Erez Efrati wrote: Taking your advice, it means that I would have two different action mappings, one for the init step and the second for the actual action (send). But then I will have to write something like html:link page=/InitForgotPassword.do?action=init which is a bit strange to write again the init, and it is needed cause the ForgotPasswordAction.java needs this 'action' parameter to distinguish between the two. Hmm.. Erez -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 11:43 AM To: Struts Users Mailing List Subject: Re: Actions Best Practice Erez Efrati wrote: One of the problem I found with 'action=init' method, is that the validation is activated automatically for both cases (both init send), and fails of course on the 'init' cause no field is yet in the form. So I was forced to configure 'validate=false' and call it manually in the Action code. Option B would be compacter. You can write two action mappings in struts-config to distinguish the calls, where one has no validation and the other does. I know some people don't like having extra action mappings in their struts-config, but I believe that is what they are there for. Adam - 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]
Validator
I am trying to figure out the code in struts.validator.FieldsCheck.java in order to write one of my own. Can someone explain what the purpose of the following lines of code in all of the validateXXX() in Struts: validateIntRange (...) { if (isString(bean)) { value = (String) bean; } ... } Is this really necessary? Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
simple JSTL question
Some simple questions: 1) How do I subscribe to the JSTL mailing list? (I rather ask simple dumb questions than stay with dumb answers :) 2) What is the latest version of JSTL that I should use? Currently I am using the JSTL and Struts-el in combination. Thanks, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Actions Best Practice
I am looking for the best practice for writing Actions in my application. For example: I have a forgot password action where the users are taken to a page where they can enter their username and click 'sumbit' and another page is shown saying that their password was sent to their registered email. Several options: A) Have two actions: 1. InitForgotPasswordAction.java - just for showing the page and if thereis some logic to do first then do it here. 2. SendForgotPasswordAction.java - handles the send. B) Single action ForgotPasswordAction with dispatch 'init' and 'send'. One of the problem I found with 'action=init' method, is that the validation is activated automatically for both cases (both init send), and fails of course on the 'init' cause no field is yet in the form. So I was forced to configure 'validate=false' and call it manually in the Action code. Any comment will be greatly appreciated here, Thanks, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Remove a key from collection.
I don't really have the entire picture here but I would suggest: In you PropertiesBean split between the known, and dynamic containers of properties and then in the page pull them using different property on the PropertiesBean. This way it would be much more clear which is expected and which is dynamically added. Simply put to HashMaps on the PropBean and two sets of set/get to get and set those properties. This is only one solution I guess there are more. :) Hope this helps, Erez -Original Message- From: K.M.Prabhu [mailto:[EMAIL PROTECTED] Sent: Thursday, August 07, 2003 3:26 PM To: [EMAIL PROTECTED] Subject: Remove a key from collection. Hi All, I am having a collection of properties with keys of the form, say 1,2,3,4,. Of these, a few keys are well known (say 1,2,3) and the others will be added to the properties object at run time. I want to display them in an order in my UI, say 1,2,3,4.. To do this, first I get the values for the known keys (1,2,3). For the remaining things, I put them in a loop and print it. But, the problem I face is , the already printed value will also print once again (since I will not know if the key is present in my known list or not). My question is how can i remove the key values once i print it. Can anyone help me? Thanks, Prabhu - 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: message localization
In Struts bean:message key= the default bundle is used without having to declare it in each page. How can this be done in JSTL? Now just to make sure, again, is it recommended to make the transition to these JSTL tags or is it safe to stay with the Struts ones? Erez -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] Sent: Monday, August 11, 2003 2:07 AM To: Struts Users Mailing List Subject: Re: message localization On Mon, 11 Aug 2003, Erez Efrati wrote: Date: Mon, 11 Aug 2003 01:24:58 +0200 From: Erez Efrati [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: message localization All this talking on JSP 2.0, JSTL and Struts-el brought me to ask if I should avoid using the following: bean-el:message key='${UserSexKey[select]}'/ Could someone tell me what is the equivalent in JSTL? JSTL has formatting and i18n tags that get localized text from resource bundles instead of Struts MessageResources objects -- check out the fmt:message/ tag, in Section 8.1 of the spec. Erez 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: Relay Actions
I don't like it but it is written in Ted Husted Struts in Action section 8.4, black on white :) Yes it reuses the same form bean, but it resets it again, and repopulate it again. That is why he had inserted in his scaffolds package BaseForm.java a method for set/getMutable() so that the first action will set the mutability of the bean form to false preventing the repopulation to occur or more accurate to change the values of properties on the form bean. I wish it was not true, Erez -Original Message- From: K.C. Baltz [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 11:16 PM To: Struts Users Mailing List Subject: Re: Relay Actions I don't believe that's true. When a form is needed, a check is made to see if it already exists in the given scope and then the bean is reused. K.C. Erez Efrati wrote: Is this true that when you relay actions, meaning have one action forward to another action, the form gets populated twice, and moreover needs to be specified in both action mappings, (both the RelayAction and the RealAction )? Erez - 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]
Validator
I am trying to figure out the code in struts.validator.FieldsCheck.java in order to write one of my own. Can someone explain what the purpose of the following lines of code in all of the validateXXX() in Struts: validateIntRange (...) { if (isString(bean)) { value = (String) bean; } ... } Is this really necessary? Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
getting the current year
How can I get the current year in a JSP using JSTL or Struts, and no java code? Thanks, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts Validator Javascript
Working with the validator I found that the client-side javascript code automatically generated by the validator tag does not handle correctly or at all fields that are radio group , checkbox group or any other type of group that exist. I have posted few times on that but no response. After that I went and fixed the javascript code to do it correctly in the validateRequired() for instance. I am just wondering, am I the only one to use the client side validator avascript? Am I so special :) ? Or everyone else is doing it differently? I would appreciate any remark. Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Actions Best Practice
First, in my humble opinion, having one Action serving several actions was the reality welcoming the pink vision of having a small action doing different thing. Now, combining the two solutions as they are is quite impossible since they both make use of the same action mapping 'parameter' field. There is however a nice-looking way around it. I can write our own version of base ActionForm override the validate(mapping, request), ignore the validation only if the 'parameter' is equal to init (as a convention, as a rule in the specific application). Therefore setting validation=true will be ignored when parameter=init and in all other cases will perform the validation. To use the DispatchAction I would write the same base MyBaseForm, but this time, it will imitate the DispatchAction and will look if the value of the named parameter is init. I think that solves it. Erez -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 3:32 PM To: Struts Users Mailing List Subject: Re: Actions Best Practice I thought that was exactly what you were doing! Erez Efrati wrote: The only thing you cannot do is having a mixture of this solution (having the action-mapping parameter set to the 'init' or else) and the one of DispatchAction class that keeps all the operation under the same roof (class). Erez -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 3:00 PM To: Struts Users Mailing List Subject: Re: Actions Best Practice That's not necessary. In the action mapping, you can specify the action parameter with parameter=init or parameter=send. Erez Efrati wrote: Taking your advice, it means that I would have two different action mappings, one for the init step and the second for the actual action (send). But then I will have to write something like html:link page=/InitForgotPassword.do?action=init which is a bit strange to write again the init, and it is needed cause the ForgotPasswordAction.java needs this 'action' parameter to distinguish between the two. Hmm.. Erez -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 11:43 AM To: Struts Users Mailing List Subject: Re: Actions Best Practice Erez Efrati wrote: One of the problem I found with 'action=init' method, is that the validation is activated automatically for both cases (both init send), and fails of course on the 'init' cause no field is yet in the form. So I was forced to configure 'validate=false' and call it manually in the Action code. Option B would be compacter. You can write two action mappings in struts-config to distinguish the calls, where one has no validation and the other does. I know some people don't like having extra action mappings in their struts-config, but I believe that is what they are there for. Adam - 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: Actions Best Practice
Taking your advice, it means that I would have two different action mappings, one for the init step and the second for the actual action (send). But then I will have to write something like html:link page=/InitForgotPassword.do?action=init which is a bit strange to write again the init, and it is needed cause the ForgotPasswordAction.java needs this 'action' parameter to distinguish between the two. Hmm.. Erez -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 11:43 AM To: Struts Users Mailing List Subject: Re: Actions Best Practice Erez Efrati wrote: One of the problem I found with 'action=init' method, is that the validation is activated automatically for both cases (both init send), and fails of course on the 'init' cause no field is yet in the form. So I was forced to configure 'validate=false' and call it manually in the Action code. Option B would be compacter. You can write two action mappings in struts-config to distinguish the calls, where one has no validation and the other does. I know some people don't like having extra action mappings in their struts-config, but I believe that is what they are there for. Adam - 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: Custom Validator
Keith, I have done the same and to do that I would suggest taking as a starting point the code from the Struts source code. more specifically have a look at FieldChecks.java (Struts src code) under shared/.../struts/validator/FieldChecks.java. It will much clearer once you do that. It worked for me :) HTH, Erez -Original Message- From: Kamholz, Keith (corp-staff) USX [mailto:[EMAIL PROTECTED] Sent: Thursday, August 07, 2003 6:05 PM To: Struts (E-mail) Subject: Custom Validator Hey everyone, I've got some nice custom validations working using the validation framework. However, I'm having a hard time with one seemingly imple issue. In the validation method in my custom validation class, how do I get the value of the field I'm validating? I found one example that did this, but it used deprecated methods. Thanks in advance! - 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: Help please - indexed field in ActionForm
You could also try the following: logic:iterate id=text indexId=index name=myForm property=text label:html-el:text property=text[${indexId}] / /logic:iterate You could also make use of the nested:iterate and get rid of the name=myForm, but this a bit more advanced. Don't forget to put : %@ taglib uri=/tags/struts-html-el prefix=html-el % HTH, Erez -Original Message- From: David Thielen [mailto:[EMAIL PROTECTED] Sent: Friday, August 08, 2003 1:39 AM To: Struts Users Mailing List Subject: Re: Help please - indexed field in ActionForm Hi; Thank you - this is part of what I need. Is there any way to iterate through the lines if I don't know up front how many lines there will be? I tried the with the c JSTL and it doesn't work. thanks - dave - Original Message - From: Gary Kephart [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, August 07, 2003 4:55 PM Subject: RE: Help please - indexed field in ActionForm class MyActionForm { private static final MAX_ENTRIES = 50; private String[] text; public MyActionForm() { text = new String[MAX_ENTRIES]; } public String[] getText() {return text;} public void setText(int index, String newText) {text[index] = newText;} } my.jsp html:html body html:form action=MyAction.do Label 1:html:text property=text[0]/br/ Label 2:html:text property=text[1]/br/ html:submit/ /html:form body /html:html Gary Kephart| New Century Mortgage Web-Based Application Developer | http://www.ncen.com [EMAIL PROTECTED] | 340 Commerce 949-797-5660| Irvine, CA 92602-1318 -Original Message- From: David Thielen [mailto:[EMAIL PROTECTED] Sent: Thursday, August 07, 2003 3:46 PM To: Struts-Users Subject: Help please - indexed field in ActionForm Hi; I've been fighting this all day with no luck. And it has to be a simple thing to do. I have a form where I have N lines in it. Each line needs to have some text displayed and an edit box. How do I set this up in the .jsp file and in the ActionForm? I've found a number of examples on the web but they all have incomplete code and my guesses for the rest of the code have not been right so far. thanks - dave - 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: Using Struts Validator on Map-backed ActionForms
Just forgot to explain that I do the following: field property=property(user-username)... because user-username is the name of one of my properties (fields) on the form. In your case it would be something like: field property=volume(fieldname)... Erez -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 11:44 AM To: 'Struts Users Mailing List' Subject: RE: Using Struts Validator on Map-backed ActionForms Hi Panchasheel, I am working with map backed action forms and the way to work with validation in this case is as follows (a piece of my validation.xml): (on my ActionForm there are getProperty and setProperty interfacing the actual map - as in your case I guess it is 'getVolume() and setVolume()). !-- username -- field property=property(user-username) depends=required, mask msg name=mask key=logon.username.maskMsg/ arg0 key=logon.username/ var var-namemask/var-name var-value${username}/var-value /var /field Hope this helps, Erez -Original Message- From: Gandle, Panchasheel [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 4:48 AM To: 'Struts Users Mailing List' Subject: RE: Using Struts Validator on Map-backed ActionForms Has anybody come up with any validations for map-backed fields field property=??? depends=required arg0 key=/ /field what should go in ??? for % for (int i=0;i5;i++;) { % html:text property=volume(key%=i%) value=/ % } % Thanks Panchasheel -Original Message- From: Cordingley, Charles [mailto:[EMAIL PROTECTED] Sent: Friday, August 01, 2003 1:24 PM To: '[EMAIL PROTECTED]' Subject: Using Struts Validator on Map-backed ActionForms Hi, I am trying to use the Struts Validator to generate Javascript validation on a Map-backed action form, but I keep getting type is null or not an object javascript error (I am using Struts 1.1). Non map-backed properties on the form work fine. In the JSP I am creating text boxes using: html:text style=WIDTH: 75px; text-align: right property='%=volume(+act.getActivityID()+)%' value='%=+scenAct.getActivityVolume()%'/ and have this method on the action form to get it: public void setVolume(String key, Object value) { volumes.put(key, value); } In the validation.xml I have tried: field property=volume() depends=required arg0 key=/ /field and: field property=volume() depends=required arg0 key=/ /field but both result in the error. Does anyone know how to do this? Thanks, Charles. The Royal Bank of Scotland plc ('the Bank') is regulated by the Financial Services Authority and is a member of The Royal Bank of Scotland Marketing Group. The only packaged products (life policies, unit trusts and other collective investment schemes and stakeholder and other pensions) the Bank advises on and sells are those of the Marketing Group, whose other members are Royal Scottish Assurance plc and Royal Bank of Scotland Unit Trust Management Limited, both regulated by the Financial Services Authority. The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB. Agency agreements exist between members of The Royal Bank of Scotland Group. 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] - 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
RE: Validator
It's in the code of FieldsCheck.java. I was trying to create one of my own validator and I saw these lines there. Erez -Original Message- From: Yansheng Lin [mailto:[EMAIL PROTECTED] Sent: Thursday, August 07, 2003 12:10 AM To: 'Struts Users Mailing List' Subject: RE: Validator ??? I don't see it in my validation-rules.xml. Which version are you using? -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: August 6, 2003 3:33 PM To: 'Struts Users Mailing List' Subject: Validator I am trying to figure out the code in struts.validator.FieldsCheck.java in order to write one of my own. Can someone explain what the purpose of the following lines of code in all of the validateXXX() in Struts: validateIntRange (...) { if (isString(bean)) { value = (String) bean; } ... } Is this really necessary? Erez - 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: message localization
Thanks for the information. Could you tell me where I can find some documentation on JavaServerFace ? Erez -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] Sent: Monday, August 11, 2003 2:50 AM To: Struts Users Mailing List Subject: RE: message localization On Mon, 11 Aug 2003, Erez Efrati wrote: Date: Mon, 11 Aug 2003 03:09:56 +0200 From: Erez Efrati [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: RE: message localization In Struts bean:message key= the default bundle is used without having to declare it in each page. How can this be done in JSTL? There's a context init parameter to set the default resource bundle name. See Section 8.11.3. Now just to make sure, again, is it recommended to make the transition to these JSTL tags or is it safe to stay with the Struts ones? Either one will work fine, last a long time, as long as you're running on a Servlet 2.3 / JSP 1.2 or later container. If you're on an earlier version, your only choice is the Struts tags. My recommendation is that new projects should use JSTL and struts-el tags (if you're on the appropriate container). For existing apps, there is no compelling reason to change, other than perhaps to use those changes as a learning experience. You're likely to see exactly the same sort of transition be recommended on the Struts HTML tags, once JavaServer Faces goes final. In the mean time, there's an integration library that lets you mix in the current EA release with Struts 1.1: http://jakarta.apache.org/builds/jakarta-struts/release/struts-faces/ Erez 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]
Signup Wizard and Edit mode
I have a user signup wizard running through several pages. After the signed up process is done I let the users update their registration information. I have an action named 'SignupAction'. Since I already wrote those pages I want to reuse them in the Edit actions. How can I do it? One way I thought of, since those pages already have their html:form action=/SignupAction.do, I will pass the SignupAction a hidden parameter with the mode or action = Edit and category=BasicInfo. That way it would that it is running in edit mode, and the category is the basic info (what was entered in the page #1 in wizard mode). 1) Can this work? 2) Is there a better way to do that? 3) How can I add arguments to the html:form action=/SignupAction.do?args...? can someone give an example here? Many thanks, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Sessions and ActionForm
I have a registration wizard where I have a RegForm bean on the session scope. Now if on the second page I decide to quite and I close the browser (MS IE), and I open a new IE browser, and I go to registration, the same form is there containing all the information that I entered in the previous session. 1) Doesn't a session ends (invalidates) once I close the browser? 2) What is the best way to handle such situation of needing the registration form always empty? The only thing that comes to my mind is on the RegAction?method=init remove the RegForm from the session and recreate a new one instead, or just call reset on the one that is there on the session context. Will that work? Thanks, Erze - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts Problem
Sridhar, Doing html-el:text property=ips(${Element.value}) / is illegal in your case cause this would generate the following call : getIps(Element.value) and setIps(String key, Object value) with the result of Element.value as the 'key' and the new value as the value. But your HashMap doesn't contain any element by this key. If you're trying to update the values of elements in the map stored by their keys then you just need the first html-el:text property=ips(${Element.key}) element. I hope I understand your what you're trying to achieve here. HTH, Erez -Original Message- From: Sridhar Kotagiri [mailto:[EMAIL PROTECTED] Sent: Thursday, August 07, 2003 8:03 PM To: Struts Users Mailing List Subject: RE: Struts Problem Hi Erez, when Im using html-el tags its throwing an exception html-el:form action=/myaccount/advanced/edit/continue logic:notEmpty name=editAdvancedForm property=ip b class=txtMedium id=largebean:message bundle=content key=title.ipaddresses//b table width=100% cellspacing=0 cellpadding=2 border=0 logic:iterate id=Element name=editAdvancedForm property=ip tr class=textbox style=width:150px; tdhtml-el:text property=ips(${Element.key}) //td tdbbean:message bundle=content key=common.pointsto//b/td tdhtml-el:text property=ips(${Element.value}) //td /tr /logic:iterate /table /logic:notEmpty html-el:form org/apache/taglibs/standard/lang/support/ExpressionEvaluatorManager' javax.servlet.ServletException: org/apache/taglibs/standard/lang/support/ExpressionEvaluatorManager at org.apache.jasper.runtime.PageContextImpl.handlePageException Thanks! Sridhar -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: Thursday, August 07, 2003 1:26 PM To: 'Struts Users Mailing List' Subject: RE: Struts ProblemUrgent The reason this is not working for you is that Element bean name is not around there when the request is populated back to your form. It is there only when the JSP is populated from the action inside the iteration. To do what you want to do: html-el:text property=ips(${Element.key}) / using the html-el taglib of Struts-EL. Haven't tested it but I think it should work. HTH, Erez -Original Message- From: Sridhar Kotagiri [mailto:[EMAIL PROTECTED] Sent: Thursday, August 07, 2003 6:16 PM To: Struts Users Mailing List Subject: Struts ProblemUrgent Hi, I have a HashMap in my ActionForm bean.I am able to display the data.Butwhen I submit this form I am unable to carry the data.can anyone help me regarding this. logic:notEmpty name=editAdvancedForm property=ip b class=txtMedium id=largebean:message bundle=content key=title.ipaddresses//b table width=100% cellspacing=0 cellpadding=2 border=0 logic:iterate id=Element name=editAdvancedForm property=ip tr class=textbox style=width:150px; tdhtml:text name=Element property=key//td tdbbean:message bundle=content key=common.pointsto//b/td tdhtml:text name=Element property=value//td /tr /logic:iterate /table /logic:notEmpty Action Form public class EditAdvancedForm extends ValidatorForm { //~ Instance fields private String domain_Id; private Map ip; public EditAdvancedForm(){ ip=new HashMap(); } public void setIps(String key,String value) { ip.put(key,value); } public Object getIps(String key) { return ip.get(key); } public Map getIp() { return ip; } /** * @param map */ public void setIp(Map map) { ip = map; } } - 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]
Required vaidator javascript
I am sure that this is a simple question to you all HTML gurus... I Hope :) I am using the 'required' validator and I have fields of type 'select-one' and 'radio' for both of them the required doesn't bring up the pop. The required works very simply by looking if there is a value or not. But for selection-box this is not enough, in my opinion. Currently I have the empty value = 0 html:option value=0 .../ so for in the eyes of the required validator the value is not empty. Of course I can refine the javascript for dealing with these situations of 0 as an empty value by convention or even take that NONE value from an extra variable. As for the radio buttons I still have to figure out why? They are both not selected and still.. no respond from Mr. required. Small simple HTTP/HTML question. What value (if any) is sent after submitting for a selection with empty value= ? And the same for radio? Thanks, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: validating a html:select box
I guess I'd have to change the msg key to something else than the default message telling the value is out of range. What happens with html:radio? Is this also the way also to validate radio options? If no radio is selected (and I know this is off topic, well a bit) would the browser send a value? Thanks, Erez -Original Message- From: David G. Friedman [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 4:59 PM To: Struts Users Mailing List Subject: Re: validating a html:select box Erez, The Struts Validator has an intRange function. It's in the Validator User Guide: http://jakarta.apache.org/struts/userGuide/dev_validator.html Here's an example from that page so you can set your min max as 1 12 to prevent the zero (label month?) from being submitted: field property=integer depends=required,integer,intRange arg0 key=typeForm.integer.displayname/ arg1 name=range key=${var:min} resource=false/ arg2 name=range key=${var:max} resource=false/ var var-namemin/var-name var-value10/var-value /var var var-namemax/var-name var-value20/var-value /var /field ---Original Message--- From: Erez Efrati [EMAIL PROTECTED] Sent: 08/06/03 02:41 PM To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: validating a html:select box I have a selection box with options where the first is valued 0 (=not selected) with some label saying: month. How can I use the Struts validator to validate the user has actually chosen a value other than 0? Do I have to write one of my own? I wish the validwhen was around... By the way the 'birthMonth' is an int (not a string). Here is a snip of my page: html:select property=birthMonth html:option value=-1 bean:message key=date.month/ /html:option c:forEach begin=1 end=12 var=m html-el:option value='${m}' c:out value='${m}' / /html-el:option /c:forEach /html:select Thanks a lot, Erez - 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]
Relay Actions
Is this true that when you relay actions, meaning have one action forward to another action, the form gets populated twice, and moreover needs to be specified in both action mappings, (both the RelayAction and the RealAction )? Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
message localization
All this talking on JSP 2.0, JSTL and Struts-el brought me to ask if I should avoid using the following: bean-el:message key='${UserSexKey[select]}'/ Could someone tell me what is the equivalent in JSTL? Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Signup Wizard and Edit mode (repost)
I have a user signup wizard running through several pages. After the signed up process is done I let the users update their registration information. I have an action named 'SignupAction'. Since I already wrote those pages I want to reuse them in the Edit actions. How can I do it? One way I thought of, since those pages already have their html:form action=/SignupAction.do, I will pass the SignupAction a hidden parameter with the mode or action = Edit and category=BasicInfo. That way it would that it is running in edit mode, and the category is the basic info (what was entered in the page #1 in wizard mode). 1) Can this work? 2) Is there a better way to do that? 3) How can I add arguments to the html:form action=/SignupAction.do?args...? can someone give an example here? Many thanks, Erez - 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]
One form multiple Action mapping
I have a registration form (RegForm) which based on the method/mode I want to direct it to a different action mapping in order to assign different roles or security restrictions. I have a single RegAction extending the DispatchAction class, with parameter 'method' as the dispatch parameter. I thought of maybe put a c:if .. and based on the 'method' put the correct html:form .. one. But then again maybe this will harm the javascript validation, cause the name of the form will be different. How can this be done? Registration.jsp: html:form action=/Reg.do?method=create ... /html:form Thanks, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Not getting javascript Popup on html:radio buttons
I have a field containing two a group of two html:radio items with the values 1 and 2. The page starts when none of them is selected. The property is depends on required but still I don't get the javascript popup, only the Action error coming from the server side. Any ideas why? Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts Problem!!!!Urgent
The reason this is not working for you is that Element bean name is not around there when the request is populated back to your form. It is there only when the JSP is populated from the action inside the iteration. To do what you want to do: html-el:text property=ips(${Element.key}) / using the html-el taglib of Struts-EL. Haven't tested it but I think it should work. HTH, Erez -Original Message- From: Sridhar Kotagiri [mailto:[EMAIL PROTECTED] Sent: Thursday, August 07, 2003 6:16 PM To: Struts Users Mailing List Subject: Struts ProblemUrgent Hi, I have a HashMap in my ActionForm bean.I am able to display the data.Butwhen I submit this form I am unable to carry the data.can anyone help me regarding this. logic:notEmpty name=editAdvancedForm property=ip b class=txtMedium id=largebean:message bundle=content key=title.ipaddresses//b table width=100% cellspacing=0 cellpadding=2 border=0 logic:iterate id=Element name=editAdvancedForm property=ip tr class=textbox style=width:150px; tdhtml:text name=Element property=key//td tdbbean:message bundle=content key=common.pointsto//b/td tdhtml:text name=Element property=value//td /tr /logic:iterate /table /logic:notEmpty Action Form public class EditAdvancedForm extends ValidatorForm { //~ Instance fields private String domain_Id; private Map ip; public EditAdvancedForm(){ ip=new HashMap(); } public void setIps(String key,String value) { ip.put(key,value); } public Object getIps(String key) { return ip.get(key); } public Map getIp() { return ip; } /** * @param map */ public void setIp(Map map) { ip = map; } } - 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: Struts with JBuilder
Hi Jack, I am too working with JB8 EE and all I did is put the resource property file in the my src/resources directory under the name 'application.properties'. And it took it. By the way, if you use other languages you need to run native2ascii on your own, JB8 will not do it. HTH, Erez -Original Message- From: Jian Dai [mailto:[EMAIL PROTECTED] Sent: Sunday, August 10, 2003 11:03 AM To: [EMAIL PROTECTED] Subject: Struts with JBuilder Hi, all: I am trying to use Jbuilder 8.0 to build a struts project on Tomcat 4.1 server. But I have a problem with Message Sources. I cannot make the the properties file for Message sources to be included in .WAR package when I use Jbuilder's build function to build that package. I will very appreciate if anybody here can give me a clue why this happens and how I overcome this problem. Many thanks in advance for the nice help. Jack - 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]
Registration and action mappings
I have a registration wizard. In each JSP member of this wizard I have a html:form action=/Signup.do. action name=signupForm type=web.SignupAction validate=false parameter=method scope=session path=/Signup forward name=page1 path=.page1 / forward name=page2 path=.page2 / forward name=success path=.signupSuccess / /action Note that the scope is session. Now I want to write the part of editing these pages separately. Thing is I want to use the same SignupAction (subclass of DispatchAction), but I can't use the same action-mapping cause I need it now to be scope=request. Also, in terms of security roles, I need the editing and wizard-creation mode action mappings to be different in order to set different security settings. The signup creation is open to all, while the editing is only for logged on users (role=User). I don't know if it would work (I will try it) is having two html:form action=/Signup.do?method=create for wizard creation mode, and html:form action=/EditRegistration.do?method=?? Or use javascript to change these dynamically with onclick on the buttons. I would really appreciate any comment here, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: forEach html-el:text - it's not working
In order to make it work you should try something like html:text property=items[${status.count}].qty / Hope this helps, Erez -Original Message- From: David Thielen [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 12, 2003 11:03 PM To: Struts-Users Subject: c:forEach html-el:text - it's not working Hi; I am trying to use html-el:text inside a c:forEach and according to everything I have read - this should work. But it doesn't. Any ideas? thanks - dave my jsp ... c:forEach items=${orderForm.items} var=orderFormItem varStatus=status trtd html-el:text name=orderFormItem property=qty indexed=true/ /td/tr /c:forEach Where OrderForm.java has: ... public OrderFormItem [] getItems() { return items; } public OrderFormItem getItem( int ind ){ return items[ind]; } public void setItem( int ind, OrderFormItem ofi ){ items[ind] = ofi; } ... and OrderFormItem has: ... public String getQty() { return Integer.toString(qty); } public void setQty( String num){ qty = Integer.parseInt(num);} ... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: One form multiple Action mapping
Come to think of it more, since I want the submitted form to use different action mappings, I thought of using something like Scanfold's RelayAction which dispatches to different action mappings based on the parameter (in my case 'method'). On each action mapping I could set my required roles etc. and then have them all forwarded to the RegistrationAction for processing. This way I can distinguish between them and still process them in a single point (Action). What do you think? Erez -Original Message- From: Bailey, Shane C. [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 4:03 PM To: 'Struts Users Mailing List' Subject: RE: One form multiple Action mapping What about: html:form action=/Reg.do c:if ... html:hidden property=method value=dispatchMeth1 / /c:if c:otherwise html:hidden property=method value=dispatchMeth2 / /c:otherwise /html:form -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 11:04 AM To: 'Struts Users Mailing List' Subject: One form multiple Action mapping I have a registration form (RegForm) which based on the method/mode I want to direct it to a different action mapping in order to assign different roles or security restrictions. I have a single RegAction extending the DispatchAction class, with parameter 'method' as the dispatch parameter. I thought of maybe put a c:if .. and based on the 'method' put the correct html:form .. one. But then again maybe this will harm the javascript validation, cause the name of the form will be different. How can this be done? Registration.jsp: html:form action=/Reg.do?method=create ... /html:form Thanks, Erez - 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: forEach html-el:text - it's not working
David, As far as I can tell you, this cannot work. The population from the request to a new fresh form will fail due to the fact that the form doesn't have a setQty() setter method. Erez -Original Message- From: David Thielen [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 12, 2003 11:03 PM To: Struts-Users Subject: c:forEach html-el:text - it's not working Hi; I am trying to use html-el:text inside a c:forEach and according to everything I have read - this should work. But it doesn't. Any ideas? thanks - dave my jsp ... c:forEach items=${orderForm.items} var=orderFormItem varStatus=status trtd html-el:text name=orderFormItem property=qty indexed=true/ /td/tr /c:forEach Where OrderForm.java has: ... public OrderFormItem [] getItems() { return items; } public OrderFormItem getItem( int ind ){ return items[ind]; } public void setItem( int ind, OrderFormItem ofi ){ items[ind] = ofi; } ... and OrderFormItem has: ... public String getQty() { return Integer.toString(qty); } public void setQty( String num){ qty = Integer.parseInt(num);} ... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Signup Wizard and Edit mode
I have a user signup wizard running through several pages. After the signed up process is done I let the users update their registration information. I have an action named 'SignupAction'. Since I already wrote those pages I want to reuse them in the Edit actions. How can I do it? One way I thought of, since those pages already have their html:form action=/SignupAction.do, I will pass the SignupAction a hidden parameter with the mode or action = Edit and category=BasicInfo. That way it would that it is running in edit mode, and the category is the basic info (what was entered in the page #1 in wizard mode). 1) Can this work? 2) Is there a better way to do that? 3) How can I add arguments to the html:form action=/SignupAction.do?args...? can someone give an example here? Many thanks, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
validator bCancel=false;
I saw that javascript generated contains a { var bCancel = false; ... } So does it mean that we are free of doing bCancel=false in html:submit onclick=bCancel=false; } ? Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts Validator Javascript
Didn't know about the bug list, but excuse me for not knowing that, can you drop me the link for the bug-list please. Just for those of you who don't have faith in it, it does work, but needs a little or more fixing and improvement. Overall, I'd say it's a good pretty good infrastructure still needing more care and attention. Currently the only solution I have for myself is coding it myself and hoping to see what comes around in the future releases. And yes, I am special :) my mother told me so. Erez -Original Message- From: Reinhard [mailto:[EMAIL PROTECTED] Sent: Sunday, August 10, 2003 5:40 PM To: Struts Users Mailing List Subject: Re: Struts Validator Javascript ... Am I so special :) ;-) If I remember it well, it's an open issue in the bug-list. cheers Reinhard - 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]
c:choose and html:form
Is this legal? c:choose c:when test=${param.method == 'create'} html:form action=/signup/Signup onsubmit=return validateSignupForm(this); /c:when c:when test=${param.method == 'edit'} html:form action=/user/EditSignup onsubmit=return validateSignupForm(this); /c:when /c:choose Thanks, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: c:choose and html:form
I did that and it works, thanks, Erez -Original Message- From: Jason Lea [mailto:[EMAIL PROTECTED] Sent: Friday, August 15, 2003 4:09 AM To: Struts Users Mailing List Subject: Re: c:choose and html:form Erez Efrati wrote: Is this legal? c:choose c:when test=${param.method == 'create'} html:form action=/signup/Signup onsubmit=return validateSignupForm(this); /c:when c:when test=${param.method == 'edit'} html:form action=/user/EditSignup onsubmit=return validateSignupForm(this); /c:when /c:choose Thanks, Erez I think this would cause a problem because the JSP compiler would complain that the html:form tag is not being closed. It would want the /html:form tag to be nested at the same level as the opening tag. An option might be to use the html-el tags which should mean you can do something like c:choose c:when test=${param.method == 'create'} c:set var=formAction value=/signup/Signup/ /c:when c:when test=${param.method == 'edit'} c:set var=formAction value=/user/EditSignup/ /c:when /c:choose html:form action=${formAction} onsubmit=return validateSignupForm(this); -- Jason Lea - 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]
Action mapping 'inputForward'
Hi all, Is it recommended to use the 'inputForward'=true in the controller configuration? Thanks, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: No getter method -- Please HELP!
Yep, it is case sensivite.. in your JSP it's orgid.. not orgId as should be. Erez -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Friday, August 15, 2003 6:06 PM To: Struts Users Mailing List Subject: Re: No getter method -- Please HELP! You need to use the property name orgId in your JSP because your getter method is getOrgId(). David --- Mitesh Kapadia [EMAIL PROTECTED] wrote: Hello. I have been having some problems when trying to render my jsp. I get the following error message: org.apache.jasper.JasperException: No getter method for property orgid of bean org.apache.struts.taglib.html.BEAN My web.xml file has the following entry for servlet-mapping: !-- Action Servlet Mapping -- servlet-mapping servlet-nameaction/servlet-name url-pattern/do/*/url-pattern /servlet-mapping My struts-configm.xml file: !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.1//EN http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd; struts-config !-- Form Bean Definitions -- form-beans form-bean name=orgidActionForm type=net.reumann.OrgIdActionForm/ /form-beans !-- Action Mapping Definitions -- action-mappings action path=/setupEmployeeForm forward=/employeeForm.jsp/ action path=/orgidAction type=net.reumann.OrgIdAction name=orgidActionForm scope=request validate=true forward name=success path=/confirmation.jsp/ /action /action-mappings !-- message resources -- message-resources parameter=ApplicationResources null=false / /struts-config Here is the code from my index.jsp page: %@ taglib uri=struts/bean-el prefix=bean % %@ taglib uri=struts/html-el prefix=html % html head link href=html:rewrite page=/rr.css / rel=stylesheet type=text/css titleSTRUTS Benchmark/title /head body html:errors/ html:form action=/orgidAction focus=orgid table border=0 width=100% tr th align=right bean:message key=prompt.orgid/: /th td align=left html:text property=orgid size=16 maxlength=18/ /td /tr tr th align=right bean:message key=prompt.facilid/: /th td align=left html:password property=facilid size=16 maxlength=18/ /td /tr tr td align=right html:submit value=Submit/ /td td align=left html:reset/ /td /tr /table /html:form /body /html:html Here is the code from my OrgIdActionForm: package net.reumann; import org.apache.struts.action.*; import org.apache.struts.actions.*; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionMapping; import javax.servlet.http.HttpServletRequest; public class OrgIdActionForm extends ActionForm { private String orgid; private String facilid; public void setOrgId(String orgid) { this.orgid = orgid; } public void setFacilId(String facilid) { this.facilid= facilid; } public String getOrgId() { return orgid; } public String getFacilId() { return facilid; } public void reset(ActionMapping mapping, HttpServletRequest request) { this.orgid= null; this.facilid= null; } public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { String errorKey = OrgIdActionErrors; ActionErrors errors = new ActionErrors(); // orgid if (this.orgid.length() 4){ errors.add(errorKey, new ActionError(error.OrgIdActionForm.orgid.length)); errors.add(orgid, new ActionError(error.generic)); } // facilid else if(this.facilid.length() 6) { errors.add(errorKey, new ActionError(error.OrgIdActionForm.facilid.length)); errors.add(facilid, new ActionError(error.generic)); } return errors; } } __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe,
How to work with DispatchAction ?
I am trying to work with the DispatchAction that everybody is saying is such a good type of action. Say I have a 'RegAction' sub-classing DispatchAction with the following methods: edit, create, and save. I use html:link page=/reg.do?method='edit' / to go into edit. My question is: 1) Should I keep an action-mapping to each of the methods? 2) In RegAction.save(), after I've validated the form and found errors. I need to forward back to the input page, but I need to somehow add the 'edit' method. How do you recommend doing that? Do I append it to the action-forwards path with '?method=edit' in the action-mapping configuration? Please help, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to use DispatchAction ? (cont.)
To make it clearer, if I have the following methods: create - just displays the form with empty fields. edit - reads registration data from db and displays the form save - save registration data to/back to the db The RegAction (a DispatchAction) implements all three methods. In the JSP I have html:form action=/editReg.do html:hidden property='method' /html:form Since in my form I need to distinguish between 'create' and 'edit' when RegAction.save() finds a validation error it needs to forward back to the input page and add the '?method=edit' part, I guess? Could someone shed some light here, I am bit lost. Thanks, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to work with DispatchAction ? (please help)
Matt, thanks for replying, I almost though I'd never see one.. :-) I've really ran into a wall but somehow got out of it, still I am not really happy with the solution which is by the way close to what you described. I still would appreciate your help here: I have the 'method' field on my RegForm class, and I guess this is normal. On the RegAction DispatchAction I have 'create' 'edit' and 'update' methods. I use also a 'action' parameter to distinguish between two different workflows, can I avoid it? Here is the JSP (parts of it): ... script type=text/javascript !-- // sets the 'method' param function setMethod(method) { document.forms[0].method.value = method; } //-- /script html:form action=/reg.do html:hidden property=action/ html:hidden property=method value=create/ html:hidden property=page value=1/ ... c:choose c:when test=${regForm.action == 'create'} !-- continue button -- html:submit bean:message key=button.next/ /html:submit /c:when c:when test=${regForm.action == 'edit'} !-- save button -- html:submit onclick=setMethod('update'); bean:message key=button.save/ /html:submit /c:when /c:choose /html:form If RegAction.update() finds validation errors it needs to go back to the editing form, and restore the 'method' value to 'edit' or 'create' but it cannot know that once the value has changed to 'update'. That is why I keep an 'action' parameter on the side to differ between the two. Is there a better way - I hope there is :) Erez -Original Message- From: Sgarlata Matt [mailto:[EMAIL PROTECTED] Sent: Saturday, August 16, 2003 7:26 PM To: Struts Users Mailing List Subject: Re: How to work with DispatchAction ? Erez Efrati wrote: I am trying to work with the DispatchAction that everybody is saying is such a good type of action. Say I have a 'RegAction' sub-classing DispatchAction with the following methods: edit, create, and save. I use html:link page=/reg.do?method='edit' / to go into edit. My question is: 1) Should I keep an action-mapping to each of the methods? No. One of the nice things about DispatchActions is that they only require a single action-mapping. One disadvantage of a single action mapping is that it can only use a single form bean definition. I guess theoretically you could have a dispatch action with multiple action-mappings that each used different form beans, but I'm getting confused just thinking about it ;) My general rule is that one dispatch action has one action-mapping and one form bean definition. 2) In RegAction.save(), after I've validated the form and found errors. I need to forward back to the input page, but I need to somehow add the 'edit' method. How do you recommend doing that? Do I append it to the action-forwards path with '?method=edit' in the action-mapping configuration? Your dispatch actions sound very similar to mine: I have an add method, an edit method, and a save method. I also define two forwards: one to the form view (forward name=viewForm) and one to the detail view (forward name=viewDetails), which is the view the user sees after a successful save. If you find errors, shouldn't you just be able to do mapping.findForward(viewForm)? The form bean will still be populates with the values the user entered even if you are using a session-scoped bean :) Please help, Erez Matt - 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]