validator form not working
hi to all, i am using validator form to validate my fields...but it is not working.. my pulgins used in struts-config.xml file is plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml/ /plug-in validation.xml form is formset form name=employeeForm field property=age depends=required,minlength,maxlength,integer arg0 key=profile.age/ arg1 key=${var:maxlength} name=maxlength resource=false/ arg1 key=${var:minlength} name=minlength resource=false/ var var-nameminlength/var-name var-value2/var-value /var var var-namemaxlength/var-name var-value2/var-value /var /field field property=department depends=required,maxlength arg0 key=profile.department/ arg1 key=${var:maxlength} name=maxlength resource=false/ arg1 key=${var:minlength} name=minlength resource=false/ var var-namemaxlength/var-name var-value15/var-value /var /field field property=project depends=required,maxlength arg0 key=profile.project/ arg1 key=${var:maxlength} name=maxlength resource=false/ arg1 key=${var:minlength} name=minlength resource=false/ var var-namemaxlength/var-name var-value100/var-value /var /field field property=emailid depends=required,email,maxlength arg0 key=profile.emailid/ arg1 key=${var:maxlength} name=maxlength resource=false/ arg1 key=${var:minlength} name=minlength resource=false/ var var-namemaxlength/var-name var-value20/var-value /var /field /form /formset i am using single form in application thus only on validationform is .EmployeeForm.java plz help thanks in advanced Regards Nishant Patil Software Engineer Cybage Softwares Pvt. Ltd. (A CMM Level 3 Company) West Avenue, Kalyaninagar Pune - 411006 [EMAIL PROTECTED] www.cybage.com There is difference between knowing the Path and walking on the Path
Re: sending/maintaning a download link
Hello Guys, I am about to start on this module below. I have asked this I think a month ago and only after finishing the rest of my small website will I implement this. Anyway im on track on learning the token creation for struts and the quartzs plugin. I was wondering if I will be sending the file streaming or I can just have a forward in my action mapping that would serialized the file? Thanks in advance Richard On Wed, 13 Oct 2004 10:12:38 -0700, Wiebe de Jong [EMAIL PROTECTED] wrote: The only way to make a link go away is to make it dynamic. That means that the link you email will have to be to an action that returns the file. There have been quite a few threads recently on this mailing list about how to get actions to return files, including .pdf and .csv, so I won't cover that here. Here is a list of steps for how I would go about implementing this feature: 1 - generate a unique token and store it in the database with a timestamp=now() and status=valid. 2 - add this token to the url you send in the email: http://www.mycompany.com/myapp/download.do?token=123abc 3 - when the user calls the action via the supplied url, the action checks the database to see if the token is still valid. 4 - if token is valid, send the file, and then invalidate the token so it can't be used again. (status=used) 5 - if token not valid, display a message to the user telling them that the link has either expired or already been used. 6 - have a background process run periodically (1 per day, every hour, whatever) that checks the timestamps in the database and expires tokens if the timestamp is more than 24 hours old. (status=expired) The background process can be run via Quartz, which was also covered recently in this list. Wiebe de Jong -Original Message- From: Richard [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 13, 2004 2:14 AM To: Struts Users Mailing List Subject: sending/maintaning a download link hi guys, how do i do this in struts? i want to send a download link ( via email - resolved ) to a newly registered user and that download link will expire after 24hrs. is there and apache project for this? please help thanks in advance richard - 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]
[OT] - Blog and Forum plugin
Hi Guys, I am tasked to add a Blog and Forum capability on my webapp. Its using Struts and JSP. I was wondering if some of you might have some suggestions for some open source components that I could use. If its not too much please add if you could its advantages and disadvantages. Thanks in advance. Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
XML n XSL using JSP
hi to all , i am using struts tomcat , i hav several queries .. 1. From where i can get xml.tld file. 2. From where i can get the tutorial for XSL using JSp bcz when i search on google it will not shownin the sites of my interest... please help thankz in advanced ... Regards Nishant Patil Software Engineer There is difference between knowing the Path and walking on the Path
Re: Help with message resource on Struts module
Sadly, nobody gave me any useful help with this issue. Fortunately I have found the answer myself looking at the DTD for struts-config.xml files: The module prefix (if any) is appended to the key (${key}${prefix}). So, in my JSP I should have written something like: bean:message bundle=mymodulekey/mymodule key=gs.filters.title/ On Fri, 19 Nov 2004 10:49:56 +0200, Radu Badita [EMAIL PROTECTED] wrote: Actually you are right - it is a typo, but only in the email (in the real files I have other names, and there are spelled right). At 21:53 18.11.2004, you wrote: Maybe this is just a typo but shouldn't you be using 'bundle=mymodulekey' instead of 'bundle=mymodule'? bean:message bundle=mymodulekey key=gs.filters.title/ Radu Badita wrote: Hello, I have a Struts module with the following message bundle: message-resources parameter=mymodule.Application key=mymodulekey / Inside an Action I can get messages from it with: dateFormat = getResources(request,mymodulekey).getMessage(date.format); and it works fine. But this Action forwards to a jsp in which I have this tag: bean:message bundle=mymodule key=gs.filters.title/ it doesn't work because it cannot find the bundle in any scope. Can anyone please help me with this? Maybe I don't use the bean:message / as it should be used... Thanks Radu - 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: Multi-Page Wizard Validation Problem
I'm trying only server side validation. I'm using struts 1.2.4. -jeff On Nov 21, 2004, at 10:19 PM, David G. Friedman wrote: Jeff, Are you trying both server side validation and client-side validation? I.E. html:javascript formName=... etc... What version of Struts are you using? Regards, David -Original Message- From: Jeff Smith [mailto:[EMAIL PROTECTED] Sent: Sunday, November 21, 2004 11:59 PM To: Struts Users Mailing List Subject: Re: Multi-Page Wizard Validation Problem David, Yes reg.step1, reg.step2 and reg.step3 all have hiddens for page and they're set accordingly. 1 for reg.step1, etc. And yes, they're tiles. As for the /reg/registration action, that was a bit of a typo that I accidentally left in there from a trial and error session. The actual action should read like this: action path=/reg/registration forward=reg.step1 /action Also, the other actions would be more aptly named something like processStep1 instead of step1, but you get the gist. So the problem remains, next and previous work great but I get no validation between the pages. I did fix the page number not being set by adding a page to the form bean definition, this appears to work now and the DynaActionValidatorForm invokes the setPageFromDynaProperty method with the correct value. So half of the problem is fixed :) Its just the validation that remains. -jeff On Nov 21, 2004, at 9:27 PM, David G. Friedman wrote: Jeff, Do the pages reg.step1, reg.step2, and reg.step3 all do an html hidden tag for the page variable such as: html:hidden name=page value=X / Substitute X for the appropriate page number. Also, I think you have an infinite loop when you set the /reg/registration action to call it's own action upon validation failure (the input=... attribute). Shouldn't you set it to reg.step1 if validation fails? I'm assuming reg.step1, reg.step2, and reg.step3 are tiles. Additionally, calling a *.do Struts action from within another struts action is not the wisest course of action UNLESS you are doing a redirect=true on your forward. Without the redirect=true, Struts will perform the whole set of preprocessing again when the new *.do action is invoked. This repeats everything struts ALREADY performed to get to your first action. Essentially, it is a big waste of time/resources/cpu. Regards, David -Original Message- From: Jeff Smith [mailto:[EMAIL PROTECTED] Sent: Sunday, November 21, 2004 2:15 PM To: Struts Users Mailing List Subject: Re: Multi-Page Wizard Validation Problem Let me paste the files in instead -- struts config starts here -- ?xml version=1.0 encoding=iso-8859-1? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.2//EN http://struts.apache.org/dtds/struts-config_1_2.dtd; struts-config !-- Form Bean Definitions -- form-beans form-bean name=registrationForm type=org.apache.struts.validator.DynaValidatorActionForm !-- Page One -- form-property name=firstName type=java.lang.String/ form-property name=middleName type=java.lang.String/ form-property name=lastName type=java.lang.String/ form-property name=username type=java.lang.String/ form-property name=password type=java.lang.String/ form-property name=password2 type=java.lang.String/ !-- Page Two -- form-property name=birthDate type=java.lang.String/ !-- Page Three -- form-property name=street1 type=java.lang.String/ form-property name=street2 type=java.lang.String/ form-property name=city type=java.lang.String/ form-property name=state type=java.lang.String/ form-property name=country type=java.lang.String/ form-property name=postalCode type=java.lang.String/ /form-bean /form-beans !-- Action Mappings -- action-mappings action path=/reg/step1 parameter=command type=com.rochets.application.action.RegistrationAction name=registrationForm scope=session validate=true input=reg.step1 forward name=next path=reg.step2/ forward name=cancel path=/WEB-INF/jsp/mywizardcancel.jsp/ /action action path=/reg/step2 parameter=command type=com.rochets.application.action.RegistrationAction name=registrationForm scope=session validate=true input=reg.step2 forward name=previous path=reg.step1/ forward name=next path=reg.step3/ forward name=finish path=/WEB-INF/jsp/mywizarddone.jsp/ forward name=cancel path=/WEB-INF/jsp/mywizardcancel.jsp/ /action action path=/reg/step3 parameter=command
Struts 1.2.4/Validator 1.1.3 and constant validation issue with '' for constant-value
Hello. I'm trying to create a mask for use in password fields that accepts: - UPPERCASE A-Z - lowercase a-z - Numbers 0-9 - Special Characters !,@,#,$,%,^,,(,), and * In the validation.xml file I have the following defined. form-validation global constant constant-namepassword/constant-name constant-value[EMAIL PROTECTED]*()]*$/constant-value /constant /global ... ... /form-validation When I start my application server (Tomcat 5.x) and the struts validation code starts to load my rules I get the following messages: 11-04-2004 11:46:19 struts.validator.ValidatorPlugIn - Loading validation rules file from '/WEB-INF/validator-rules.xml' 11-04-2004 11:46:19 struts.validator.ValidatorPlugIn - Loading validation rules file from '/WEB-INF/validator-rules-custom.xml' 11-04-2004 11:46:19 struts.validator.ValidatorPlugIn - Loading validation rules file from '/WEB-INF/validation.xml' 11-04-2004 11:46:20 commons.digester.Digester - Parse Fatal Error at line 22 column 39: The entity name must immediately follow the '' in the entity reference. org.xml.sax.SAXParseException: The entity name must immediately follow the '' in the entity reference. Removing the '' from the constant-value allows the application to start properly, however I can't use the '' as a valid input character. Going to the url below to use the regexp sample applet, my original string with the '' does work. http://jakarta.apache.org/regexp/applet.html Regular Expression: [EMAIL PROTECTED]*()]* String: [EMAIL PROTECTED]()^done I am using commons-validator 1.1.3 with Struts 1.2.4 Any thoughts, fixes, or suggestions are much appreciated. Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multi-Page Wizard Validation Problem
I believe you need a form-property named 'page' with a type of 'java.lang.Integer'. -Bill Siggelkow Jeff Smith wrote: Let me paste the files in instead -- struts config starts here -- ?xml version=1.0 encoding=iso-8859-1? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.2//EN http://struts.apache.org/dtds/struts-config_1_2.dtd; struts-config !-- Form Bean Definitions -- form-beans form-bean name=registrationForm type=org.apache.struts.validator.DynaValidatorActionForm !-- Page One -- form-property name=firstName type=java.lang.String/ form-property name=middleName type=java.lang.String/ form-property name=lastName type=java.lang.String/ form-property name=username type=java.lang.String/ form-property name=password type=java.lang.String/ form-property name=password2 type=java.lang.String/ !-- Page Two -- form-property name=birthDate type=java.lang.String/ !-- Page Three -- form-property name=street1 type=java.lang.String/ form-property name=street2 type=java.lang.String/ form-property name=city type=java.lang.String/ form-property name=state type=java.lang.String/ form-property name=country type=java.lang.String/ form-property name=postalCode type=java.lang.String/ /form-bean /form-beans !-- Action Mappings -- action-mappings action path=/reg/step1 parameter=command type=com.rochets.application.action.RegistrationAction name=registrationForm scope=session validate=true input=reg.step1 forward name=next path=reg.step2/ forward name=cancel path=/WEB-INF/jsp/mywizardcancel.jsp/ /action action path=/reg/step2 parameter=command type=com.rochets.application.action.RegistrationAction name=registrationForm scope=session validate=true input=reg.step2 forward name=previous path=reg.step1/ forward name=next path=reg.step3/ forward name=finish path=/WEB-INF/jsp/mywizarddone.jsp/ forward name=cancel path=/WEB-INF/jsp/mywizardcancel.jsp/ /action action path=/reg/step3 parameter=command type=com.rochets.application.action.RegistrationAction name=registrationForm scope=session validate=true input=reg.step3 forward name=previous path=reg.step3/ forward name=finish path=/WEB-INF/jsp/mywizarddone.jsp/ forward name=cancel path=/WEB-INF/jsp/mywizardcancel.jsp/ /action action path=/reg/registration parameter=command name=registrationForm scope=session type=com.rochets.application.action.RegistrationAction validate=true input=/reg/registration.do forward name=next path=reg.step1/ /action /action-mappings message-resources parameter=resources.reg.Registration null=false/ plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/struts/reg/validation.xml/ /plug-in /struts-config -- validation.xml starts here -- ?xml version=1.0 encoding=iso-8859-1? !DOCTYPE form-validation PUBLIC -//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd; form-validation formset form name=registrationForm !-- Page One -- field property=firstName depends=required,mask,minlength,maxlength page=1 arg key=firstname position=0/ arg name=minlength key=${var:minlength} resource=false position=1/ var var-namemask/var-name var-value^\w+$/var-value /var var var-nameminlength/var-name var-value2/var-value /var var var-namemaxlength/var-name var-value255/var-value /var /field field property=middleName depends=mask,maxlength page=1 arg key=firstname position=0/ var var-namemask/var-name var-value^\w+$/var-value /var var var-namemaxlength/var-name var-value255/var-value /var /field field property=lastName depends=required,mask,minlength,maxlength page=1 arg key=lastname position=0/ arg
RE: Struts 1.2.4/Validator 1.1.3 and constant validation issue with '' for constant-value
it's an xml thing, try putting amp; instead of as is a special character for xml which starts an entity, and amp; is the entity for an ampersand :-) -Original Message- From: Brian Bezanson [mailto:[EMAIL PROTECTED] Sent: 22 November 2004 14:21 To: Struts Users Mailing List Subject: Struts 1.2.4/Validator 1.1.3 and constant validation issue with '' for constant-value Hello. I'm trying to create a mask for use in password fields that accepts: - UPPERCASE A-Z - lowercase a-z - Numbers 0-9 - Special Characters !,@,#,$,%,^,,(,), and * In the validation.xml file I have the following defined. form-validation global constant constant-namepassword/constant-name constant-value[EMAIL PROTECTED]*()]*$/constant-value /constant /global ... ... /form-validation When I start my application server (Tomcat 5.x) and the struts validation code starts to load my rules I get the following messages: 11-04-2004 11:46:19 struts.validator.ValidatorPlugIn - Loading validation rules file from '/WEB-INF/validator-rules.xml' 11-04-2004 11:46:19 struts.validator.ValidatorPlugIn - Loading validation rules file from '/WEB-INF/validator-rules-custom.xml' 11-04-2004 11:46:19 struts.validator.ValidatorPlugIn - Loading validation rules file from '/WEB-INF/validation.xml' 11-04-2004 11:46:20 commons.digester.Digester - Parse Fatal Error at line 22 column 39: The entity name must immediately follow the '' in the entity reference. org.xml.sax.SAXParseException: The entity name must immediately follow the '' in the entity reference. Removing the '' from the constant-value allows the application to start properly, however I can't use the '' as a valid input character. Going to the url below to use the regexp sample applet, my original string with the '' does work. http://jakarta.apache.org/regexp/applet.html Regular Expression: [EMAIL PROTECTED]*()]* String: [EMAIL PROTECTED]()^done I am using commons-validator 1.1.3 with Struts 1.2.4 Any thoughts, fixes, or suggestions are much appreciated. Brian - 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]
Alternate bundle with ActionMessage
Hi, I have a problem related with using a keyed MessageResources in a module and creating an ActionMessage with keys from it. Sorry if it has been discussed before, but I haven't found anything searching the list... So here it is: in my module I have defined a message-resource with a key (let's say myresources) and when the form is validated I want to create an ActionMessage specifying a key from this resource. My question is how should I do this? If I manually get a message from the resource like this: String paramLabel = ((MessageResources) request.getSession().getServletContext() .getAttribute(Constants.MESSAGE_BUNDLE)) .getMessage(reports.param. + paramId + .prompt); it works fine. But how do I construct an ActionMessage with another key from it? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] - Blog and Forum plugin
Roller blog for blogging at http://www.rollerweblogger.org/page/project - Original Message - From: Richard [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, November 22, 2004 4:43 AM Subject: [OT] - Blog and Forum plugin Hi Guys, I am tasked to add a Blog and Forum capability on my webapp. Its using Struts and JSP. I was wondering if some of you might have some suggestions for some open source components that I could use. If its not too much please add if you could its advantages and disadvantages. Thanks in advance. Richard - 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: Multi-Page Wizard Validation Problem
I added that, it fixes the page always resetting problem, but still no validation between page changes. On Nov 22, 2004, at 7:26 AM, Bill Siggelkow wrote: I believe you need a form-property named 'page' with a type of 'java.lang.Integer'. -Bill Siggelkow Jeff Smith wrote: Let me paste the files in instead -- struts config starts here -- ?xml version=1.0 encoding=iso-8859-1? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.2//EN http://struts.apache.org/dtds/struts-config_1_2.dtd; struts-config !-- Form Bean Definitions -- form-beans form-bean name=registrationForm type=org.apache.struts.validator.DynaValidatorActionForm !-- Page One -- form-property name=firstName type=java.lang.String/ form-property name=middleName type=java.lang.String/ form-property name=lastName type=java.lang.String/ form-property name=username type=java.lang.String/ form-property name=password type=java.lang.String/ form-property name=password2 type=java.lang.String/ !-- Page Two -- form-property name=birthDate type=java.lang.String/ !-- Page Three -- form-property name=street1 type=java.lang.String/ form-property name=street2 type=java.lang.String/ form-property name=city type=java.lang.String/ form-property name=state type=java.lang.String/ form-property name=country type=java.lang.String/ form-property name=postalCode type=java.lang.String/ /form-bean /form-beans !-- Action Mappings -- action-mappings action path=/reg/step1 parameter=command type=com.rochets.application.action.RegistrationAction name=registrationForm scope=session validate=true input=reg.step1 forward name=next path=reg.step2/ forward name=cancel path=/WEB-INF/jsp/mywizardcancel.jsp/ /action action path=/reg/step2 parameter=command type=com.rochets.application.action.RegistrationAction name=registrationForm scope=session validate=true input=reg.step2 forward name=previous path=reg.step1/ forward name=next path=reg.step3/ forward name=finish path=/WEB-INF/jsp/mywizarddone.jsp/ forward name=cancel path=/WEB-INF/jsp/mywizardcancel.jsp/ /action action path=/reg/step3 parameter=command type=com.rochets.application.action.RegistrationAction name=registrationForm scope=session validate=true input=reg.step3 forward name=previous path=reg.step3/ forward name=finish path=/WEB-INF/jsp/mywizarddone.jsp/ forward name=cancel path=/WEB-INF/jsp/mywizardcancel.jsp/ /action action path=/reg/registration parameter=command name=registrationForm scope=session type=com.rochets.application.action.RegistrationAction validate=true input=/reg/registration.do forward name=next path=reg.step1/ /action /action-mappings message-resources parameter=resources.reg.Registration null=false/ plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/struts/reg/validation.xml/ /plug-in /struts-config -- validation.xml starts here -- ?xml version=1.0 encoding=iso-8859-1? !DOCTYPE form-validation PUBLIC -//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd; form-validation formset form name=registrationForm !-- Page One -- field property=firstName depends=required,mask,minlength,maxlength page=1 arg key=firstname position=0/ arg name=minlength key=${var:minlength} resource=false position=1/ var var-namemask/var-name var-value^\w+$/var-value /var var var-nameminlength/var-name var-value2/var-value /var var var-namemaxlength/var-name var-value255/var-value /var /field field property=middleName depends=mask,maxlength page=1 arg key=firstname position=0/ var var-namemask/var-name var-value^\w+$/var-value /var var var-namemaxlength/var-name var-value255/var-value /var /field
Re: Struts Validator and Nested Beans
The Validator plug in can recognize fields names such as employee.name, and that's the extent of my experience with it. Nested forms/tags allow you to go much deeper than that, and everytime I do, I choose to use my own validate() implementation instead of using Validator. On Mon, 22 Nov 2004 09:46:32 -0500, David McReynolds [EMAIL PROTECTED] wrote: I've not been able to find any examples so I was hoping someone may have tried this before. I am making copious use of nesting on my forms and I was wondering if this will prevent me from using the Struts validation framework? --dlm - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Switching modules
Modules are contained within one web application -- you cannot switch modules between web applications. This section from the Struts User's Guide should help: http://struts.apache.org/userGuide/configuration.html#dd_config_modules -Bill Siggelkow Gopinathan,Sekar wrote: I am creating a sample application Sample.ear containing Commons.jar,HelloWorld.jar,HelloWorld1.war and HelloWorld2.war and the application.xml in the META-INF directory in an exploded .ear directory.My This application represents what I want to do. Currently I have all the applications packaged as one war and one module. So app1 can use the pages/actions developed in app2 without much problems.This however created a huge struts-config.xml and made development in teams difficult. Now we want to split this one big war into multiple web applications. When doing this I realized that we have to use something like switching modules functionality in 1.1. So I am trying out this sample. This sample uses input.jsp to get a name and send this information to an ejb and ejb decides if the given person is a member or a non member(hard coded). Once the ejb gets back to the action with a Boolean value the action object forwards it to a member.jsp(which is in helloworld1.war) or to nonmember.jsp(which is in helloworld2). However I run into a problem with running this sample.If the given name is a member then member.jsp is displayed. When the given name is not a member it fails to pick up nonmember.jsp from the other war. I followed the instructions given in the guide and I am using a local forward to make this happen. HelloWorld1.war has the following struts-config.xml. action path =/helloworld type =HelloWorldAction name =helloForm scope=request input=/jsp/input.jsp forward name=member path=/jsp/member.jsp/ forward name=nonmember contextRelative=true path=/helloworld2/jsp/nonmember.jsp redirect=true/ /action I also added the following lines in the web.xml init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param init-param param-nameconfig/helloworld2/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param My Helloworld2.war has a /jsp directory with the nonmember.jsp and the context is named helloworld2. I would appreciate if any one can help me solve the mystery (or my stupidity...:)) here. Note: I am using struts 1.1. Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] - Blog and Forum plugin
You also could use mapleBlog which uses Struts and tiles http://www.resynthesize.com/code/ Al -Original Message- From: e-denton Java Programmer [mailto:[EMAIL PROTECTED] Sent: Monday, November 22, 2004 9:54 AM To: Struts Users Mailing List; Richard Subject: Re: [OT] - Blog and Forum plugin Roller blog for blogging at http://www.rollerweblogger.org/page/project - Original Message - From: Richard [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, November 22, 2004 4:43 AM Subject: [OT] - Blog and Forum plugin Hi Guys, I am tasked to add a Blog and Forum capability on my webapp. Its using Struts and JSP. I was wondering if some of you might have some suggestions for some open source components that I could use. If its not too much please add if you could its advantages and disadvantages. Thanks in advance. Richard - 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: Tiles and on-load events
Hi, Thanks for the tips - that javascript works perfectly. The only issue is that once I start the onload event, any attempts to navigate away from the page are ignored. Is there a way I can use the unload functions to break out of the loop if I were to include a stop button? Thanks, Andy _ It's fast, it's easy and it's free. Get MSN Messenger today! http://www.msn.co.uk/messenger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: validator form not working
Make sure that the files for the validator plug-in do exist in the specified location. Also, make sure that the ActionForm for employeeForm extends ValidatorForm or DynaValidatorForm. Also, make sure that 'validate=true' is set on your action mapping in the struts-config.xml. -Bill Siggelkow Nishant wrote: hi to all, i am using validator form to validate my fields...but it is not working.. my pulgins used in struts-config.xml file is plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml/ /plug-in validation.xml form is formset form name=employeeForm field property=age depends=required,minlength,maxlength,integer arg0 key=profile.age/ arg1 key=${var:maxlength} name=maxlength resource=false/ arg1 key=${var:minlength} name=minlength resource=false/ var var-nameminlength/var-name var-value2/var-value /var var var-namemaxlength/var-name var-value2/var-value /var /field field property=department depends=required,maxlength arg0 key=profile.department/ arg1 key=${var:maxlength} name=maxlength resource=false/ arg1 key=${var:minlength} name=minlength resource=false/ var var-namemaxlength/var-name var-value15/var-value /var /field field property=project depends=required,maxlength arg0 key=profile.project/ arg1 key=${var:maxlength} name=maxlength resource=false/ arg1 key=${var:minlength} name=minlength resource=false/ var var-namemaxlength/var-name var-value100/var-value /var /field field property=emailid depends=required,email,maxlength arg0 key=profile.emailid/ arg1 key=${var:maxlength} name=maxlength resource=false/ arg1 key=${var:minlength} name=minlength resource=false/ var var-namemaxlength/var-name var-value20/var-value /var /field /form /formset i am using single form in application thus only on validationform is .EmployeeForm.java plz help thanks in advanced Regards Nishant Patil Software Engineer Cybage Softwares Pvt. Ltd. (A CMM Level 3 Company) West Avenue, Kalyaninagar Pune - 411006 [EMAIL PROTECTED] www.cybage.com There is difference between knowing the Path and walking on the Path - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 1.2.4 - DynaActionForm.initialize(ActionMapping) no longer called ?
Well, Struts 1.2.4 *does* call the initialize() method when an instance of the form is created; but not when the form is reset. I verified this using the Struts-example logon form: form-bean name=LogonForm type=org.apache.struts.validator.DynaValidatorForm form-property name=username type=java.lang.String initial=george/ form-property name=password type=java.lang.String/ /form-bean The logon page correctly displayed 'george'. If you really want the initial values to be used when the form is reset you can create a DynaActionForm extension like the following: - import javax.servlet.http.HttpServletRequest; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.DynaActionForm; public class ResettingDynaActionForm extends DynaActionForm { public void reset(ActionMapping mapping, HttpServletRequest request) { initialize(mapping); } } - -Bill Siggelkow Natraj Gujran wrote: Hi, This has come up during migration of our Struts 1.1 app to 1.2.4. It doesn't look like the 'initialize()' method of DynaActionForm is called anymore ? In our application, we cannot initialize form values by using static values in struts-config.xml. Eg: if a date is to be initialized 21 days from today, AFAIK , we had to put that code in the initialize() method. Right now, I'm at a loss about what next to do - any tips will be greatly appreciated. Thanks, Natraj - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tiles and on-load events
Hi, I have now fixed this issue by setting a parameter in the request with javascript when the user clicks a 'stop' button. Andy _ Use MSN Messenger to send music and pics to your friends http://www.msn.co.uk/messenger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
tiles wilcard?
Hi, I would like able to use wildcards in the tiles-defs.xml. Is that possible? Is there any patch? Julio Cesar
Re: tiles wilcard?
You can do wild cards in struts-config, if that helps. Tiles has a diferent mechanisam to repeat. .V Julio Cesar C Neto wrote: Hi, I would like able to use wildcards in the tiles-defs.xml. Is that possible? Is there any patch? Julio Cesar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Dennis Graham is out of the office.
I will be out of the office starting 11/22/2004 and will not return until 11/29/2004. I will respond to your message when I return. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Validation] and local string insertion
I think the problem might be that you don't get the right MessageResources. Here is what Struts API says about public MessageResources getInternal() : Return the MessageResources instance containing our internal message strings. You should use: MessageResources resources = request.getSession().getServletContext() .getAttribute(Globals.MESSAGES_KEY)); to retrieve your bundle. I hope this helps you. On Thu, 18 Nov 2004 13:07:18 +0800, Corey Scott [EMAIL PROTECTED] wrote: Sorry ... resend, I cant find the previous one in the mail archive and I am not sure why the first one disappeared -Corey -- Forwarded message -- From: Corey Scott [EMAIL PROTECTED] Date: Thu, 18 Nov 2004 01:36:54 +0800 Subject: [Validation] and local string insertion To: [EMAIL PROTECTED] Hi, I have been trying to achieve the same in my validate method to the following extract from me validation.xml form name=UpdateTaskForm field property=txtTaskSummary depends=required msg name=required key=stdError.missing/ arg0 key=UpdateTaskForm.txtTaskSummary/ /field /form Extract from my message bundle: stdError.required.field=Please enter/choose a {0} UpdateTaskForm.txtTaskSummary=Task Summary My validate method: public ActionErrors validate( ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); if ((this.txtTaskSummary == null) || (this.txtTaskSummary.length() == 0)) { MessageResources resources = this.getServlet().getInternal(); errors.add( txtTaskSummary, new ActionMessage( stdError.required.field, resources.getMessage( request.getLocale(), UpdateTaskForm.txtTaskSummary))); } return errors; } Hopefully it is clear that I am trying get an output similar to: Please enter/choose a Task Summary But all I can get is: Please enter/choose a {0} // without the whole get resources stuff or Please enter/choose a null //code above I am getting the impression I am very much off track, any help would be great. Thanks, Corey - 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]
select box not getting populated from ActionForm.
I am trying to populate an select box on JSP using the ActionForm class. In my action I am populating the action form as follows : Action Class --- // get all Info ArrayList aList = (ArrayList) accountMgr.getAllProductInfo(); Iterator itr = aList.iterator(); while (itr.hasNext()) { ProductDTO aDTO = (ProductDTO) itr.next(); oForm.addGroupList(aDTO.getCarName(), + aDTO.getSequenceId()); aDTO = null; } jsp code html:select property=myList html:optionsCollection property=myList label=columnName value=columnCd/ /html:select My ActionForm code is as below : - public class ABCForm extends ActionForm { private ArrayList myList = new ArrayList(); // inner bean for representing column beans public class ColumnBean { private String columnName; private String columnCd; public ColumnBean(String sColName, String sColCd) { columnName = sColName; columnCd = sColCd; } public String getColumnName() { return columnName; } public String getColumnCd() { return columnCd; } } public List getMyList() { return myList; } public void addMyList(String sColumnName, String sColumnCd) { myList.add(new ColumnBean(sColumnName, sColumnCd)); } } If I do a size in my action class before forwarding, I get the correct value. But for some reasons, the select box is not getting populated with the values. oForm.getMyList.size() // in Action Class where oForm is my ActionForm. I had done this previously and had it working. Not sure why I am unable to do it now. Any advise appreciated. Thanks. VFP. __ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts and Role specific Action Forwarding
Hi, I am using struts 1.1. There is seed version or out of box version of the application. There is requirement that the application should be flexible enough to be customized for each client role. The roles are define in web.xml For example when user is in Role A View should be like JSP A.jsp and when user is in the Role B view should be like JSP B.jsp. Model remains same more or less. Currently we have this logic in the action class where role is checked and correct Action Forward is returned. But this approach requires touching the action classes again when a new role is defined. I was thinking if there is a better way of handling this logic so that I don't have to touch Action classes. I was also trying to look into Tiles to handle this logic. But so far no success. I will appreciate if anyone has better ideas to handle this requirement in struts environment. Thanks Rajesh S - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts and Role specific Action Forwarding
... might be a bit simplistic, but could you perhaps name your forwards after your roles and just have your action handle things that way? ... if the model is the same ... Then, you wouldn't have to touch the Action class unless your model needed tweaking. Another thing you could condier is having a factory that manufactured classes, based on role, which would setup the model appropriately and ... hrm ... I probably would keep using the role name to deduce the forward. ... the manufactured classes might be singletons to reduce the need for object creation/destruction. You'd reduce the liklihood of having to change anything unless you added a role. In that case, you'd update the config file for your factory and add in the new class and forward and ... *zoom* *zoom* *zoom* to the *BOOM* *BOOM*! ... ... yeah ... there's probably a better way :-) I like to compartmentalize things though and this approach would certainly do that. It suffers from many little objects-itis though :-( and makes it a lot less obvious where the code is that is actually doing the work. It's not a lot harder, but you might consider who will be stepping in once you're gone to do maintenance when you decide on a final implementation. Good Luck! Eddie - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 22, 2004 7:46 PM Subject: Struts and Role specific Action Forwarding Hi, I am using struts 1.1. There is seed version or out of box version of the application. There is requirement that the application should be flexible enough to be customized for each client role. The roles are define in web.xml For example when user is in Role A View should be like JSP A.jsp and when user is in the Role B view should be like JSP B.jsp. Model remains same more or less. Currently we have this logic in the action class where role is checked and correct Action Forward is returned. But this approach requires touching the action classes again when a new role is defined. I was thinking if there is a better way of handling this logic so that I don't have to touch Action classes. I was also trying to look into Tiles to handle this logic. But so far no success. I will appreciate if anyone has better ideas to handle this requirement in struts environment. Thanks Rajesh S - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 0447-1, 11/19/2004 Tested on: 11/22/2004 9:22:49 PM avast! - copyright (c) 2000-2004 ALWIL Software. http://www.avast.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: select box not getting populated from ActionForm.
Peter and Santosh, Here is an example that I use to do the same thing: My Action Class: public class ListBillingCodeAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // retrieve billing codes (List) BillingCodeManager manager = new BillingCodeManager(); // add the list of the request var (expose to jsp) request.setAttribute(dataList, manager.recallAll()); // return success return mapping.findForward(success); } } Fragment from my JSP html:select property=intBillingCodeID name=destBean html:optionsCollection name=dataList label=strBillingCode value=intBillingCodeID / /html:select I hope this helps.. -Corey - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Multi-Page Wizard Validation Problem
Jeff, Have you tried setting the input= attribute to a completely different page to make sure validation IS failing and that you're just not properly showing error messages? Do your logs show the Validation plugIn being configured upon web-application startup? Regards, David -Original Message- From: Jeff Smith [mailto:[EMAIL PROTECTED] Sent: Monday, November 22, 2004 9:37 AM To: Struts Users Mailing List Subject: Re: Multi-Page Wizard Validation Problem I added that, it fixes the page always resetting problem, but still no validation between page changes. On Nov 22, 2004, at 7:26 AM, Bill Siggelkow wrote: I believe you need a form-property named 'page' with a type of 'java.lang.Integer'. -Bill Siggelkow Jeff Smith wrote: Let me paste the files in instead -- struts config starts here -- ?xml version=1.0 encoding=iso-8859-1? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.2//EN http://struts.apache.org/dtds/struts-config_1_2.dtd; struts-config !-- Form Bean Definitions -- form-beans form-bean name=registrationForm type=org.apache.struts.validator.DynaValidatorActionForm !-- Page One -- form-property name=firstName type=java.lang.String/ form-property name=middleName type=java.lang.String/ form-property name=lastName type=java.lang.String/ form-property name=username type=java.lang.String/ form-property name=password type=java.lang.String/ form-property name=password2 type=java.lang.String/ !-- Page Two -- form-property name=birthDate type=java.lang.String/ !-- Page Three -- form-property name=street1 type=java.lang.String/ form-property name=street2 type=java.lang.String/ form-property name=city type=java.lang.String/ form-property name=state type=java.lang.String/ form-property name=country type=java.lang.String/ form-property name=postalCode type=java.lang.String/ /form-bean /form-beans !-- Action Mappings -- action-mappings action path=/reg/step1 parameter=command type=com.rochets.application.action.RegistrationAction name=registrationForm scope=session validate=true input=reg.step1 forward name=next path=reg.step2/ forward name=cancel path=/WEB-INF/jsp/mywizardcancel.jsp/ /action action path=/reg/step2 parameter=command type=com.rochets.application.action.RegistrationAction name=registrationForm scope=session validate=true input=reg.step2 forward name=previous path=reg.step1/ forward name=next path=reg.step3/ forward name=finish path=/WEB-INF/jsp/mywizarddone.jsp/ forward name=cancel path=/WEB-INF/jsp/mywizardcancel.jsp/ /action action path=/reg/step3 parameter=command type=com.rochets.application.action.RegistrationAction name=registrationForm scope=session validate=true input=reg.step3 forward name=previous path=reg.step3/ forward name=finish path=/WEB-INF/jsp/mywizarddone.jsp/ forward name=cancel path=/WEB-INF/jsp/mywizardcancel.jsp/ /action action path=/reg/registration parameter=command name=registrationForm scope=session type=com.rochets.application.action.RegistrationAction validate=true input=/reg/registration.do forward name=next path=reg.step1/ /action /action-mappings message-resources parameter=resources.reg.Registration null=false/ plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/struts/reg/validation.xml/ /plug-in /struts-config -- validation.xml starts here -- ?xml version=1.0 encoding=iso-8859-1? !DOCTYPE form-validation PUBLIC -//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd; form-validation formset form name=registrationForm !-- Page One -- field property=firstName depends=required,mask,minlength,maxlength page=1 arg key=firstname position=0/ arg name=minlength key=${var:minlength} resource=false position=1/ var var-namemask/var-name var-value^\w+$/var-value /var var var-nameminlength/var-name
Re: Multi-Page Wizard Validation Problem
David, Thanks for all your help with this. I tried setting the input attribute to a dummy jsp page and it never gets there either. I also confirmed that I had the appropriate messages in my resource bundle, although I don't know why that would make a difference. At this point I'll try anything. When the app deploys I see the following: [java] 21:19:27,059 INFO [ValidatorPlugIn] Loading validation rules file from '/WEB-INF/validator-rules.xml' [java] 21:19:27,063 INFO [ValidatorPlugIn] Loading validation rules file from '/WEB-INF/validation.xml' [java] 21:19:27,379 INFO [ValidatorPlugIn] Loading validation rules file from '/WEB-INF/struts/reg/validation.xml' The third one is the one in question. So it appears the validator is loading my file correctly. On Nov 22, 2004, at 9:14 PM, David G. Friedman wrote: Jeff, Have you tried setting the input= attribute to a completely different page to make sure validation IS failing and that you're just not properly showing error messages? Do your logs show the Validation plugIn being configured upon web-application startup? Regards, David -Original Message- From: Jeff Smith [mailto:[EMAIL PROTECTED] Sent: Monday, November 22, 2004 9:37 AM To: Struts Users Mailing List Subject: Re: Multi-Page Wizard Validation Problem I added that, it fixes the page always resetting problem, but still no validation between page changes. On Nov 22, 2004, at 7:26 AM, Bill Siggelkow wrote: I believe you need a form-property named 'page' with a type of 'java.lang.Integer'. -Bill Siggelkow Jeff Smith wrote: Let me paste the files in instead -- struts config starts here -- ?xml version=1.0 encoding=iso-8859-1? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.2//EN http://struts.apache.org/dtds/struts-config_1_2.dtd; struts-config !-- Form Bean Definitions -- form-beans form-bean name=registrationForm type=org.apache.struts.validator.DynaValidatorActionForm !-- Page One -- form-property name=firstName type=java.lang.String/ form-property name=middleName type=java.lang.String/ form-property name=lastName type=java.lang.String/ form-property name=username type=java.lang.String/ form-property name=password type=java.lang.String/ form-property name=password2 type=java.lang.String/ !-- Page Two -- form-property name=birthDate type=java.lang.String/ !-- Page Three -- form-property name=street1 type=java.lang.String/ form-property name=street2 type=java.lang.String/ form-property name=city type=java.lang.String/ form-property name=state type=java.lang.String/ form-property name=country type=java.lang.String/ form-property name=postalCode type=java.lang.String/ /form-bean /form-beans !-- Action Mappings -- action-mappings action path=/reg/step1 parameter=command type=com.rochets.application.action.RegistrationAction name=registrationForm scope=session validate=true input=reg.step1 forward name=next path=reg.step2/ forward name=cancel path=/WEB-INF/jsp/mywizardcancel.jsp/ /action action path=/reg/step2 parameter=command type=com.rochets.application.action.RegistrationAction name=registrationForm scope=session validate=true input=reg.step2 forward name=previous path=reg.step1/ forward name=next path=reg.step3/ forward name=finish path=/WEB-INF/jsp/mywizarddone.jsp/ forward name=cancel path=/WEB-INF/jsp/mywizardcancel.jsp/ /action action path=/reg/step3 parameter=command type=com.rochets.application.action.RegistrationAction name=registrationForm scope=session validate=true input=reg.step3 forward name=previous path=reg.step3/ forward name=finish path=/WEB-INF/jsp/mywizarddone.jsp/ forward name=cancel path=/WEB-INF/jsp/mywizardcancel.jsp/ /action action path=/reg/registration parameter=command name=registrationForm scope=session type=com.rochets.application.action.RegistrationAction validate=true input=/reg/registration.do forward name=next path=reg.step1/ /action /action-mappings message-resources parameter=resources.reg.Registration null=false/ plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/struts/reg/validation.xml/ /plug-in /struts-config -- validation.xml starts here -- ?xml
RE: Multi-Page Wizard Validation Problem
Jeff, Have you tried going to the first step and hard-coding the hidden variable page to be something high like 5. That would force it to try all validations. Can you print out the value of the page form field in each JSP? I'd like to know when you submit your various forms to /reg/step1.do, /reg/step2.do, /reg/step3.do, what is the value of the page attribute submitted. Regards, David (he who must be missing something from all of the details you provided! LOL) -Original Message- From: Jeff Smith [mailto:[EMAIL PROTECTED] Sent: Monday, November 22, 2004 11:26 PM To: Struts Users Mailing List Subject: Re: Multi-Page Wizard Validation Problem David, Thanks for all your help with this. I tried setting the input attribute to a dummy jsp page and it never gets there either. I also confirmed that I had the appropriate messages in my resource bundle, although I don't know why that would make a difference. At this point I'll try anything. When the app deploys I see the following: [java] 21:19:27,059 INFO [ValidatorPlugIn] Loading validation rules file from '/WEB-INF/validator-rules.xml' [java] 21:19:27,063 INFO [ValidatorPlugIn] Loading validation rules file from '/WEB-INF/validation.xml' [java] 21:19:27,379 INFO [ValidatorPlugIn] Loading validation rules file from '/WEB-INF/struts/reg/validation.xml' The third one is the one in question. So it appears the validator is loading my file correctly. On Nov 22, 2004, at 9:14 PM, David G. Friedman wrote: Jeff, Have you tried setting the input= attribute to a completely different page to make sure validation IS failing and that you're just not properly showing error messages? Do your logs show the Validation plugIn being configured upon web-application startup? Regards, David -Original Message- From: Jeff Smith [mailto:[EMAIL PROTECTED] Sent: Monday, November 22, 2004 9:37 AM To: Struts Users Mailing List Subject: Re: Multi-Page Wizard Validation Problem I added that, it fixes the page always resetting problem, but still no validation between page changes. On Nov 22, 2004, at 7:26 AM, Bill Siggelkow wrote: I believe you need a form-property named 'page' with a type of 'java.lang.Integer'. -Bill Siggelkow Jeff Smith wrote: Let me paste the files in instead -- struts config starts here -- ?xml version=1.0 encoding=iso-8859-1? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.2//EN http://struts.apache.org/dtds/struts-config_1_2.dtd; struts-config !-- Form Bean Definitions -- form-beans form-bean name=registrationForm type=org.apache.struts.validator.DynaValidatorActionForm !-- Page One -- form-property name=firstName type=java.lang.String/ form-property name=middleName type=java.lang.String/ form-property name=lastName type=java.lang.String/ form-property name=username type=java.lang.String/ form-property name=password type=java.lang.String/ form-property name=password2 type=java.lang.String/ !-- Page Two -- form-property name=birthDate type=java.lang.String/ !-- Page Three -- form-property name=street1 type=java.lang.String/ form-property name=street2 type=java.lang.String/ form-property name=city type=java.lang.String/ form-property name=state type=java.lang.String/ form-property name=country type=java.lang.String/ form-property name=postalCode type=java.lang.String/ /form-bean /form-beans !-- Action Mappings -- action-mappings action path=/reg/step1 parameter=command type=com.rochets.application.action.RegistrationAction name=registrationForm scope=session validate=true input=reg.step1 forward name=next path=reg.step2/ forward name=cancel path=/WEB-INF/jsp/mywizardcancel.jsp/ /action action path=/reg/step2 parameter=command type=com.rochets.application.action.RegistrationAction name=registrationForm scope=session validate=true input=reg.step2 forward name=previous path=reg.step1/ forward name=next path=reg.step3/ forward name=finish path=/WEB-INF/jsp/mywizarddone.jsp/ forward name=cancel path=/WEB-INF/jsp/mywizardcancel.jsp/ /action action path=/reg/step3 parameter=command type=com.rochets.application.action.RegistrationAction name=registrationForm scope=session validate=true input=reg.step3 forward name=previous path=reg.step3/ forward name=finish
Re: Multi-Page Wizard Validation Problem
I tried setting the page number in the first page to 5. When I hit next it gets correctly incremented to 6 but no validation. If I put stuff back to normal but add some output to the page of the page number I get 1 when I start, 2 after submitting step 1, 3 after submitting step 2. Seems to be correct. -jeff On Nov 22, 2004, at 9:33 PM, David G. Friedman wrote: Jeff, Have you tried going to the first step and hard-coding the hidden variable page to be something high like 5. That would force it to try all validations. Can you print out the value of the page form field in each JSP? I'd like to know when you submit your various forms to /reg/step1.do, /reg/step2.do, /reg/step3.do, what is the value of the page attribute submitted. Regards, David (he who must be missing something from all of the details you provided! LOL) -Original Message- From: Jeff Smith [mailto:[EMAIL PROTECTED] Sent: Monday, November 22, 2004 11:26 PM To: Struts Users Mailing List Subject: Re: Multi-Page Wizard Validation Problem David, Thanks for all your help with this. I tried setting the input attribute to a dummy jsp page and it never gets there either. I also confirmed that I had the appropriate messages in my resource bundle, although I don't know why that would make a difference. At this point I'll try anything. When the app deploys I see the following: [java] 21:19:27,059 INFO [ValidatorPlugIn] Loading validation rules file from '/WEB-INF/validator-rules.xml' [java] 21:19:27,063 INFO [ValidatorPlugIn] Loading validation rules file from '/WEB-INF/validation.xml' [java] 21:19:27,379 INFO [ValidatorPlugIn] Loading validation rules file from '/WEB-INF/struts/reg/validation.xml' The third one is the one in question. So it appears the validator is loading my file correctly. On Nov 22, 2004, at 9:14 PM, David G. Friedman wrote: Jeff, Have you tried setting the input= attribute to a completely different page to make sure validation IS failing and that you're just not properly showing error messages? Do your logs show the Validation plugIn being configured upon web-application startup? Regards, David -Original Message- From: Jeff Smith [mailto:[EMAIL PROTECTED] Sent: Monday, November 22, 2004 9:37 AM To: Struts Users Mailing List Subject: Re: Multi-Page Wizard Validation Problem I added that, it fixes the page always resetting problem, but still no validation between page changes. On Nov 22, 2004, at 7:26 AM, Bill Siggelkow wrote: I believe you need a form-property named 'page' with a type of 'java.lang.Integer'. -Bill Siggelkow Jeff Smith wrote: Let me paste the files in instead -- struts config starts here -- ?xml version=1.0 encoding=iso-8859-1? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.2//EN http://struts.apache.org/dtds/struts-config_1_2.dtd; struts-config !-- Form Bean Definitions -- form-beans form-bean name=registrationForm type=org.apache.struts.validator.DynaValidatorActionForm !-- Page One -- form-property name=firstName type=java.lang.String/ form-property name=middleName type=java.lang.String/ form-property name=lastName type=java.lang.String/ form-property name=username type=java.lang.String/ form-property name=password type=java.lang.String/ form-property name=password2 type=java.lang.String/ !-- Page Two -- form-property name=birthDate type=java.lang.String/ !-- Page Three -- form-property name=street1 type=java.lang.String/ form-property name=street2 type=java.lang.String/ form-property name=city type=java.lang.String/ form-property name=state type=java.lang.String/ form-property name=country type=java.lang.String/ form-property name=postalCode type=java.lang.String/ /form-bean /form-beans !-- Action Mappings -- action-mappings action path=/reg/step1 parameter=command type=com.rochets.application.action.RegistrationAction name=registrationForm scope=session validate=true input=reg.step1 forward name=next path=reg.step2/ forward name=cancel path=/WEB-INF/jsp/mywizardcancel.jsp/ /action action path=/reg/step2 parameter=command type=com.rochets.application.action.RegistrationAction name=registrationForm scope=session validate=true input=reg.step2 forward name=previous path=reg.step1/ forward name=next path=reg.step3/ forward name=finish path=/WEB-INF/jsp/mywizarddone.jsp/ forward name=cancel path=/WEB-INF/jsp/mywizardcancel.jsp/ /action action path=/reg/step3 parameter=command
good book
Hi, I am newbie, can anybody suggest good books/links to learn struts and clear all fundamentals with it? Appreciate your help. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Multi-Page Wizard Validation Problem
Jeff, This is my final set of questions (I'm out of questions and will concede being useless if this question fails). I noticed your reg actions are all of class com.rochets.application.action.RegistrationAction. Do you have your own validate method in those actions or are you leaving it to the default provided by whatever class you subclass? Are they simply org.apache.struts.action.Action(?) subclasses with no overridden(?) validate() method? If defined your own validate() method and are not calling super.validate or invoking the form's validate() method appropriately, perhaps no ActionMessages/ActionErrors are being returned so it looks like the validation is clear when it should be failing. Regards, David -Original Message- From: Jeff Smith [mailto:[EMAIL PROTECTED] Sent: Monday, November 22, 2004 11:43 PM To: Struts Users Mailing List Subject: Re: Multi-Page Wizard Validation Problem I tried setting the page number in the first page to 5. When I hit next it gets correctly incremented to 6 but no validation. If I put stuff back to normal but add some output to the page of the page number I get 1 when I start, 2 after submitting step 1, 3 after submitting step 2. Seems to be correct. -jeff On Nov 22, 2004, at 9:33 PM, David G. Friedman wrote: Jeff, Have you tried going to the first step and hard-coding the hidden variable page to be something high like 5. That would force it to try all validations. Can you print out the value of the page form field in each JSP? I'd like to know when you submit your various forms to /reg/step1.do, /reg/step2.do, /reg/step3.do, what is the value of the page attribute submitted. Regards, David (he who must be missing something from all of the details you provided! LOL) -Original Message- From: Jeff Smith [mailto:[EMAIL PROTECTED] Sent: Monday, November 22, 2004 11:26 PM To: Struts Users Mailing List Subject: Re: Multi-Page Wizard Validation Problem David, Thanks for all your help with this. I tried setting the input attribute to a dummy jsp page and it never gets there either. I also confirmed that I had the appropriate messages in my resource bundle, although I don't know why that would make a difference. At this point I'll try anything. When the app deploys I see the following: [java] 21:19:27,059 INFO [ValidatorPlugIn] Loading validation rules file from '/WEB-INF/validator-rules.xml' [java] 21:19:27,063 INFO [ValidatorPlugIn] Loading validation rules file from '/WEB-INF/validation.xml' [java] 21:19:27,379 INFO [ValidatorPlugIn] Loading validation rules file from '/WEB-INF/struts/reg/validation.xml' The third one is the one in question. So it appears the validator is loading my file correctly. On Nov 22, 2004, at 9:14 PM, David G. Friedman wrote: Jeff, Have you tried setting the input= attribute to a completely different page to make sure validation IS failing and that you're just not properly showing error messages? Do your logs show the Validation plugIn being configured upon web-application startup? Regards, David -Original Message- From: Jeff Smith [mailto:[EMAIL PROTECTED] Sent: Monday, November 22, 2004 9:37 AM To: Struts Users Mailing List Subject: Re: Multi-Page Wizard Validation Problem I added that, it fixes the page always resetting problem, but still no validation between page changes. On Nov 22, 2004, at 7:26 AM, Bill Siggelkow wrote: I believe you need a form-property named 'page' with a type of 'java.lang.Integer'. -Bill Siggelkow Jeff Smith wrote: Let me paste the files in instead -- struts config starts here -- ?xml version=1.0 encoding=iso-8859-1? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.2//EN http://struts.apache.org/dtds/struts-config_1_2.dtd; struts-config !-- Form Bean Definitions -- form-beans form-bean name=registrationForm type=org.apache.struts.validator.DynaValidatorActionForm !-- Page One -- form-property name=firstName type=java.lang.String/ form-property name=middleName type=java.lang.String/ form-property name=lastName type=java.lang.String/ form-property name=username type=java.lang.String/ form-property name=password type=java.lang.String/ form-property name=password2 type=java.lang.String/ !-- Page Two -- form-property name=birthDate type=java.lang.String/ !-- Page Three -- form-property name=street1 type=java.lang.String/ form-property name=street2 type=java.lang.String/ form-property name=city type=java.lang.String/ form-property name=state type=java.lang.String/ form-property name=country type=java.lang.String/ form-property name=postalCode type=java.lang.String/ /form-bean
Re: good book
strutslive is a good book for newbees http://www.theserverside.com/books/sourcebeat/JakartaStrutsLive/index.tss RE: free struts boook Amin Lalji Wed, 17 Nov 2004 07:21:04 -0800 http://www.theserverside.com/books/sourcebeat/JakartaStrutsLive/index.tss Regards Nishant Patil Software Engineer Cybage Softwares Pvt. Ltd. (A CMM Level 3 Company) West Avenue, Kalyaninagar Pune - 411006 Ph. +91-20-4044700/4041700 Extn 355 [EMAIL PROTECTED] www.cybage.com There is difference between knowing the Path and walking on the Path - Original Message - From: [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Tuesday, November 23, 2004 10:17 AM Subject: good book Hi, I am newbie, can anybody suggest good books/links to learn struts and clear all fundamentals with it? Appreciate your help. - 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 local string insertion
Fantastic thanks, I knew I was going in the wrong direction. Regards, -Corey On Mon, 22 Nov 2004 16:51:56 +0200, Radu Badita [EMAIL PROTECTED] wrote: I think the problem might be that you don't get the right MessageResources. Here is what Struts API says about public MessageResources getInternal() : Return the MessageResources instance containing our internal message strings. You should use: MessageResources resources = request.getSession().getServletContext() .getAttribute(Globals.MESSAGES_KEY)); to retrieve your bundle. I hope this helps you. On Thu, 18 Nov 2004 13:07:18 +0800, Corey Scott [EMAIL PROTECTED] wrote: Sorry ... resend, I cant find the previous one in the mail archive and I am not sure why the first one disappeared -Corey -- Forwarded message -- From: Corey Scott [EMAIL PROTECTED] Date: Thu, 18 Nov 2004 01:36:54 +0800 Subject: [Validation] and local string insertion To: [EMAIL PROTECTED] Hi, I have been trying to achieve the same in my validate method to the following extract from me validation.xml form name=UpdateTaskForm field property=txtTaskSummary depends=required msg name=required key=stdError.missing/ arg0 key=UpdateTaskForm.txtTaskSummary/ /field /form Extract from my message bundle: stdError.required.field=Please enter/choose a {0} UpdateTaskForm.txtTaskSummary=Task Summary My validate method: public ActionErrors validate( ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); if ((this.txtTaskSummary == null) || (this.txtTaskSummary.length() == 0)) { MessageResources resources = this.getServlet().getInternal(); errors.add( txtTaskSummary, new ActionMessage( stdError.required.field, resources.getMessage( request.getLocale(), UpdateTaskForm.txtTaskSummary))); } return errors; } Hopefully it is clear that I am trying get an output similar to: Please enter/choose a Task Summary But all I can get is: Please enter/choose a {0} // without the whole get resources stuff or Please enter/choose a null //code above I am getting the impression I am very much off track, any help would be great. Thanks, Corey - 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]
XSL in JSP
hi to all, i am using tomcat apache with struts... in my java beans i am storing the xml information in String. now i hav to retrieve this XML info using XSL in my JSP page .. here i am stucked. can neone explain how to use JSP with XSL on net there is little information about it ... thanks in advanced Regards Nishant Patil Software Engineer Cybage Softwares Pvt. Ltd. (A CMM Level 3 Company) West Avenue, Kalyaninagar Pune - 411006 Ph. +91-20-4044700/4041700 Extn 355 [EMAIL PROTECTED] www.cybage.com There is difference between knowing the Path and walking on the Path
RE: good book
Thanks. On same line, could you please suggest good book/links to J2EE design patterns? -Original Message- From: Nishant [mailto:[EMAIL PROTECTED] Sent: Monday, November 22, 2004 8:56 PM To: Struts Users Mailing List Subject: Re: good book strutslive is a good book for newbees http://www.theserverside.com/books/sourcebeat/JakartaStrutsLive/index.ts s RE: free struts boook Amin Lalji Wed, 17 Nov 2004 07:21:04 -0800 http://www.theserverside.com/books/sourcebeat/JakartaStrutsLive/index.ts s Regards Nishant Patil Software Engineer Cybage Softwares Pvt. Ltd. (A CMM Level 3 Company) West Avenue, Kalyaninagar Pune - 411006 Ph. +91-20-4044700/4041700 Extn 355 [EMAIL PROTECTED] www.cybage.com There is difference between knowing the Path and walking on the Path - Original Message - From: [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Tuesday, November 23, 2004 10:17 AM Subject: good book Hi, I am newbie, can anybody suggest good books/links to learn struts and clear all fundamentals with it? Appreciate your help. - 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: good book
Core J2EE Design Patterns or something like that. Really good. Jack On Mon, 22 Nov 2004 22:10:15 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Thanks. On same line, could you please suggest good book/links to J2EE design patterns? -Original Message- From: Nishant [mailto:[EMAIL PROTECTED] Sent: Monday, November 22, 2004 8:56 PM To: Struts Users Mailing List Subject: Re: good book strutslive is a good book for newbees http://www.theserverside.com/books/sourcebeat/JakartaStrutsLive/index.ts s RE: free struts boook Amin Lalji Wed, 17 Nov 2004 07:21:04 -0800 http://www.theserverside.com/books/sourcebeat/JakartaStrutsLive/index.ts s Regards Nishant Patil Software Engineer Cybage Softwares Pvt. Ltd. (A CMM Level 3 Company) West Avenue, Kalyaninagar Pune - 411006 Ph. +91-20-4044700/4041700 Extn 355 [EMAIL PROTECTED] www.cybage.com There is difference between knowing the Path and walking on the Path - Original Message - From: [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Tuesday, November 23, 2004 10:17 AM Subject: good book Hi, I am newbie, can anybody suggest good books/links to learn struts and clear all fundamentals with it? Appreciate your help. - 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] -- You can't wake a person who is pretending to be asleep. ~Native Proverb~ Each man is good in His sight. It is not necessary for eagles to be crows. ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: good book
I see many books with that name..any specific author? Or links? -Original Message- From: Dakota Jack [mailto:[EMAIL PROTECTED] Sent: Monday, November 22, 2004 10:46 PM To: Struts Users Mailing List Subject: Re: good book Core J2EE Design Patterns or something like that. Really good. Jack On Mon, 22 Nov 2004 22:10:15 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Thanks. On same line, could you please suggest good book/links to J2EE design patterns? -Original Message- From: Nishant [mailto:[EMAIL PROTECTED] Sent: Monday, November 22, 2004 8:56 PM To: Struts Users Mailing List Subject: Re: good book strutslive is a good book for newbees http://www.theserverside.com/books/sourcebeat/JakartaStrutsLive/index.ts s RE: free struts boook Amin Lalji Wed, 17 Nov 2004 07:21:04 -0800 http://www.theserverside.com/books/sourcebeat/JakartaStrutsLive/index.ts s Regards Nishant Patil Software Engineer Cybage Softwares Pvt. Ltd. (A CMM Level 3 Company) West Avenue, Kalyaninagar Pune - 411006 Ph. +91-20-4044700/4041700 Extn 355 [EMAIL PROTECTED] www.cybage.com There is difference between knowing the Path and walking on the Path - Original Message - From: [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Tuesday, November 23, 2004 10:17 AM Subject: good book Hi, I am newbie, can anybody suggest good books/links to learn struts and clear all fundamentals with it? Appreciate your help. - 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] -- You can't wake a person who is pretending to be asleep. ~Native Proverb~ Each man is good in His sight. It is not necessary for eagles to be crows. ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ - 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: good book
The one that really matters :) http://www.corej2eepatterns.com/AboutTheBook.htm gavri -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 23, 2004 12:39 PM To: 'Struts Users Mailing List' Subject: RE: good book I see many books with that name..any specific author? Or links? -Original Message- From: Dakota Jack [mailto:[EMAIL PROTECTED] Sent: Monday, November 22, 2004 10:46 PM To: Struts Users Mailing List Subject: Re: good book Core J2EE Design Patterns or something like that. Really good. Jack On Mon, 22 Nov 2004 22:10:15 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Thanks. On same line, could you please suggest good book/links to J2EE design patterns? -Original Message- From: Nishant [mailto:[EMAIL PROTECTED] Sent: Monday, November 22, 2004 8:56 PM To: Struts Users Mailing List Subject: Re: good book strutslive is a good book for newbees http://www.theserverside.com/books/sourcebeat/JakartaStrutsLive/index.ts s RE: free struts boook Amin Lalji Wed, 17 Nov 2004 07:21:04 -0800 http://www.theserverside.com/books/sourcebeat/JakartaStrutsLive/index.ts s Regards Nishant Patil Software Engineer Cybage Softwares Pvt. Ltd. (A CMM Level 3 Company) West Avenue, Kalyaninagar Pune - 411006 Ph. +91-20-4044700/4041700 Extn 355 [EMAIL PROTECTED] www.cybage.com There is difference between knowing the Path and walking on the Path - Original Message - From: [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Tuesday, November 23, 2004 10:17 AM Subject: good book Hi, I am newbie, can anybody suggest good books/links to learn struts and clear all fundamentals with it? Appreciate your help. - 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] -- You can't wake a person who is pretending to be asleep. ~Native Proverb~ Each man is good in His sight. It is not necessary for eagles to be crows. ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ - 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, including any attachments, contains confidential information intended for a specific individual and purpose, and is intended for the addressee only. Any unauthorized disclosure, use, dissemination, copying, or distribution of this message or any of its attachments or the information contained in this e-mail, or the taking of any action based on it, is strictly prohibited. If you are not the intended recipient, please notify the sender immediately by return e-mail and delete this message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: good book
here are some books: http://www.springframework.com/books/ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 23, 2004 5:48 AM To: 'Struts Users Mailing List' Subject: good book Hi, I am newbie, can anybody suggest good books/links to learn struts and clear all fundamentals with it? Appreciate your help. - 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]