Using token-session with IE
Hi, I have a rather strange problem. I am using token-session interceptor to deal with the multiple requests problem. The relevant part of the struts.xml file is appended below. This works fine in Firefox (2 and 3 beta) but fails in IE7. When the form (which contains the s:token tag) submit button is clicked rapidly several times, a blank screen is displayed and the URL shown is the URL of the action. This is probably something to do with IE, and I would really appreciate any advice on how to solve this ... Thanks! <-- struts.xml snip --> thanks.html /applications/application.jsp thanks.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts 2 scheduler
We've successfully used Quartz in projects that also use Struts 2. Developing a basic implementation of a scheduler using Quartz seemed to be pretty straightforward ... Chamara -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2008 9:42 AM To: Struts Users Mailing List Subject: RE: Struts 2 scheduler --- "Peters, John" <[EMAIL PROTECTED]> wrote: > What kind of task, database cleanup? > Does it occur every minute, hour, day? > You might want to consider a stateless session EJB that implements a > TimerService. > Here are some examples > > http://www.theserverside.com/tt/articles/article.tss?l=MonsonHaefel-Colu > mn4 > > http://www.javabeat.net/javabeat/ejb3/articles/timer_services_api_in_ejb > _3_0_2.php > > Quartz isn't really worth the effort for small mundane tasks. But EJB is?! Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ NOD32 2940 (20080312) Information __ This message was checked by NOD32 antivirus system. http://www.eset.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: short-circuit="true" not working in field validator
Dave: Thank you for your help and advice. That indeed was the problem. I changed my app to use server side validation and now it is functioning as expected. Best regards, Chamara -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2008 6:41 PM To: Struts Users Mailing List Subject: RE: short-circuit="true" not working in field validator --- Chamara Gunaratne <[EMAIL PROTECTED]> wrote: > Ah. I'm not sure that the short-circuiting behavior works with client-side validation, although it probably should. I don't see any code in the generated JavaScript, however, that would enforce short-circuiting behavior. You may want to file a JIRA regarding this issue (if one hasn't been already); I think it's reasonable to assume that client-side validation should also short-circuit if the attribute is set. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ NOD32 2930 (20080307) Information __ This message was checked by NOD32 antivirus system. http://www.eset.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: short-circuit="true" not working in field validator
Dave: Thank you, here's the files: ApplicationAction-validation.xml: http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd";> Please enter your first name. ^[a-z.\-, A-Z]+$ First Name may only contain letters, spaces or periods Please enter your last name. ^[a-z.\-, A-Z]+$ Last Name may only contain letters, spaces or periods jsp: struts.xml action: thanks.html /applications/application.jsp -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2008 6:00 PM To: Struts Users Mailing List Subject: RE: short-circuit="true" not working in field validator Please repost your configs, JSP, and action; I'll look at it again. Dave --- Chamara Gunaratne <[EMAIL PROTECTED]> wrote: > Hmmm, I tried setting the log level to DEBUG and it yielded a mass of > logging entries, but nothing that was particularly insightful. Grepping on > short-circuit, validator, etc didn't bring out anything useful. > > Very strange problem, everything else seems to be working fine and I cannot > find anywhere I have deviated from the documentation ... > > Chamara > > -Original Message- > From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper > Sent: Wednesday, March 05, 2008 2:44 PM > To: user@struts.apache.org > Subject: Re: short-circuit="true" not working in field validator > > Chamara Gunaratne wrote: > > Dave: > > Thank you for your reply. I changed type attribute to "requiredstring". > But > > it doesn't help with the short-circuit problem. > > > > Yes, both the first name and last name validators fire successfully and > the > > regex is correctly evaluated. Just the short-circuit part is not working. > > > > > For example, if I submit a blank first name field, I get both error > > messages: "Please enter your first name" and "First Name may only contain > > letters, spaces, dashes, or periods". > > Cheers, > > AFAICT from the Validation documentation, it should be working as you > expect. I would suggest turning logging up to DEBUG for Struts and/or > XWork (probably XWork?) and see if you get anything that sheds light on > what's going wrong. > > L. > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: short-circuit="true" not working in field validator
Hmmm, I tried setting the log level to DEBUG and it yielded a mass of logging entries, but nothing that was particularly insightful. Grepping on short-circuit, validator, etc didn't bring out anything useful. Very strange problem, everything else seems to be working fine and I cannot find anywhere I have deviated from the documentation ... Chamara -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper Sent: Wednesday, March 05, 2008 2:44 PM To: user@struts.apache.org Subject: Re: short-circuit="true" not working in field validator Chamara Gunaratne wrote: > Dave: > Thank you for your reply. I changed type attribute to "requiredstring". But > it doesn't help with the short-circuit problem. > > Yes, both the first name and last name validators fire successfully and the > regex is correctly evaluated. Just the short-circuit part is not working. > > For example, if I submit a blank first name field, I get both error > messages: "Please enter your first name" and "First Name may only contain > letters, spaces, dashes, or periods". > Cheers, AFAICT from the Validation documentation, it should be working as you expect. I would suggest turning logging up to DEBUG for Struts and/or XWork (probably XWork?) and see if you get anything that sheds light on what's going wrong. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ NOD32 2924 (20080305) Information __ This message was checked by NOD32 antivirus system. http://www.eset.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: short-circuit="true" not working in field validator
Thank you, I will try that out and see. I guess it is XWork, at least from what I can figure out from the documentation. Chamara -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper Sent: Wednesday, March 05, 2008 2:44 PM To: user@struts.apache.org Subject: Re: short-circuit="true" not working in field validator Chamara Gunaratne wrote: > Dave: > Thank you for your reply. I changed type attribute to "requiredstring". But > it doesn't help with the short-circuit problem. > > Yes, both the first name and last name validators fire successfully and the > regex is correctly evaluated. Just the short-circuit part is not working. > > For example, if I submit a blank first name field, I get both error > messages: "Please enter your first name" and "First Name may only contain > letters, spaces, dashes, or periods". > Cheers, AFAICT from the Validation documentation, it should be working as you expect. I would suggest turning logging up to DEBUG for Struts and/or XWork (probably XWork?) and see if you get anything that sheds light on what's going wrong. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ NOD32 2924 (20080305) Information __ This message was checked by NOD32 antivirus system. http://www.eset.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: short-circuit="true" not working in field validator
Is anybody using the short-circuit attribute in the validations successfully? -Original Message- From: Chamara Gunaratne [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 05, 2008 12:56 PM To: 'Struts Users Mailing List' Subject: RE: short-circuit="true" not working in field validator -Original Message- From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 05, 2008 12:38 PM To: Struts Users Mailing List Subject: Re: short-circuit="true" not working in field validator by what Im seeing from XWork validators the first 'required' validator you declared is unnecessary as the second regex validator will identify that condition http://struts.apache.org/2.x/struts2-core/apidocs/com/opensymphony/xwork2/va lidator/Validator.html Anyone? M- ----- Original Message - From: "Chamara Gunaratne" <[EMAIL PROTECTED]> To: "'Struts Users Mailing List'" Sent: Wednesday, March 05, 2008 11:16 AM Subject: RE: short-circuit="true" not working in field validator > -Original Message- > From: Dave Newton [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 05, 2008 10:54 AM > To: Struts Users Mailing List > Subject: Re: short-circuit="true" not working in field validator > > --- Chamara Gunaratne <[EMAIL PROTECTED]> wrote: > > I am using struts2 to validate form input. For some reason I can't figure > > out, the short-circuit="true" attribute is not working. Everything else > > seems to be working fine. The validation rules are embedded in a > > action_class_name-validation.xml file. Here's a sample from the xml file: > > > > > > > > > > Please enter your first name. > > > > > > > > ^[a-z.\-, A-Z]+$ > > First Name may only contain letters, spaces, dashes, > > or > > periods > > > > > > > > > > > > Please enter your last name. > > > > > > ^[a-z.\-, A-Z]+$ > > Last Name may only contain letters, spaces, dashes, > or > > periods > > > > > > > > > > > > If the form is submitted with a blank user.firstName field, I would get > > both > > error messages. From what I understand of how the validations work, only > > the > > first test would fire if short-circuit is enabled. > > I'm surprised the first "required" validator is firing at all; normally > you'd > use "requiredstring" for a text field; a "required" validator will never > (more or less) fire for a text field in an HTML form. > > Is the lastName validation working properly? If so then perhaps you've > spelled the name of your field wrong on the form. > > Dave > > > Dave: > Thank you for your reply. I changed type attribute to "requiredstring". But > it doesn't help with the short-circuit problem. > > Yes, both the first name and last name validators fire successfully and the > regex is correctly evaluated. Just the short-circuit part is not working. > > For example, if I submit a blank first name field, I get both error > messages: "Please enter your first name" and "First Name may only contain > letters, spaces, dashes, or periods". > Cheers, > > Chamara > > Martin: The first name and last name validation examples that I've given are not that complex. Yes, they can be combined into one validation rule using the regex. But there are more complex input validations where for the sake of clarity and ease of debugging, I would like to break up the validation into several rules. Right now, without the short-circuit working, this causes several error messages to be displayed for each input field. Cheers, Chamara - 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: short-circuit="true" not working in field validator
-Original Message- From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 05, 2008 12:38 PM To: Struts Users Mailing List Subject: Re: short-circuit="true" not working in field validator by what Im seeing from XWork validators the first 'required' validator you declared is unnecessary as the second regex validator will identify that condition http://struts.apache.org/2.x/struts2-core/apidocs/com/opensymphony/xwork2/va lidator/Validator.html Anyone? M- - Original Message - From: "Chamara Gunaratne" <[EMAIL PROTECTED]> To: "'Struts Users Mailing List'" Sent: Wednesday, March 05, 2008 11:16 AM Subject: RE: short-circuit="true" not working in field validator > -Original Message- > From: Dave Newton [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 05, 2008 10:54 AM > To: Struts Users Mailing List > Subject: Re: short-circuit="true" not working in field validator > > --- Chamara Gunaratne <[EMAIL PROTECTED]> wrote: > > I am using struts2 to validate form input. For some reason I can't figure > > out, the short-circuit="true" attribute is not working. Everything else > > seems to be working fine. The validation rules are embedded in a > > action_class_name-validation.xml file. Here's a sample from the xml file: > > > > > > > > > > Please enter your first name. > > > > > > > > ^[a-z.\-, A-Z]+$ > > First Name may only contain letters, spaces, dashes, > > or > > periods > > > > > > > > > > > > Please enter your last name. > > > > > > ^[a-z.\-, A-Z]+$ > > Last Name may only contain letters, spaces, dashes, > or > > periods > > > > > > > > > > > > If the form is submitted with a blank user.firstName field, I would get > > both > > error messages. From what I understand of how the validations work, only > > the > > first test would fire if short-circuit is enabled. > > I'm surprised the first "required" validator is firing at all; normally > you'd > use "requiredstring" for a text field; a "required" validator will never > (more or less) fire for a text field in an HTML form. > > Is the lastName validation working properly? If so then perhaps you've > spelled the name of your field wrong on the form. > > Dave > > > Dave: > Thank you for your reply. I changed type attribute to "requiredstring". But > it doesn't help with the short-circuit problem. > > Yes, both the first name and last name validators fire successfully and the > regex is correctly evaluated. Just the short-circuit part is not working. > > For example, if I submit a blank first name field, I get both error > messages: "Please enter your first name" and "First Name may only contain > letters, spaces, dashes, or periods". > Cheers, > > Chamara > > Martin: The first name and last name validation examples that I've given are not that complex. Yes, they can be combined into one validation rule using the regex. But there are more complex input validations where for the sake of clarity and ease of debugging, I would like to break up the validation into several rules. Right now, without the short-circuit working, this causes several error messages to be displayed for each input field. Cheers, Chamara - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: short-circuit="true" not working in field validator
-Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 05, 2008 10:54 AM To: Struts Users Mailing List Subject: Re: short-circuit="true" not working in field validator --- Chamara Gunaratne <[EMAIL PROTECTED]> wrote: > I am using struts2 to validate form input. For some reason I can't figure > out, the short-circuit="true" attribute is not working. Everything else > seems to be working fine. The validation rules are embedded in a > action_class_name-validation.xml file. Here's a sample from the xml file: > > > > > Please enter your first name. > > > > ^[a-z.\-, A-Z]+$ > First Name may only contain letters, spaces, dashes, > or > periods > > > > > > Please enter your last name. > > > ^[a-z.\-, A-Z]+$ > Last Name may only contain letters, spaces, dashes, or > periods > > > > > > If the form is submitted with a blank user.firstName field, I would get > both > error messages. From what I understand of how the validations work, only > the > first test would fire if short-circuit is enabled. I'm surprised the first "required" validator is firing at all; normally you'd use "requiredstring" for a text field; a "required" validator will never (more or less) fire for a text field in an HTML form. Is the lastName validation working properly? If so then perhaps you've spelled the name of your field wrong on the form. Dave Dave: Thank you for your reply. I changed type attribute to "requiredstring". But it doesn't help with the short-circuit problem. Yes, both the first name and last name validators fire successfully and the regex is correctly evaluated. Just the short-circuit part is not working. For example, if I submit a blank first name field, I get both error messages: "Please enter your first name" and "First Name may only contain letters, spaces, dashes, or periods". Cheers, Chamara - 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]
short-circuit="true" not working in field validator
Hello, I am using struts2 to validate form input. For some reason I can't figure out, the short-circuit="true" attribute is not working. Everything else seems to be working fine. The validation rules are embedded in a action_class_name-validation.xml file. Here's a sample from the xml file: Please enter your first name. ^[a-z.\-, A-Z]+$ First Name may only contain letters, spaces, dashes, or periods Please enter your last name. ^[a-z.\-, A-Z]+$ Last Name may only contain letters, spaces, dashes, or periods If the form is submitted with a blank user.firstName field, I would get both error messages. From what I understand of how the validations work, only the first test would fire if short-circuit is enabled. The app is running in Tomcat 5.5.23. I've tested with both Windows and Linux and the result is the same. These are the struts libraries that I am using (placed in the WEB-INF/lib of the context) : freemarker-2.3.8.jar ognl-2.6.11.jar struts2-core-2.0.11.jar xwork-2.1.0.jar I would greatly appreciate any advice on how to solve this problem J Chamara