Re: help : paging in struts view
Kindly send all your messages to [EMAIL PROTECTED] This mail account is not functioning anymore. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: help : paging in struts view
On 14/1/05 9:50 am, sachin [EMAIL PROTECTED] wrote: hi all , how to achieve paging in struts views ? http://displaytag.sourceforge.net ? so that all the records can be viewed by prevoius , next links There are function available in ASP , PHP .. If something of that type is already available , it will save a lot of time Thanks in advance Sachin Hegde Paradyne Infotech Limited , Mumbai - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: help : paging in struts view
Kindly send all your messages to [EMAIL PROTECTED] This mail account is not functioning anymore. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: help : paging in struts view
Hi all, How can we read XML files using struts? is this possible. Can any one povide a link or give an example for reading XML files using struts? :-) Jay - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using XML in struts
Hi all, How can i read XML files using struts? is this possible? Can any one provide a link or give an example for reading XML files using struts? :-) Jay - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [almost OT] Struts in Practice
-Original Message- BTW, what's HTH? -Original Message- HTH means Hope This Helps HTH Alexander - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RE: [almost OT] Struts in Practice
Kindly send all your messages to [EMAIL PROTECTED] This mail account is not functioning anymore. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
dynamic form bean property
hi how can i create or delete form bean properties ? for example i create myAction.java and myForm.java myForm.java has a nd b property,they have setters/getters. and i want to create c and d at runtime then delete c and b fore example is that possible ? sincerely - ALL-NEW Yahoo! Messenger - all new features - even more fun!
Re: dynamic form bean property
Kindly send all your messages to [EMAIL PROTECTED] This mail account is not functioning anymore. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Different validations for one form
Hi everybody, Here is my problem : I have two jsp that share the same action class (and the same form). As they don't contain the same fields, I would like to have two different validations : one for each jsp. I use Validator and Struts 1.2. How can I do that ? Thanks in advance. Julie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Different validations for one form
Kindly send all your messages to [EMAIL PROTECTED] This mail account is not functioning anymore. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Different validations for one form
At 11:11 AM + 1/14/05, jgfa92004 wrote: Hi everybody, Here is my problem : I have two jsp that share the same action class (and the same form). As they don't contain the same fields, I would like to have two different validations : one for each jsp. I use Validator and Struts 1.2. How can I do that ? Thanks in advance. Julie Use ValidatorActionForm or DynaValidatorActionForm and when the validate() method is called by Struts, the validation rules will be looked up using the action path instead of the form bean name. That is, in your validator config, where you might have had form name=EditImage, you would now have form name=/path/to/EditImageAction Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com Narrow minds are weapons made for mass destruction -The Ex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: Different validations for one form
Kindly send all your messages to [EMAIL PROTECTED] This mail account is not functioning anymore. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Different validations for one form
you can use form based validation or action based validation in struts 1.2 , 1) to use form based validation, form classes must extend ValidatorActionForm or DynaValidatorActionForm classes. (org.apache.struts.validator.ValidatorActionForm,org.apache.struts.validator.DynaValidatorActionForm) 2) to use action based validation , form classes must extend ValidatorForm or DynaValidatorForm classes. (org.apache.struts.validator.ValidatorForm,org.apache.struts.validator.DynaValidatorForm) in this case, you must give action name instead of form name in your validation.xml file such as, formset form name=/yourActionName field property=city... .. you must use second way, take it easy.. -Original Message- From: jgfa92004 [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 1:11 PM To: struts-user@jakarta.apache.org Subject: Different validations for one form Hi everybody, Here is my problem : I have two jsp that share the same action class (and the same form). As they don't contain the same fields, I would like to have two different validations : one for each jsp. I use Validator and Struts 1.2. How can I do that ? Thanks in advance. Julie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RE: Different validations for one form
Kindly send all your messages to [EMAIL PROTECTED] This mail account is not functioning anymore. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
nested:checkbox question
Hi there. I have a nested object where one of its properties is a string representing on|off. When converting it to a form I'm using a nested:checkbox as shown: nested:checkbox property=state/ Problem is, it should be checked when it's on, and unchecked when off, and it's not working. How can I achive this? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: nested:checkbox question
Kindly send all your messages to [EMAIL PROTECTED] This mail account is not functioning anymore. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Different validations for one form
Ok, but I have the same action class too... So how will it know that for one jsp, it's a validation and for the other jsp it's the other validation to use... My two jsp share the same form and the same action class... Do you have an idea ? Thanks for your help. Seyhan Basmaci [EMAIL PROTECTED] wrote: you can use form based validation or action based validation in struts 1.2 , 1) to use form based validation, form classes must extend ValidatorActionForm or DynaValidatorActionForm classes. (org.apache.struts.validator.ValidatorActionForm,org.apache.struts.validator.DynaValidatorActionForm) 2) to use action based validation , form classes must extend ValidatorForm or DynaValidatorForm classes. (org.apache.struts.validator.ValidatorForm,org.apache.struts.validator.DynaValidatorForm) in this case, you must give action name instead of form name in your validation.xml file such as, formset .. you must use second way, take it easy.. -Original Message- From: jgfa92004 [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 1:11 PM To: struts-user@jakarta.apache.org Subject: Different validations for one form Hi everybody, Here is my problem : I have two jsp that share the same action class (and the same form). As they don't contain the same fields, I would like to have two different validations : one for each jsp. I use Validator and Struts 1.2. How can I do that ? Thanks in advance. Julie - 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] - Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! Créez votre Yahoo! Mail
Re: Using XML in struts
Struts does not have a specific support for XML, but you can use inside a webapp all the libraries that you normally use under classic applications. For example, if you want to load a DOM for an XML file inside an action (not very elegant...), you can use DOM4J (or similar libraries). If you want to use XML files inside JSP pages you can use the xtags, and so on. Ciao Antonio Petrelli Hi all, How can i read XML files using struts? is this possible? Can any one provide a link or give an example for reading XML files using struts? :-) Jay - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Different validations for one form
in your struts config file , define two map to same action class, for example , pathA and PathB in validation.xml,, define validation for each path,, I hope it works :), formset form name=/pathA field property=city... form name=/pathB field property=city... -Original Message- From: julie gautier [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 2:07 PM To: Struts Users Mailing List Subject: RE: Different validations for one form Ok, but I have the same action class too... So how will it know that for one jsp, it's a validation and for the other jsp it's the other validation to use... My two jsp share the same form and the same action class... Do you have an idea ? Thanks for your help. Seyhan Basmaci [EMAIL PROTECTED] wrote: you can use form based validation or action based validation in struts 1.2 , 1) to use form based validation, form classes must extend ValidatorActionForm or DynaValidatorActionForm classes. (org.apache.struts.validator.ValidatorActionForm,org.apache.struts.validator.DynaValidatorActionForm) 2) to use action based validation , form classes must extend ValidatorForm or DynaValidatorForm classes. (org.apache.struts.validator.ValidatorForm,org.apache.struts.validator.DynaValidatorForm) in this case, you must give action name instead of form name in your validation.xml file such as, formset .. you must use second way, take it easy.. -Original Message- From: jgfa92004 [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 1:11 PM To: struts-user@jakarta.apache.org Subject: Different validations for one form Hi everybody, Here is my problem : I have two jsp that share the same action class (and the same form). As they don't contain the same fields, I would like to have two different validations : one for each jsp. I use Validator and Struts 1.2. How can I do that ? Thanks in advance. Julie - 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] - Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! Créez votre Yahoo! Mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Action Chaining
Jack, You have said that LookupDispatchAction is outdated and inefficient. I have at a minimum 6 different actions that need to be performed per page, not including load. What else would you recommend as a solution? Todd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Different validations for one form
Thanks again for your help. So, my two jsp are : commercialplanList.jsp and commercialplanPrint.jsp. I have one form : CommercialPlanForm.class I have one action class : CommercialPlanAction.class Here is my struts-config : actionpath=/commercialplan type=com.mypack.CommercialPlanAction name=commercialPlanForm scope=request input=/mainmenu.do forward name=displayList path=commercialplanList/ forward name=displayEdit path=commercialplanEdit/ forward name=displayPrint path=commercialplanPrint/ forward name=failure path=mainMenu/ /action actionpath=/commercialplanprint type=com.mypack.CommercialPlanAction name=commercialPlanForm scope=request input=/mainmenu.do forward name=displayList path=commercialplanList/ forward name=displayEdit path=commercialplanEdit/ forward name=displayPrint path=commercialplanPrint/ forward name=failure path=mainMenu/ /action In validation.xml, I have : formset form name=/commercialplan field property=prop1 depends=required arg0 key=prompt.prop1/ /field field property=prop2 depends=required arg0 key=prompt.prop2/ /field /form /formset formset form name=/commercialplanprint field property=prop3 depends=required arg0 key=prompt.prop3/ /field /form /formset See the fields to be validated in commercialplanList.jsp are prop1 and prop2 and the field to be validated in commercialplanPrint.jsp is prop3. Now, I wrote in my jsps : in commercialplanPrint.jsp : html:form action=/commercialplanprint and in commercialplanList.jsp : html:form action=/commercialplan And CommercialPlanForm.class extends ValidatorActionForm Now when I try to access commercialplanPrint.jsp I still have an error that says : javax.servlet.jsp.JspException: No form found under 'commercialPlanForm' in locale 'fr' at org.apache.struts.taglib.html.JavascriptValidatorTag.renderJavascript(JavascriptValidatorTag.java:364) at org.apache.struts.taglib.html.JavascriptValidatorTag.doStartTag(JavascriptValidatorTag.java:335) at org.apache.jsp.commercialplanPrint_jsp._jspx_meth_html_javascript_0(commercialplanPrint_jsp.java:734) at org.apache.jsp.commercialplanPrint_jsp._jspService(commercialplanPrint_jsp.java:210) What am I doing wrong ? Thanks ! Seyhan Basmaci [EMAIL PROTECTED] wrote: in your struts config file , define two map to same action class, for example , pathA and PathB in validation.xml,, define validation for each path,, I hope it works :), formset -Original Message- From: julie gautier [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 2:07 PM To: Struts Users Mailing List Subject: RE: Different validations for one form Ok, but I have the same action class too... So how will it know that for one jsp, it's a validation and for the other jsp it's the other validation to use... My two jsp share the same form and the same action class... Do you have an idea ? Thanks for your help. Seyhan Basmaci wrote: you can use form based validation or action based validation in struts 1.2 , 1) to use form based validation, form classes must extend ValidatorActionForm or DynaValidatorActionForm classes. (org.apache.struts.validator.ValidatorActionForm,org.apache.struts.validator.DynaValidatorActionForm) 2) to use action based validation , form classes must extend ValidatorForm or DynaValidatorForm classes. (org.apache.struts.validator.ValidatorForm,org.apache.struts.validator.DynaValidatorForm) in this case, you must give action name instead of form name in your validation.xml file such as, formset .. you must use second way, take it easy.. -Original Message- From: jgfa92004 [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 1:11 PM To: struts-user@jakarta.apache.org Subject: Different validations for one form Hi everybody, Here is my problem : I have two jsp that share the same action class (and the same form). As they don't contain the same fields, I would like to have two different validations : one for each jsp. I use Validator and Struts 1.2. How can I do that ? Thanks in advance. Julie - 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] -
does not contain handler parameter
Hi people! Anybody knows what kind of error is this? exception javax.servlet.ServletException: Request[/user] does not contain handler parameter named action org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.java:196) org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:465) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422) org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:505) javax.servlet.http.HttpServlet.service(HttpServlet.java:743) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) note The full stack trace of the root cause is available in the Tomcat logs. In the struts-config.xml, the action mapping is like this: !-- User Action -- action path=/user type=com.sednet.odonto.web.actions.UserAction name=userForm scope=session parameter=action input=/userp1.jsp validate=false forward name=success path=/success.jsp/ forward name=page1 path=/userp1.jsp/ forward name=page2 path=/userp2.jsp/ forward name=page3 path=/userp3.jsp/ forward name=cancel path=/begin.jsp/ /action Thanks... Flávio Vilasboas Maldonado Diretor de Desenvolvimento SedNet Soluções em TI (35)3471-9381 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Different validations for one form
you have two formset tag, (Note: The FormSet has language, country, and variant attributes that correspond with the java.util.Locale class. If they are not used, the FormSet will be set to the default locale.) Put /commercialplanprint into first formset /formset tag, like below formset form name=/commercialplan field property=prop1 depends=required arg0 key=prompt.prop1/ /field field property=prop2 depends=required arg0 key=prompt.prop2/ /field /form form name=/commercialplanprint field property=prop3 depends=required arg0 key=prompt.prop3/ /field /form /formset -Original Message- From: julie gautier [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 2:40 PM To: Struts Users Mailing List Subject: RE: Different validations for one form Thanks again for your help. So, my two jsp are : commercialplanList.jsp and commercialplanPrint.jsp. I have one form : CommercialPlanForm.class I have one action class : CommercialPlanAction.class Here is my struts-config : actionpath=/commercialplan type=com.mypack.CommercialPlanAction name=commercialPlanForm scope=request input=/mainmenu.do forward name=displayList path=commercialplanList/ forward name=displayEdit path=commercialplanEdit/ forward name=displayPrint path=commercialplanPrint/ forward name=failure path=mainMenu/ /action actionpath=/commercialplanprint type=com.mypack.CommercialPlanAction name=commercialPlanForm scope=request input=/mainmenu.do forward name=displayList path=commercialplanList/ forward name=displayEdit path=commercialplanEdit/ forward name=displayPrint path=commercialplanPrint/ forward name=failure path=mainMenu/ /action In validation.xml, I have : formset form name=/commercialplan field property=prop1 depends=required arg0 key=prompt.prop1/ /field field property=prop2 depends=required arg0 key=prompt.prop2/ /field /form /formset formset form name=/commercialplanprint field property=prop3 depends=required arg0 key=prompt.prop3/ /field /form /formset See the fields to be validated in commercialplanList.jsp are prop1 and prop2 and the field to be validated in commercialplanPrint.jsp is prop3. Now, I wrote in my jsps : in commercialplanPrint.jsp : html:form action=/commercialplanprint and in commercialplanList.jsp : html:form action=/commercialplan And CommercialPlanForm.class extends ValidatorActionForm Now when I try to access commercialplanPrint.jsp I still have an error that says : javax.servlet.jsp.JspException: No form found under 'commercialPlanForm' in locale 'fr' at org.apache.struts.taglib.html.JavascriptValidatorTag.renderJavascript(JavascriptValidatorTag.java:364) at org.apache.struts.taglib.html.JavascriptValidatorTag.doStartTag(JavascriptValidatorTag.java:335) at org.apache.jsp.commercialplanPrint_jsp._jspx_meth_html_javascript_0(commercialplanPrint_jsp.java:734) at org.apache.jsp.commercialplanPrint_jsp._jspService(commercialplanPrint_jsp.java:210) What am I doing wrong ? Thanks ! Seyhan Basmaci [EMAIL PROTECTED] wrote: in your struts config file , define two map to same action class, for example , pathA and PathB in validation.xml,, define validation for each path,, I hope it works :), formset -Original Message- From: julie gautier [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 2:07 PM To: Struts Users Mailing List Subject: RE: Different validations for one form Ok, but I have the same action class too... So how will it know that for one jsp, it's a validation and for the other jsp it's the other validation to use... My two jsp share the same form and the same action class... Do you have an idea ? Thanks for your help. Seyhan Basmaci wrote: you can use form based validation or action based validation in struts 1.2 , 1) to use form based validation, form classes must extend ValidatorActionForm or DynaValidatorActionForm classes. (org.apache.struts.validator.ValidatorActionForm,org.apache.struts.validator.DynaValidatorActionForm) 2) to use action based validation , form classes must extend ValidatorForm or DynaValidatorForm classes.
RE: Different validations for one form
Done. I always have the same error... Seyhan Basmaci [EMAIL PROTECTED] wrote:you have two formset tag, (Note: The FormSet has language, country, and variant attributes that correspond with the java.util.Locale class. If they are not used, the FormSet will be set to the default locale.) Put /commercialplanprint into first tag, like below property=prop1 depends=required property=prop2 depends=required property=prop3 depends=required -Original Message- From: julie gautier [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 2:40 PM To: Struts Users Mailing List Subject: RE: Different validations for one form Thanks again for your help. So, my two jsp are : commercialplanList.jsp and commercialplanPrint.jsp. I have one form : CommercialPlanForm.class I have one action class : CommercialPlanAction.class Here is my struts-config : type=com.mypack.CommercialPlanAction name=commercialPlanForm scope=request input=/mainmenu.do type=com.mypack.CommercialPlanAction name=commercialPlanForm scope=request input=/mainmenu.do In validation.xml, I have : property=prop1 depends=required property=prop2 depends=required property=prop3 depends=required See the fields to be validated in commercialplanList.jsp are prop1 and prop2 and the field to be validated in commercialplanPrint.jsp is prop3. Now, I wrote in my jsps : in commercialplanPrint.jsp : and in commercialplanList.jsp : And CommercialPlanForm.class extends ValidatorActionForm Now when I try to access commercialplanPrint.jsp I still have an error that says : javax.servlet.jsp.JspException: No form found under 'commercialPlanForm' in locale 'fr' at org.apache.struts.taglib.html.JavascriptValidatorTag.renderJavascript(JavascriptValidatorTag.java:364) at org.apache.struts.taglib.html.JavascriptValidatorTag.doStartTag(JavascriptValidatorTag.java:335) at org.apache.jsp.commercialplanPrint_jsp._jspx_meth_html_javascript_0(commercialplanPrint_jsp.java:734) at org.apache.jsp.commercialplanPrint_jsp._jspService(commercialplanPrint_jsp.java:210) What am I doing wrong ? Thanks ! Seyhan Basmaci wrote: in your struts config file , define two map to same action class, for example , pathA and PathB in validation.xml,, define validation for each path,, I hope it works :), formset -Original Message- From: julie gautier [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 2:07 PM To: Struts Users Mailing List Subject: RE: Different validations for one form Ok, but I have the same action class too... So how will it know that for one jsp, it's a validation and for the other jsp it's the other validation to use... My two jsp share the same form and the same action class... Do you have an idea ? Thanks for your help. Seyhan Basmaci wrote: you can use form based validation or action based validation in struts 1.2 , 1) to use form based validation, form classes must extend ValidatorActionForm or DynaValidatorActionForm classes. (org.apache.struts.validator.ValidatorActionForm,org.apache.struts.validator.DynaValidatorActionForm) 2) to use action based validation , form classes must extend ValidatorForm or DynaValidatorForm classes. (org.apache.struts.validator.ValidatorForm,org.apache.struts.validator.DynaValidatorForm) in this case, you must give action name instead of form name in your validation.xml file such as, formset .. you must use second way, take it easy.. -Original Message- From: jgfa92004 [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 1:11 PM To: struts-user@jakarta.apache.org Subject: Different validations for one form Hi everybody, Here is my problem : I have two jsp that share the same action class (and the same form). As they don't contain the same fields, I would like to have two different validations : one for each jsp. I use Validator and Struts 1.2. How can I do that ? Thanks in advance. Julie - 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] - Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! Créez votre Yahoo! Mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! Créez votre Yahoo! Mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Découvrez le nouveau Yahoo! Mail :
RE: Different validations for one form
add language and cuntry parameters ,, formset language=fr country=FR (country may be different from FR ) -Original Message- From: julie gautier [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 3:02 PM To: Struts Users Mailing List Subject: RE: Different validations for one form Done. I always have the same error... Seyhan Basmaci [EMAIL PROTECTED] wrote:you have two formset tag, (Note: The FormSet has language, country, and variant attributes that correspond with the java.util.Locale class. If they are not used, the FormSet will be set to the default locale.) Put /commercialplanprint into first tag, like below property=prop1 depends=required property=prop2 depends=required property=prop3 depends=required -Original Message- From: julie gautier [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 2:40 PM To: Struts Users Mailing List Subject: RE: Different validations for one form Thanks again for your help. So, my two jsp are : commercialplanList.jsp and commercialplanPrint.jsp. I have one form : CommercialPlanForm.class I have one action class : CommercialPlanAction.class Here is my struts-config : type=com.mypack.CommercialPlanAction name=commercialPlanForm scope=request input=/mainmenu.do type=com.mypack.CommercialPlanAction name=commercialPlanForm scope=request input=/mainmenu.do In validation.xml, I have : property=prop1 depends=required property=prop2 depends=required property=prop3 depends=required See the fields to be validated in commercialplanList.jsp are prop1 and prop2 and the field to be validated in commercialplanPrint.jsp is prop3. Now, I wrote in my jsps : in commercialplanPrint.jsp : and in commercialplanList.jsp : And CommercialPlanForm.class extends ValidatorActionForm Now when I try to access commercialplanPrint.jsp I still have an error that says : javax.servlet.jsp.JspException: No form found under 'commercialPlanForm' in locale 'fr' at org.apache.struts.taglib.html.JavascriptValidatorTag.renderJavascript(JavascriptValidatorTag.java:364) at org.apache.struts.taglib.html.JavascriptValidatorTag.doStartTag(JavascriptValidatorTag.java:335) at org.apache.jsp.commercialplanPrint_jsp._jspx_meth_html_javascript_0(commercialplanPrint_jsp.java:734) at org.apache.jsp.commercialplanPrint_jsp._jspService(commercialplanPrint_jsp.java:210) What am I doing wrong ? Thanks ! Seyhan Basmaci wrote: in your struts config file , define two map to same action class, for example , pathA and PathB in validation.xml,, define validation for each path,, I hope it works :), formset -Original Message- From: julie gautier [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 2:07 PM To: Struts Users Mailing List Subject: RE: Different validations for one form Ok, but I have the same action class too... So how will it know that for one jsp, it's a validation and for the other jsp it's the other validation to use... My two jsp share the same form and the same action class... Do you have an idea ? Thanks for your help. Seyhan Basmaci wrote: you can use form based validation or action based validation in struts 1.2 , 1) to use form based validation, form classes must extend ValidatorActionForm or DynaValidatorActionForm classes. (org.apache.struts.validator.ValidatorActionForm,org.apache.struts.validator.DynaValidatorActionForm) 2) to use action based validation , form classes must extend ValidatorForm or DynaValidatorForm classes. (org.apache.struts.validator.ValidatorForm,org.apache.struts.validator.DynaValidatorForm) in this case, you must give action name instead of form name in your validation.xml file such as, formset .. you must use second way, take it easy.. -Original Message- From: jgfa92004 [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 1:11 PM To: struts-user@jakarta.apache.org Subject: Different validations for one form Hi everybody, Here is my problem : I have two jsp that share the same action class (and the same form). As they don't contain the same fields, I would like to have two different validations : one for each jsp. I use Validator and Struts 1.2. How can I do that ? Thanks in advance. Julie - 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] - Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! Créez votre Yahoo! Mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de
RE: Different validations for one form
oppss, just try to add language parameter,, formset language=fr -Original Message- From: Seyhan Basmaci Sent: Friday, January 14, 2005 3:13 PM To: Struts Users Mailing List Subject: RE: Different validations for one form add language and cuntry parameters ,, formset language=fr country=FR (country may be different from FR ) -Original Message- From: julie gautier [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 3:02 PM To: Struts Users Mailing List Subject: RE: Different validations for one form Done. I always have the same error... Seyhan Basmaci [EMAIL PROTECTED] wrote:you have two formset tag, (Note: The FormSet has language, country, and variant attributes that correspond with the java.util.Locale class. If they are not used, the FormSet will be set to the default locale.) Put /commercialplanprint into first tag, like below property=prop1 depends=required property=prop2 depends=required property=prop3 depends=required -Original Message- From: julie gautier [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 2:40 PM To: Struts Users Mailing List Subject: RE: Different validations for one form Thanks again for your help. So, my two jsp are : commercialplanList.jsp and commercialplanPrint.jsp. I have one form : CommercialPlanForm.class I have one action class : CommercialPlanAction.class Here is my struts-config : type=com.mypack.CommercialPlanAction name=commercialPlanForm scope=request input=/mainmenu.do type=com.mypack.CommercialPlanAction name=commercialPlanForm scope=request input=/mainmenu.do In validation.xml, I have : property=prop1 depends=required property=prop2 depends=required property=prop3 depends=required See the fields to be validated in commercialplanList.jsp are prop1 and prop2 and the field to be validated in commercialplanPrint.jsp is prop3. Now, I wrote in my jsps : in commercialplanPrint.jsp : and in commercialplanList.jsp : And CommercialPlanForm.class extends ValidatorActionForm Now when I try to access commercialplanPrint.jsp I still have an error that says : javax.servlet.jsp.JspException: No form found under 'commercialPlanForm' in locale 'fr' at org.apache.struts.taglib.html.JavascriptValidatorTag.renderJavascript(JavascriptValidatorTag.java:364) at org.apache.struts.taglib.html.JavascriptValidatorTag.doStartTag(JavascriptValidatorTag.java:335) at org.apache.jsp.commercialplanPrint_jsp._jspx_meth_html_javascript_0(commercialplanPrint_jsp.java:734) at org.apache.jsp.commercialplanPrint_jsp._jspService(commercialplanPrint_jsp.java:210) What am I doing wrong ? Thanks ! Seyhan Basmaci wrote: in your struts config file , define two map to same action class, for example , pathA and PathB in validation.xml,, define validation for each path,, I hope it works :), formset -Original Message- From: julie gautier [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 2:07 PM To: Struts Users Mailing List Subject: RE: Different validations for one form Ok, but I have the same action class too... So how will it know that for one jsp, it's a validation and for the other jsp it's the other validation to use... My two jsp share the same form and the same action class... Do you have an idea ? Thanks for your help. Seyhan Basmaci wrote: you can use form based validation or action based validation in struts 1.2 , 1) to use form based validation, form classes must extend ValidatorActionForm or DynaValidatorActionForm classes. (org.apache.struts.validator.ValidatorActionForm,org.apache.struts.validator.DynaValidatorActionForm) 2) to use action based validation , form classes must extend ValidatorForm or DynaValidatorForm classes. (org.apache.struts.validator.ValidatorForm,org.apache.struts.validator.DynaValidatorForm) in this case, you must give action name instead of form name in your validation.xml file such as, formset .. you must use second way, take it easy.. -Original Message- From: jgfa92004 [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 1:11 PM To: struts-user@jakarta.apache.org Subject: Different validations for one form Hi everybody, Here is my problem : I have two jsp that share the same action class (and the same form). As they don't contain the same fields, I would like to have two different validations : one for each jsp. I use Validator and Struts 1.2. How can I do that ? Thanks in advance. Julie - 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] - Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! Créez votre Yahoo! Mail
Servlet.log()
Hello I am new to Struts. My first applications are examples that I download from several web sites. One of them logs the forms data with: servlet.log(...); I have already search information about this and the Struts home page refers this too. However I don't know where the logs are being saved. I can not find the file and the corresponding path. If you can help me, please reply. Thank you very much. Ana Margarida Sargento
Re: Using XML in struts
If you are not familiar with a lot of XML-related APIs, the easiest approach is to use the SAX API, in my opinion*. 1) Write a SAX event handler (receives events when XML elements are opened, closed, and when text values of attributes and elements are encountered -- you assemble your objects as the events arrive) 2) Configure a SAXParserFactory 3) Use the factory to create a SAXParser 4) Register your event handler with the parser 5) Create an input source from your XML file and connect it to the parser 6) Tell the parser to parse This is a streaming-style push technique -- you read the file from start to finish, caching whatever you are interested in. If you need random access (to be able to read in forward and reverse) to the file, take a look at DOM -- which is used for loading and holding an entire document in memory. I've never found a use for it. Another technique that is used, for example, in Jabber packet handling libraries, is pull parsing. Pull parsing is similar to push parsing except (to be very basic here) you can tell the parser to seek the part of the document you are interested in, rather than handle a bunch of events you aren't interested in. * There are higher level APIs that might suit you better, depending on what you are doing. Struts and Commons Validator use some sort of higher-level config library, if I'm not mistaken, that is designed for constructing objects/Maps out of config files, so you might have a look at the source code for one or both of those. I'm sure someone else could on the list could better inform you about this. Erik [EMAIL PROTECTED] wrote: Struts does not have a specific support for XML, but you can use inside a webapp all the libraries that you normally use under classic applications. For example, if you want to load a DOM for an XML file inside an action (not very elegant...), you can use DOM4J (or similar libraries). If you want to use XML files inside JSP pages you can use the xtags, and so on. Ciao Antonio Petrelli Hi all, How can i read XML files using struts? is this possible? Can any one provide a link or give an example for reading XML files using struts? :-) Jay - 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: Different validations for one form
when I do so, my application doesn't start anymore ans I have the following error : java.lang.NullPointerException org.apache.struts.taglib.html.JavascriptValidatorTag.renderJavascript(JavascriptValidatorTag.java:360) org.apache.struts.taglib.html.JavascriptValidatorTag.doStartTag(JavascriptValidatorTag.java:335) org.apache.jsp.logon_jsp._jspx_meth_html_javascript_0(logon_jsp.java:345) Seyhan Basmaci [EMAIL PROTECTED] wrote: oppss, just try to add language parameter,, -Original Message- From: Seyhan Basmaci Sent: Friday, January 14, 2005 3:13 PM To: Struts Users Mailing List Subject: RE: Different validations for one form add language and cuntry parameters ,, (country may be different from FR ) -Original Message- From: julie gautier [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 3:02 PM To: Struts Users Mailing List Subject: RE: Different validations for one form Done. I always have the same error... Seyhan Basmaci wrote:you have two formset tag, (Note: The FormSet has language, country, and variant attributes that correspond with the java.util.Locale class. If they are not used, the FormSet will be set to the default locale.) Put /commercialplanprint into first tag, like below property=prop1 depends=required property=prop2 depends=required property=prop3 depends=required -Original Message- From: julie gautier [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 2:40 PM To: Struts Users Mailing List Subject: RE: Different validations for one form Thanks again for your help. So, my two jsp are : commercialplanList.jsp and commercialplanPrint.jsp. I have one form : CommercialPlanForm.class I have one action class : CommercialPlanAction.class Here is my struts-config : type=com.mypack.CommercialPlanAction name=commercialPlanForm scope=request input=/mainmenu.do type=com.mypack.CommercialPlanAction name=commercialPlanForm scope=request input=/mainmenu.do In validation.xml, I have : property=prop1 depends=required property=prop2 depends=required property=prop3 depends=required See the fields to be validated in commercialplanList.jsp are prop1 and prop2 and the field to be validated in commercialplanPrint.jsp is prop3. Now, I wrote in my jsps : in commercialplanPrint.jsp : and in commercialplanList.jsp : And CommercialPlanForm.class extends ValidatorActionForm Now when I try to access commercialplanPrint.jsp I still have an error that says : javax.servlet.jsp.JspException: No form found under 'commercialPlanForm' in locale 'fr' at org.apache.struts.taglib.html.JavascriptValidatorTag.renderJavascript(JavascriptValidatorTag.java:364) at org.apache.struts.taglib.html.JavascriptValidatorTag.doStartTag(JavascriptValidatorTag.java:335) at org.apache.jsp.commercialplanPrint_jsp._jspx_meth_html_javascript_0(commercialplanPrint_jsp.java:734) at org.apache.jsp.commercialplanPrint_jsp._jspService(commercialplanPrint_jsp.java:210) What am I doing wrong ? Thanks ! Seyhan Basmaci wrote: in your struts config file , define two map to same action class, for example , pathA and PathB in validation.xml,, define validation for each path,, I hope it works :), formset -Original Message- From: julie gautier [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 2:07 PM To: Struts Users Mailing List Subject: RE: Different validations for one form Ok, but I have the same action class too... So how will it know that for one jsp, it's a validation and for the other jsp it's the other validation to use... My two jsp share the same form and the same action class... Do you have an idea ? Thanks for your help. Seyhan Basmaci wrote: you can use form based validation or action based validation in struts 1.2 , 1) to use form based validation, form classes must extend ValidatorActionForm or DynaValidatorActionForm classes. (org.apache.struts.validator.ValidatorActionForm,org.apache.struts.validator.DynaValidatorActionForm) 2) to use action based validation , form classes must extend ValidatorForm or DynaValidatorForm classes. (org.apache.struts.validator.ValidatorForm,org.apache.struts.validator.DynaValidatorForm) in this case, you must give action name instead of form name in your validation.xml file such as, formset .. you must use second way, take it easy.. -Original Message- From: jgfa92004 [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 1:11 PM To: struts-user@jakarta.apache.org Subject: Different validations for one form Hi everybody, Here is my problem : I have two jsp that share the same action class (and the same form). As they don't contain the same fields, I would like to have two different validations : one for each jsp. I use Validator and Struts 1.2. How can I do that ? Thanks in advance. Julie - To unsubscribe, e-mail: [EMAIL
Re: Servlet.log()
On 14/1/05 2:40 pm, Margarida Sargento [EMAIL PROTECTED] wrote: Hello I am new to Struts. My first applications are examples that I download from several web sites. One of them logs the forms data with: servlet.log(...); To solve of your logging problems use Log4j (http://logging.apache.org/log4j/docs/) Try adding this to your class: protected static Logger log = Logger.getLogger(yourclass.class); public yourMethod() { if (log.isDebugEnabled()) { log.debug(yourdata); } } put this file on your classpath (in your web-app it should be WEB-INF/classes): (log4j.properties) log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n log4j.logger.packageofyourclass=DEBUG, myclasslogger log4j.appender.myclasslogger=org.apache.log4j.RollingFileAppender log4j.appender.myclasslogger=/somepath/logs/yourpackage.log log4j.appender.myclasslogger.MaxFileSize=300KB log4j.appender.myclasslogger.MaxBackupIndex=1 log4j.appender.myclasslogger.layout=org.apache.log4j.PatternLayout log4j.appender.myclasslogger.layout.ConversionPattern=%d{ABSOLUTE} - %p %c - %m%n This will solve all logging problems in every class, if you replicate the same behaviour. Pedro Salgado I have already search information about this and the Struts home page refers this too. However I don't know where the logs are being saved. I can not find the file and the corresponding path. If you can help me, please reply. Thank you very much. Ana Margarida Sargento - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Servlet.log()
I am not veteran, but I think it will vary according to the servlet container you are using. If you are using TomCat, I think the log file will be in the directory {tomcat-home}/logs. Not sure, as I use Netbeans and the Tomcat server imbedded in it, which appears to put it in a different directory than this. When you find the right directory, there should be a file for every date that you have had the server running, with the date in the file names. If on Windows, you could always do a search for text inside a file starting at the Tomcat home directory and look for something that you are positive would be in the log file... Margarida Sargento [EMAIL PROTECTED] 01/14/2005 08:40 AM Please respond to Struts Users Mailing List To: Struts Users Mailing List user@struts.apache.org cc: Subject:Servlet.log() Hello I am new to Struts. My first applications are examples that I download from several web sites. One of them logs the forms data with: servlet.log(...); I have already search information about this and the Struts home page refers this too. However I don't know where the logs are being saved. I can not find the file and the corresponding path. If you can help me, please reply. Thank you very much. Ana Margarida Sargento
RE: Different validations for one form
Ok, I had to put the country attribute too... But I still have this error : javax.servlet.jsp.JspException: No form found under 'commercialPlanForm' in locale 'fr' at org.apache.struts.taglib.html.JavascriptValidatorTag.renderJavascript(JavascriptValidatorTag.java:364) at org.apache.struts.taglib.html.JavascriptValidatorTag.doStartTag(JavascriptValidatorTag.java:335) at org.apache.jsp.commercialplanPrint_jsp._jspx_meth_html_javascript_0(commercialplanPrint_jsp.java:734) at org.apache.jsp.commercialplanPrint_jsp._jspService(commercialplanPrint_jsp.java:210) Seyhan Basmaci [EMAIL PROTECTED] wrote:oppss, just try to add language parameter,, -Original Message- From: Seyhan Basmaci Sent: Friday, January 14, 2005 3:13 PM To: Struts Users Mailing List Subject: RE: Different validations for one form add language and cuntry parameters ,, (country may be different from FR ) -Original Message- From: julie gautier [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 3:02 PM To: Struts Users Mailing List Subject: RE: Different validations for one form Done. I always have the same error... Seyhan Basmaci wrote:you have two formset tag, (Note: The FormSet has language, country, and variant attributes that correspond with the java.util.Locale class. If they are not used, the FormSet will be set to the default locale.) Put /commercialplanprint into first tag, like below property=prop1 depends=required property=prop2 depends=required property=prop3 depends=required -Original Message- From: julie gautier [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 2:40 PM To: Struts Users Mailing List Subject: RE: Different validations for one form Thanks again for your help. So, my two jsp are : commercialplanList.jsp and commercialplanPrint.jsp. I have one form : CommercialPlanForm.class I have one action class : CommercialPlanAction.class Here is my struts-config : type=com.mypack.CommercialPlanAction name=commercialPlanForm scope=request input=/mainmenu.do type=com.mypack.CommercialPlanAction name=commercialPlanForm scope=request input=/mainmenu.do In validation.xml, I have : property=prop1 depends=required property=prop2 depends=required property=prop3 depends=required See the fields to be validated in commercialplanList.jsp are prop1 and prop2 and the field to be validated in commercialplanPrint.jsp is prop3. Now, I wrote in my jsps : in commercialplanPrint.jsp : and in commercialplanList.jsp : And CommercialPlanForm.class extends ValidatorActionForm Now when I try to access commercialplanPrint.jsp I still have an error that says : javax.servlet.jsp.JspException: No form found under 'commercialPlanForm' in locale 'fr' at org.apache.struts.taglib.html.JavascriptValidatorTag.renderJavascript(JavascriptValidatorTag.java:364) at org.apache.struts.taglib.html.JavascriptValidatorTag.doStartTag(JavascriptValidatorTag.java:335) at org.apache.jsp.commercialplanPrint_jsp._jspx_meth_html_javascript_0(commercialplanPrint_jsp.java:734) at org.apache.jsp.commercialplanPrint_jsp._jspService(commercialplanPrint_jsp.java:210) What am I doing wrong ? Thanks ! Seyhan Basmaci wrote: in your struts config file , define two map to same action class, for example , pathA and PathB in validation.xml,, define validation for each path,, I hope it works :), formset -Original Message- From: julie gautier [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 2:07 PM To: Struts Users Mailing List Subject: RE: Different validations for one form Ok, but I have the same action class too... So how will it know that for one jsp, it's a validation and for the other jsp it's the other validation to use... My two jsp share the same form and the same action class... Do you have an idea ? Thanks for your help. Seyhan Basmaci wrote: you can use form based validation or action based validation in struts 1.2 , 1) to use form based validation, form classes must extend ValidatorActionForm or DynaValidatorActionForm classes. (org.apache.struts.validator.ValidatorActionForm,org.apache.struts.validator.DynaValidatorActionForm) 2) to use action based validation , form classes must extend ValidatorForm or DynaValidatorForm classes. (org.apache.struts.validator.ValidatorForm,org.apache.struts.validator.DynaValidatorForm) in this case, you must give action name instead of form name in your validation.xml file such as, formset .. you must use second way, take it easy.. -Original Message- From: jgfa92004 [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 1:11 PM To: struts-user@jakarta.apache.org Subject: Different validations for one form Hi everybody, Here is my problem : I have two jsp that share the same action class (and the same form). As they don't contain the same fields, I would like to have two different validations : one for each jsp. I use Validator and
RE: Servlet.log()
Thanks. I'll try Log4j. I have read something about this too and it seems to be a good option. Ana -Original Message- From: Pedro Salgado [mailto:[EMAIL PROTECTED] Sent: sexta-feira, 14 de Janeiro de 2005 13:59 To: Struts Users Mailing List Subject: Re: Servlet.log() On 14/1/05 2:40 pm, Margarida Sargento [EMAIL PROTECTED] wrote: Hello I am new to Struts. My first applications are examples that I download from several web sites. One of them logs the forms data with: servlet.log(...); To solve of your logging problems use Log4j (http://logging.apache.org/log4j/docs/) Try adding this to your class: protected static Logger log = Logger.getLogger(yourclass.class); public yourMethod() { if (log.isDebugEnabled()) { log.debug(yourdata); } } put this file on your classpath (in your web-app it should be WEB-INF/classes): (log4j.properties) log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n log4j.logger.packageofyourclass=DEBUG, myclasslogger log4j.appender.myclasslogger=org.apache.log4j.RollingFileAppender log4j.appender.myclasslogger=/somepath/logs/yourpackage.log log4j.appender.myclasslogger.MaxFileSize=300KB log4j.appender.myclasslogger.MaxBackupIndex=1 log4j.appender.myclasslogger.layout=org.apache.log4j.PatternLayout log4j.appender.myclasslogger.layout.ConversionPattern=%d{ABSOLUTE} - %p %c - %m%n This will solve all logging problems in every class, if you replicate the same behaviour. Pedro Salgado I have already search information about this and the Struts home page refers this too. However I don't know where the logs are being saved. I can not find the file and the corresponding path. If you can help me, please reply. Thank you very much. Ana Margarida Sargento - 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: Servlet.log()
Hi, tanks. I am using Tomcat and I have already checked in the directory {tomcat-home}/logs (catalina.out and other files). However none of them received messages that I sent with servlet.log(...); It is not critical. I will try to resolve all logging issues with log4j. Thanks a lot. Ana -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: sexta-feira, 14 de Janeiro de 2005 14:06 To: Struts Users Mailing List Subject: Re: Servlet.log() I am not veteran, but I think it will vary according to the servlet container you are using. If you are using TomCat, I think the log file will be in the directory {tomcat-home}/logs. Not sure, as I use Netbeans and the Tomcat server imbedded in it, which appears to put it in a different directory than this. When you find the right directory, there should be a file for every date that you have had the server running, with the date in the file names. If on Windows, you could always do a search for text inside a file starting at the Tomcat home directory and look for something that you are positive would be in the log file... Margarida Sargento [EMAIL PROTECTED] 01/14/2005 08:40 AM Please respond to Struts Users Mailing List To: Struts Users Mailing List user@struts.apache.org cc: Subject:Servlet.log() Hello I am new to Struts. My first applications are examples that I download from several web sites. One of them logs the forms data with: servlet.log(...); I have already search information about this and the Struts home page refers this too. However I don't know where the logs are being saved. I can not find the file and the corresponding path. If you can help me, please reply. Thank you very much. Ana Margarida Sargento - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Re: Using XML in struts
At 8:42 AM -0500 1/14/05, Erik Weber wrote: If you are not familiar with a lot of XML-related APIs, the easiest approach is to use the SAX API, in my opinion*. You may be the first person I've ever encountered who finds SAX the easiest way to process XML! * There are higher level APIs that might suit you better, depending on what you are doing. Struts and Commons Validator use some sort of higher-level config library, if I'm not mistaken, that is designed for constructing objects/Maps out of config files, so you might have a look at the source code for one or both of those. I'm sure someone else could on the list could better inform you about this. This is commons-digester, and it does in fact make it extremely simple to read XML and produce objects from it, especially if you have the liberty of defining the XML syntax before you write the processing code. Digester really helped me get my design oriented towards decent externalization of configuration elements. I now prefer the Spring Framework's bean factory, because it standardizes what I normally use Digester for without needing to write even XML processing rules. Since I started using Digester (and then Spring), I have not had much cause to deal with XML in the DOM form directly, although I would think that for most newcomers, the tree model is more straightforward than SAX's event model. If you do need to do something with DOM, it's probably worth checking out dom4j or JDOM, two apis that simplify the DOM and provide a more Java-like API. Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com Narrow minds are weapons made for mass destruction -The Ex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using XML in struts
How can i read XML files using struts? is this possible? Can any one provide a link or give an example for reading XML files using struts? If you're talking about reading an XML file in your Java code, check out Jakarta Commons Digester: http://jakarta.apache.org/commons/digester/ -- Tim Slattery [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: Using XML in struts
Joe Germuska wrote: At 8:42 AM -0500 1/14/05, Erik Weber wrote: If you are not familiar with a lot of XML-related APIs, the easiest approach is to use the SAX API, in my opinion*. You may be the first person I've ever encountered who finds SAX the easiest way to process XML! Heh. I guess it's because I've written so many SAX event handlers, I feel like I can do it in my sleep now. I probably wrote a few (surely inferior) versions of commons-digester in my time. :) In fact, when I first started doing Web-app programming, I wrote an entire Struts-like framework complete with XML-based validation, similar to commons validator (I knew what Struts was but didn't feel like learning it at the time), as well as app configuration. I started with DOM but ended up using SAX for all that as I recall. Lately I've been using pull parsers, which are more efficient, but I still think not as dumb as SAX (dumb == good -- I like typing. Makes you feel like you're accomplishing something. Thinking hurts my noggin. :D ). Also, while I see your point that the overall concept of DOM might be more sensible in theory than that of SAX, I found that it's just easier to get going with the SAX API than with DOM or even JDOM. You can get something working with very few lines of code, and good examples are all over the Web. SAX can be a pain to debug though. I read this awesome book called Building Parsers in Java a couple years ago (best ASCII-art cover ever) that really inspired me and got me thinking along the right lines for using a model like SAX. It's kind of like, you have this robot, and you keep handing him parts. The robot is smart enough to know which parts to keep and which to ignore (pull is definitely a smarter model than this -- the robot would ask for the parts he wants -- but this is simpler). He keeps a collection of running objects -- objects that he has started assembling but hasn't yet finished. Managing the running objects is the only part that really involves any thought in coding. Assembly of an object normally starts when an opening element tag is encountered. Assembly continues as sub-elements and attributes are discovered. Once he has finished the object (usually when a matching closing element tag is encountered) the robot adds it to the final Collection, Map or complex Object to be returned. To me, it's kinda elegant. But the deeper the XML, the more difficult it becomes, because there are more running objects at any given time. But I appreciate your elaborating on commons digester. That's the one I was thinking of. I'll have to check that out. Also, I've never even looked at Spring. By the way, do you happen to know what type of parser either of those uses? Just curious. Thanks, Erik * There are higher level APIs that might suit you better, depending on what you are doing. Struts and Commons Validator use some sort of higher-level config library, if I'm not mistaken, that is designed for constructing objects/Maps out of config files, so you might have a look at the source code for one or both of those. I'm sure someone else could on the list could better inform you about this. This is commons-digester, and it does in fact make it extremely simple to read XML and produce objects from it, especially if you have the liberty of defining the XML syntax before you write the processing code. Digester really helped me get my design oriented towards decent externalization of configuration elements. I now prefer the Spring Framework's bean factory, because it standardizes what I normally use Digester for without needing to write even XML processing rules. Since I started using Digester (and then Spring), I have not had much cause to deal with XML in the DOM form directly, although I would think that for most newcomers, the tree model is more straightforward than SAX's event model. If you do need to do something with DOM, it's probably worth checking out dom4j or JDOM, two apis that simplify the DOM and provide a more Java-like API. Joe - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dynamic form bean property
Take a look at the LazyValidatorForm - http://struts.apache.org/api/org/apache/struts/validator/LazyValidatorForm.html The javadoc for the class also mentions alternatives. Hubert On Fri, 14 Jan 2005 10:59:32 + (GMT), Metin Erksan [EMAIL PROTECTED] wrote: hi how can i create or delete form bean properties ? for example i create myAction.java and myForm.java myForm.java has a nd b property,they have setters/getters. and i want to create c and d at runtime then delete c and b fore example is that possible ? sincerely - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Struts London Networking / Seasons Greeting / BOF VII / Friday 28 Jan 2005 @ 19:15 / Planning
Hi Welcome back. It's 2005. The time has nearly come for the Seventh BOF Struts London Networking. I think it is time to rename the group for 2005 to support the relevances of Faces technology. This would allow enthusiasts for standard JSF, MyFaces and Shale to join our merry band. I propose we rename the group to ``Struts JSF London Networking''. Are there any objections? Can I also start to have to some confirmations on 28 January 2005 please? BTW: Any suggestions for a venue in central London? I will set the venue by COB (Close of Business) Monday. BTW 2:There is also Java Special Interest Group meeting at lunch 12:00-14:00 at Sun's London Educational Offices, the nearest Underground tube is Bank. I believe it is about Tiget J2SE 5.0 taking place on the same day 28/01/2005 -Original Message- From: Pilgrim, Peter ==== I am planning the seventh Birds-of-Feather Struts London Networking for Friday 28th January 2005. (NB: This is a prelimanary date, it might change next year! ) 1) The venue is not yet planned: Central London, West End, the Docklands? Any suggestions / preference let me know. 2) The agenda is not yet planned. Let me know who will / wants to definitely attend. All are welcome see http://www.strutslondon.com . If you are flying into the UK, London and want to attend email offline. ==== -- Peter Pilgrim Operations/IT - Credit Suisse First Boston, 10 South Colonnade, London E14 4QJ, United Kingdom Tel: +44-(0)207-883-4497 == This message is for the sole use of the intended recipient. If you received this message in error please delete it and notify us. If this message was misdirected, CSFB does not waive any confidentiality or privilege. CSFB retains and monitors electronic communications sent through its network. Instructions transmitted over this system are not binding on CSFB until they are confirmed by us. Message transmission is not guaranteed to be secure. == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: Using XML in struts
Also, while I see your point that the overall concept of DOM might be more sensible in theory than that of SAX, I found that it's just easier to get going with the SAX API than with DOM or even JDOM. You can get something working with very few lines of code, and good examples are all over the Web. SAX can be a pain to debug though. Certainly not more sensible -- in fact, I've seen over and over again people who aren't comfortable with SAX implement things that involve reading enormous amounts of XML using DOM and then running out of memory. But they decompose the problem into first, get everything in; then do something to everything instead of get one in, handle it, and discard it. I read this awesome book called Building Parsers in Java a couple years ago That sounds worth looking up... But I appreciate your elaborating on commons digester. That's the one I was thinking of. I'll have to check that out. Also, I've never even looked at Spring. By the way, do you happen to know what type of parser either of those uses? Just curious. Digester is a wrapper around SAX. Digester itself extends org.xml.sax.helpers.DefaultHandler And while the most common way people use Digester is to create a tree of objects, once you get inside it, you realize that you can do a lot more. You can write Digester rules that do the aforementioned get one, handle it and discard it as well as the more common rules which do get one and add it to the tree. Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com Narrow minds are weapons made for mass destruction -The Ex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: Using XML in struts
JDOM: http://www.jdom.org/. If you are new to xml-java parsing, then this is the way to go. When I started learning about xml parsing with java a while ago, I researched various methods and found that JDOM provides the easiest route to get things done. A quote from JDOM mission: It behaves like Java, it uses Java collections, it is completely natural API for current Java developers, and it provides a low-cost entry point for using XML. On Fri, 14 Jan 2005 10:34:58 -0500, Erik Weber [EMAIL PROTECTED] wrote: Joe Germuska wrote: At 8:42 AM -0500 1/14/05, Erik Weber wrote: If you are not familiar with a lot of XML-related APIs, the easiest approach is to use the SAX API, in my opinion*. You may be the first person I've ever encountered who finds SAX the easiest way to process XML! Heh. I guess it's because I've written so many SAX event handlers, I feel like I can do it in my sleep now. I probably wrote a few (surely inferior) versions of commons-digester in my time. :) In fact, when I first started doing Web-app programming, I wrote an entire Struts-like framework complete with XML-based validation, similar to commons validator (I knew what Struts was but didn't feel like learning it at the time), as well as app configuration. I started with DOM but ended up using SAX for all that as I recall. Lately I've been using pull parsers, which are more efficient, but I still think not as dumb as SAX (dumb == good -- I like typing. Makes you feel like you're accomplishing something. Thinking hurts my noggin. :D ). Also, while I see your point that the overall concept of DOM might be more sensible in theory than that of SAX, I found that it's just easier to get going with the SAX API than with DOM or even JDOM. You can get something working with very few lines of code, and good examples are all over the Web. SAX can be a pain to debug though. I read this awesome book called Building Parsers in Java a couple years ago (best ASCII-art cover ever) that really inspired me and got me thinking along the right lines for using a model like SAX. It's kind of like, you have this robot, and you keep handing him parts. The robot is smart enough to know which parts to keep and which to ignore (pull is definitely a smarter model than this -- the robot would ask for the parts he wants -- but this is simpler). He keeps a collection of running objects -- objects that he has started assembling but hasn't yet finished. Managing the running objects is the only part that really involves any thought in coding. Assembly of an object normally starts when an opening element tag is encountered. Assembly continues as sub-elements and attributes are discovered. Once he has finished the object (usually when a matching closing element tag is encountered) the robot adds it to the final Collection, Map or complex Object to be returned. To me, it's kinda elegant. But the deeper the XML, the more difficult it becomes, because there are more running objects at any given time. But I appreciate your elaborating on commons digester. That's the one I was thinking of. I'll have to check that out. Also, I've never even looked at Spring. By the way, do you happen to know what type of parser either of those uses? Just curious. Thanks, Erik * There are higher level APIs that might suit you better, depending on what you are doing. Struts and Commons Validator use some sort of higher-level config library, if I'm not mistaken, that is designed for constructing objects/Maps out of config files, so you might have a look at the source code for one or both of those. I'm sure someone else could on the list could better inform you about this. This is commons-digester, and it does in fact make it extremely simple to read XML and produce objects from it, especially if you have the liberty of defining the XML syntax before you write the processing code. Digester really helped me get my design oriented towards decent externalization of configuration elements. I now prefer the Spring Framework's bean factory, because it standardizes what I normally use Digester for without needing to write even XML processing rules. Since I started using Digester (and then Spring), I have not had much cause to deal with XML in the DOM form directly, although I would think that for most newcomers, the tree model is more straightforward than SAX's event model. If you do need to do something with DOM, it's probably worth checking out dom4j or JDOM, two apis that simplify the DOM and provide a more Java-like API. Joe - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Struts London Networking / Seasons Greeting / BOF VII / Friday 28 Jan 2005 @ 19:15 / Planning
Hello all, Sorry. still busy with work :-( Hopefully I see you all next time Regards marco -Original Message- From: Pilgrim, Peter [mailto:[EMAIL PROTECTED] Sent: 14 January 2005 16:02 To: Pilgrim, Peter; Adam Hardy (E-mail); Alan Mehio (E-mail); Alex McLintock (E-mail); Allister Sneddon (E-mail); Charles Cordingley (E-mail); Christopher Marsh-Bourdon (E-mail); Daniel Perry (E-mail); Duncan Mills (E-mail); Hue Holleran (E-mail); John Bell (E-mail); Jonathan Butler (E-mail); Marco Mistroni (E-mail); Niall Pemberton (E-mail); 'Peter Pilgrim (Xenonique)'; Suman Prashanth. S (E-mail); Thomas Plümpe (E-mail); Tim Penhey (E-mail) Cc: 'Struts User Apache (E-mail)' Subject: RE: [OT] Struts London Networking / Seasons Greeting / BOF VII / Friday 28 Jan 2005 @ 19:15 / Planning Hi Welcome back. It's 2005. The time has nearly come for the Seventh BOF Struts London Networking. I think it is time to rename the group for 2005 to support the relevances of Faces technology. This would allow enthusiasts for standard JSF, MyFaces and Shale to join our merry band. I propose we rename the group to ``Struts JSF London Networking''. Are there any objections? Can I also start to have to some confirmations on 28 January 2005 please? BTW: Any suggestions for a venue in central London? I will set the venue by COB (Close of Business) Monday. BTW 2:There is also Java Special Interest Group meeting at lunch 12:00-14:00 at Sun's London Educational Offices, the nearest Underground tube is Bank. I believe it is about Tiget J2SE 5.0 taking place on the same day 28/01/2005 -Original Message- From: Pilgrim, Peter ==== I am planning the seventh Birds-of-Feather Struts London Networking for Friday 28th January 2005. (NB: This is a prelimanary date, it might change next year! ) 1) The venue is not yet planned: Central London, West End, the Docklands? Any suggestions / preference let me know. 2) The agenda is not yet planned. Let me know who will / wants to definitely attend. All are welcome see http://www.strutslondon.com . If you are flying into the UK, London and want to attend email offline. ==== -- Peter Pilgrim Operations/IT - Credit Suisse First Boston, 10 South Colonnade, London E14 4QJ, United Kingdom Tel: +44-(0)207-883-4497 == This message is for the sole use of the intended recipient. If you received this message in error please delete it and notify us. If this message was misdirected, CSFB does not waive any confidentiality or privilege. CSFB retains and monitors electronic communications sent through its network. Instructions transmitted over this system are not binding on CSFB until they are confirmed by us. Message transmission is not guaranteed to be secure. == - 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]
Are there struts tags to access constants in Java
Looking for a way to avoid using = %= JavaConstClass.JAVA_CONST % in my .jsp Are there struts tags that can do the equivalent. Thanks in advance. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: nested:checkbox question
Specify the value that it will use to determine whether the box is checked or not: nested:checkbox property=state value=on/ Hubert On Fri, 14 Jan 2005 10:03:13 -0200, Vinicius Caldeira Carvalho [EMAIL PROTECTED] wrote: Hi there. I have a nested object where one of its properties is a string representing on|off. When converting it to a form I'm using a nested:checkbox as shown: nested:checkbox property=state/ Problem is, it should be checked when it's on, and unchecked when off, and it's not working. How can I achive this? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Are there struts tags to access constants in Java
Take a look over in taglibs. There is a cool tag (called unstandard) for binding values. http://jakarta.apache.org/taglibs/sandbox/doc/unstandard-doc/ This will do what you want. -- James Mitchell Software Engineer / Open Source Evangelist EdgeTech, Inc. 678.910.8017 AIM: jmitchtx - Original Message - From: kjc [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Friday, January 14, 2005 11:31 AM Subject: Are there struts tags to access constants in Java Looking for a way to avoid using = %= JavaConstClass.JAVA_CONST % in my .jsp Are there struts tags that can do the equivalent. Thanks in advance. - 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: does not contain handler parameter
On Fri, 14 Jan 2005 10:55:57 -0200, Flávio Maldonado [EMAIL PROTECTED] wrote: Hi people! Anybody knows what kind of error is this? exception javax.servlet.ServletException: Request[/user] does not contain handler parameter named action org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.java:196) org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:465) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422) org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:505) javax.servlet.http.HttpServlet.service(HttpServlet.java:743) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) note The full stack trace of the root cause is available in the Tomcat logs. In the struts-config.xml, the action mapping is like this: !-- User Action -- action path=/user type=com.sednet.odonto.web.actions.UserAction name=userForm scope=session parameter=action UserAction is a LookupDispatchAction and it expects a parameter named action in the request. If it doesn't you should expect to see this exception. (Override unspecified for graceful handling) input=/userp1.jsp validate=false forward name=success path=/success.jsp/ forward name=page1 path=/userp1.jsp/ forward name=page2 path=/userp2.jsp/ forward name=page3 path=/userp3.jsp/ forward name=cancel path=/begin.jsp/ /action Thanks... Flávio Vilasboas Maldonado Diretor de Desenvolvimento SedNet Soluções em TI (35)3471-9381 - 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]
validWhen with multiple arguments
I am using 1.2.4 and want to use the validWhen, but I need more than 1 argument. I actually need 2-5 arguments based on the logic I am trying to solve. Currently I have to create a custom Validator, but would hope to use the default one instead. Is this possible in 1.2.4 or 1.2.6? Mick Knutson Wells Fargo Business Direct Information Systems (415) 222-1020 This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: Using XML in struts
+1 on JDOM unless you know upfront that the XML file is going to be big (greater than a couple of MB). --- sudip shrestha [EMAIL PROTECTED] wrote: JDOM: http://www.jdom.org/. If you are new to xml-java parsing, then this is the way to go. When I started learning about xml parsing with java a while ago, I researched various methods and found that JDOM provides the easiest route to get things done. A quote from JDOM mission: It behaves like Java, it uses Java collections, it is completely natural API for current Java developers, and it provides a low-cost entry point for using XML. On Fri, 14 Jan 2005 10:34:58 -0500, Erik Weber [EMAIL PROTECTED] wrote: Joe Germuska wrote: At 8:42 AM -0500 1/14/05, Erik Weber wrote: If you are not familiar with a lot of XML-related APIs, the easiest approach is to use the SAX API, in my opinion*. You may be the first person I've ever encountered who finds SAX the easiest way to process XML! Heh. I guess it's because I've written so many SAX event handlers, I feel like I can do it in my sleep now. I probably wrote a few (surely inferior) versions of commons-digester in my time. :) In fact, when I first started doing Web-app programming, I wrote an entire Struts-like framework complete with XML-based validation, similar to commons validator (I knew what Struts was but didn't feel like learning it at the time), as well as app configuration. I started with DOM but ended up using SAX for all that as I recall. Lately I've been using pull parsers, which are more efficient, but I still think not as dumb as SAX (dumb == good -- I like typing. Makes you feel like you're accomplishing something. Thinking hurts my noggin. :D ). Also, while I see your point that the overall concept of DOM might be more sensible in theory than that of SAX, I found that it's just easier to get going with the SAX API than with DOM or even JDOM. You can get something working with very few lines of code, and good examples are all over the Web. SAX can be a pain to debug though. I read this awesome book called Building Parsers in Java a couple years ago (best ASCII-art cover ever) that really inspired me and got me thinking along the right lines for using a model like SAX. It's kind of like, you have this robot, and you keep handing him parts. The robot is smart enough to know which parts to keep and which to ignore (pull is definitely a smarter model than this -- the robot would ask for the parts he wants -- but this is simpler). He keeps a collection of running objects -- objects that he has started assembling but hasn't yet finished. Managing the running objects is the only part that really involves any thought in coding. Assembly of an object normally starts when an opening element tag is encountered. Assembly continues as sub-elements and attributes are discovered. Once he has finished the object (usually when a matching closing element tag is encountered) the robot adds it to the final Collection, Map or complex Object to be returned. To me, it's kinda elegant. But the deeper the XML, the more difficult it becomes, because there are more running objects at any given time. But I appreciate your elaborating on commons digester. That's the one I was thinking of. I'll have to check that out. Also, I've never even looked at Spring. By the way, do you happen to know what type of parser either of those uses? Just curious. Thanks, Erik * There are higher level APIs that might suit you better, depending on what you are doing. Struts and Commons Validator use some sort of higher-level config library, if I'm not mistaken, that is designed for constructing objects/Maps out of config files, so you might have a look at the source code for one or both of those. I'm sure someone else could on the list could better inform you about this. This is commons-digester, and it does in fact make it extremely simple to read XML and produce objects from it, especially if you have the liberty of defining the XML syntax before you write the processing code. Digester really helped me get my design oriented towards decent externalization of configuration elements. I now prefer the Spring Framework's bean factory, because it standardizes what I normally use Digester for without needing to write even XML processing rules. Since I started using Digester (and then Spring), I have not had much cause to deal with XML in the DOM form directly, although I would think that for most newcomers, the tree model is more straightforward than SAX's event model. If you do need to do something with DOM, it's probably worth checking out dom4j or JDOM, two apis that simplify the DOM and provide a more Java-like API. Joe -
Re: Action Chaining
Hi, Todd, Check out: http://www.michaelmcgrady.com/button/. The DispatchAction there is unlike the one here. I use something close but a little different. Still, all you have to do is to give the property (name in HTML) the suffix you specifiy as the DISPATCH_METHOD_SUFFIX (see below). I use .method. NOTE THAT THIS LEAVES YOU FREE TO SPECIFY WHATEVER YOU WANT AS THE parameter in the action mapping and as the value of the property in the submit, button, etc. This gives you all sorts of cool things you can do. I use: public abstract class StateBaseAction extends Action { private static final String DISPATCH_METHOD_SUFFIX = .method; private static final String EXECUTE= execute; private static final String PERFORM= perform; private static final String DISPATCH_RECURSIVE = dispatch.recursive; private static final String DISPATCH_METHOD= dispatch.method; protectedHashMap methods= new HashMap(); protectedClass [] types = { ActionMapping.class, ActionForm.class, HttpServletRequest.class, HttpServletResponse.class }; public abstract ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, NoSuchMethodException; protected void saveMessages(HttpServletRequest request, ActionMessages errors) { if ((errors == null) || errors.isEmpty()) { request.removeAttribute(Globals.ERROR_KEY); return; } request.setAttribute(Globals.ERROR_KEY, errors); } public String getMessage(HttpServletRequest request, String key) throws IOException, ServletException { HttpSession session = request.getSession(); Locale locale = (Locale)session.getAttribute(Globals.LOCALE_KEY); MessageResources messages = this.getResources(request); return messages.getMessage(locale,key); } protected ActionForward method(Action action, ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { Class clazz = action.getClass(); String methodName = getMethodName(request,mapping); if(methodName == null) { unspecified(mapping,form,request,response); } else if (EXECUTE.equals(methodName) || PERFORM.equals(methodName)){ MessageResources messages = MessageResources.getMessageResources (org.apache.struts.actions.LocalStrings); String message = messages.getMessage(DISPATCH_RECURSIVE, mapping.getPath()); throw new ServletException(message); } Method method = null; try { method = getMethod(clazz,methodName); } catch(NoSuchMethodException nsme) { MessageResources messages = MessageResources.getMessageResources (org.apache.struts.actions.LocalStrings); String message = messages.getMessage(DISPATCH_METHOD, mapping.getPath(), methodName); throw nsme; } ActionForward forward = null; try { Object args[] = { mapping, form, request, response }; forward = (ActionForward)method.invoke(action, args); } catch(ClassCastException cce) { StdOut.log(SiteConstant.ERROR_LOG,StateBaseAction error 108 = + cce.getMessage()); } catch(IllegalAccessException iae) { StdOut.log(SiteConstant.ERROR_LOG,StateBaseAction errorn 110 = + iae.getMessage()); } catch(InvocationTargetException ite) { Throwable t = ite.getTargetException(); if (t instanceof Exception) { StdOut.log(SiteConstant.ERROR_LOG,StateBaseAction error 115 = + ((Exception)t).getMessage()); } else { StdOut.log(SiteConstant.ERROR_LOG,StateBaseAction error 117 = + ite.getMessage()); } } return forward; } private static String getMethodName(HttpServletRequest request, ActionMapping mapping) { String methodName = null; String buttonValue = null; String paramProperty = mapping.getParameter(); if((paramProperty != null)) { int index = paramProperty.indexOf('.'); if(index -1) { methodName = paramProperty.substring(0,index); } else { return methodName = paramProperty; } } Enumeration enum = request.getParameterNames(); while(enum.hasMoreElements()) { buttonValue = (String)enum.nextElement();
Pre-compiling Struts-based JSPs
I have been looking into using the jspc ant task to pre-compile our Struts-based application. In comparing the Java code generated by the jspc task and the Java code generated by Tomcat 4.1.x there are some differences, in particular the package names. Also, jspc wants to generate the fraction of web.xml for listing the servlets, which doesn't make sense to me in a Struts application. Is there any advice posted out there about pre-compiling Struts-based applications? Am I completely wrapped around the axle on this? Thanks. --Marty - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Action Chaining
Oops, try this! public abstract class StateBaseAction extends Action { private static final String DISPATCH_METHOD_SUFFIX = .method; private static final String EXECUTE= execute; private static final String PERFORM= perform; private static final String DISPATCH_RECURSIVE = dispatch.recursive; private static final String DISPATCH_METHOD= dispatch.method; protectedHashMap methods= new HashMap(); protectedClass [] types = { ActionMapping.class, ActionForm.class, HttpServletRequest.class, HttpServletResponse.class }; public abstract ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, NoSuchMethodException; protected void saveMessages(HttpServletRequest request, ActionMessages errors) { if ((errors == null) || errors.isEmpty()) { request.removeAttribute(Globals.ERROR_KEY); return; } request.setAttribute(Globals.ERROR_KEY, errors); } public String getMessage(HttpServletRequest request, String key) throws IOException, ServletException { HttpSession session = request.getSession(); Locale locale = (Locale)session.getAttribute(Globals.LOCALE_KEY); MessageResources messages = this.getResources(request); return messages.getMessage(locale,key); } protected ActionForward method(Action action, ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { Class clazz = action.getClass(); String methodName = getMethodName(request,mapping); if (EXECUTE.equals(methodName) || PERFORM.equals(methodName)){ MessageResources messages = MessageResources.getMessageResources (org.apache.struts.actions.LocalStrings); String message = messages.getMessage(DISPATCH_RECURSIVE, mapping.getPath()); throw new ServletException(message); } Method method = null; try { method = getMethod(clazz,methodName); } catch(NoSuchMethodException nsme) { MessageResources messages = MessageResources.getMessageResources (org.apache.struts.actions.LocalStrings); String message = messages.getMessage(DISPATCH_METHOD, mapping.getPath(), methodName); throw nsme; } ActionForward forward = null; try { Object args[] = { mapping, form, request, response }; forward = (ActionForward)method.invoke(action, args); } catch(ClassCastException cce) { StdOut.log(SiteConstant.ERROR_LOG,StateBaseAction error 108 = + cce.getMessage()); } catch(IllegalAccessException iae) { StdOut.log(SiteConstant.ERROR_LOG,StateBaseAction errorn 110 = + iae.getMessage()); } catch(InvocationTargetException ite) { Throwable t = ite.getTargetException(); if (t instanceof Exception) { StdOut.log(SiteConstant.ERROR_LOG,StateBaseAction error 115 = + ((Exception)t).getMessage()); } else { StdOut.log(SiteConstant.ERROR_LOG,StateBaseAction error 117 = + ite.getMessage()); } } return forward; } private static String getMethodName(HttpServletRequest request, ActionMapping mapping) { String methodName = null; String buttonValue = null; String paramProperty = mapping.getParameter(); if((paramProperty != null)) { int index = paramProperty.indexOf('.'); if(index -1) { methodName = paramProperty.substring(0,index); } else { return methodName = paramProperty; } } Enumeration enum = request.getParameterNames(); while(enum.hasMoreElements()) { buttonValue = (String)enum.nextElement(); if(buttonValue.indexOf(DISPATCH_METHOD_SUFFIX) = 0) { methodName = buttonValue; break; } } if(methodName == null) { return null; } return methodName.substring(0,methodName.indexOf('.')); } private Method getMethod(Class clazz, String name) throws NoSuchMethodException { synchronized(methods) { Method method = (Method) methods.get(name); if (method == null) { method = clazz.getMethod(name, types); methods.put(name, method); } return (method); } } protected
Re: [OT] Re: Using XML in struts
Joe Germuska wrote: Also, while I see your point that the overall concept of DOM might be more sensible in theory than that of SAX, I found that it's just easier to get going with the SAX API than with DOM or even JDOM. You can get something working with very few lines of code, and good examples are all over the Web. SAX can be a pain to debug though. Certainly not more sensible -- in fact, I've seen over and over again people who aren't comfortable with SAX implement things that involve reading enormous amounts of XML using DOM and then running out of memory. But they decompose the problem into first, get everything in; then do something to everything instead of get one in, handle it, and discard it. I was trying to agree with you. :) But yeah, you're right of course. I read this awesome book called Building Parsers in Java a couple years ago That sounds worth looking up... These days, so many books are about how to use vendor products or APIs. Mastering this or that, Up to Speed with this or that, and the ever popular Professional this or that. I'm not knocking those -- I need those too of course. But I really appreciate getting my hands on those rare books that just focus on the fruits of someone's creativity and inventiveness. You may never need to create your own language or even build your own regular expression parser, but, do you enjoy the art of programming? Do you enjoy math and science? Do you like to learn about different ways to approach the same problem? Do you like to build a better mousetrap? Dragging and dropping beans and jar files is not my idea of a good time. Too bad all any client/tech shop seems to want is the same thing someone else already has done, with a new marketing twist. Once we have CRUD in a bottle for $19.95 and all the legacy stuff is snuffed out, what will programmers do for a living? Ah, I'm just complaining as usual. Anyway, of the dozens of Java books I have discovered and/or bought in the last few years, a few stand out in the way I described: * Building Parsers With Java, by Steven John Metsker, Addison Wesley (0-201-71962-2) -- creative, well organized, well written, well edited, just a nice piece of work that definitely wasn't cranked out. A fun book about creating and interpreting your own languages. * Digital Audio with Java, by Craig A. Lindley, Prentice Hall (0-13-087676-3) -- ever wanted to know how to build a parametric EQ in Java, from the knobs and LEDs all the way to the wave shaping? * Java Design, by Peter Coad (TogetherSoft) and Mark Mayfield, Prentice Hall (0-13-981-6) -- offers a perspective on design that you probably won't find anywhere else (with chaper titles such as Design with Threads and Design with Notification, and hand-drawn diagrams); forget that IDE and get out your pad and pencil. Perhaps funny that I should say this, being a lover of lowest-level programming, but I have found that the books that have helped me the most as a programmer (in the long run) are ones about design patterns, idioms and algorithms (all high-level things in some fashion), rather than those about the latest API or product. Unfortunately I cannot back up that statement with $$$ earned -- at least not yet. The GoF book was published how long ago? How many tech books of today are of equal value? I guess it depends on your perspective. Speaking of perspective, ever read The Timeless Way of Building? How about (wyy OT) The Fourth Dimension? Man, I need a life. :) Cheers, Erik But I appreciate your elaborating on commons digester. That's the one I was thinking of. I'll have to check that out. Also, I've never even looked at Spring. By the way, do you happen to know what type of parser either of those uses? Just curious. Digester is a wrapper around SAX. Digester itself extends org.xml.sax.helpers.DefaultHandler And while the most common way people use Digester is to create a tree of objects, once you get inside it, you realize that you can do a lot more. You can write Digester rules that do the aforementioned get one, handle it and discard it as well as the more common rules which do get one and add it to the tree. Joe - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Action Chaining
At 7:35 AM -0500 1/14/05, [EMAIL PROTECTED] wrote: Jack, You have said that LookupDispatchAction is outdated and inefficient. I have at a minimum 6 different actions that need to be performed per page, not including load. What else would you recommend as a solution? I'm not sure what the perceived inefficiencies are. We use a variation of this extensively at my day job, and I find the dispatch model a very nice way to organize code. We prefer to cluster related behavior (although at a level higher than per-page) rather than have an explosion of classes to understand. So, for us, from a code-grokking perspective, it gains efficiency. Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com Narrow minds are weapons made for mass destruction -The Ex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Pre-compiling Struts-based JSPs
i ran into the same problem as well. what i can tell you is that because jspc generates different import statements than tomcat, this is the reason why the generated web.xml fragment is useful. this fragment basically maps the pre-compiled jsps so that it when the jsp is requested your app will know where to look for the jsp class. i have tried to get jspc to produce the same import statements as tomcat does but i gave up after a while of unsuccessful attempts. in the end, i simply used the web.xml fragment and it works fine. and a positive side effect to this is that you don't need to include the actual jsps at all. you can deploy war files that can be completely free of jsp files, so your war file is smaller and your client never sees any jsp source. woodchuck --- Martin Wegner [EMAIL PROTECTED] wrote: I have been looking into using the jspc ant task to pre-compile our Struts-based application. In comparing the Java code generated by the jspc task and the Java code generated by Tomcat 4.1.x there are some differences, in particular the package names. Also, jspc wants to generate the fraction of web.xml for listing the servlets, which doesn't make sense to me in a Struts application. Is there any advice posted out there about pre-compiling Struts-based applications? Am I completely wrapped around the axle on this? Thanks. --Marty - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail - Find what you need with new enhanced search. http://info.mail.yahoo.com/mail_250 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Help with logic tags, and commas please.
I have the following code that prints something like this: BLN, BCard, SecCard, EquipExp There may be any combination of any of these 4 items, or non at all. And what I want is the ability to properly add commas after each item, or not print a comma if there is not an item: logic:equal name=creditApplicationListDto property=businessLine value=true bean:message key=label.bln/nbsp;, /logic:equal logic:equal name=creditApplicationListDto property=businessCard value=true bean:message key=label.bcard/nbsp;, /logic:equal logic:equal name=creditApplicationListDto property=securedCard value=true bean:message key=label.seccard/nbsp;, /logic:equal logic:equal name=creditApplicationListDto property=equipmentExpress value=true bean:message key=label.equipExpress/nbsp; /logic:equal Mick Knutson Wells Fargo Business Direct Information Systems (415) 222-1020 This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Pre-compiling Struts-based JSPs
Woodchuck, Thanks for the advice. Glad to hear someone has followed the road before me. I found this useful link as well: http://www.artima.com/forums/flat.jsp?forum=121thread=19915 Question: how do you handle the importing of the fragment into your web.xml? Are you using copy and filterset in Ant? If so, how do you put in your filterset token such that you still have a valid web.xml? Thanks. --Marty --- Woodchuck [EMAIL PROTECTED] wrote: i ran into the same problem as well. what i can tell you is that because jspc generates different import statements than tomcat, this is the reason why the generated web.xml fragment is useful. this fragment basically maps the pre-compiled jsps so that it when the jsp is requested your app will know where to look for the jsp class. i have tried to get jspc to produce the same import statements as tomcat does but i gave up after a while of unsuccessful attempts. in the end, i simply used the web.xml fragment and it works fine. and a positive side effect to this is that you don't need to include the actual jsps at all. you can deploy war files that can be completely free of jsp files, so your war file is smaller and your client never sees any jsp source. woodchuck --- Martin Wegner [EMAIL PROTECTED] wrote: I have been looking into using the jspc ant task to pre-compile our Struts-based application. In comparing the Java code generated by the jspc task and the Java code generated by Tomcat 4.1.x there are some differences, in particular the package names. Also, jspc wants to generate the fraction of web.xml for listing the servlets, which doesn't make sense to me in a Struts application. Is there any advice posted out there about pre-compiling Struts-based applications? Am I completely wrapped around the axle on this? Thanks. --Marty - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail - Find what you need with new enhanced search. http://info.mail.yahoo.com/mail_250 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts FormFile and html:file
I am still searching for an answer. Thanks in advance. -Sean -Original Message- Sent: Monday, January 10, 2005 5:44 PM To: user@struts.apache.org Subject: Struts FormFile and html:file I read the documentation for the html:file tag http://struts.apache.org/userGuide/struts-html.html#file According to the Struts documentation: WARNING: In order to correctly recognize uploaded files, the ActionForm bean associated with this form must include a statement setting the corresponding org.apache.struts.upload.FormFile property to null in the reset() method. I examined the Struts Upload example application and I noticed that UploadForm.java has a reset method. However, UploadForm's reset method _does not_ set the FormFile property to null: http://cvs.apache.org/viewcvs.cgi/jakarta-struts/src/examples/org/apache /struts/webapp/upload/UploadForm.java?rev=HEADview=markup I have an upload form in my application and I want to know if I need to implement set the FormFile variable equal to null in my form's reset method. Thanks in advance. -Sean - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help with logic tags, and commas please.
On Fri, 14 Jan 2005 13:04:07 -0600, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I have the following code that prints something like this: BLN, BCard, SecCard, EquipExp There may be any combination of any of these 4 items, or non at all. And what I want is the ability to properly add commas after each item, or not print a comma if there is not an item: I would create a tag for this, rather then do it with the standard ones. I think it would be easier and cleaner. Something like: wf:businessLineOut name=creditApplicationListDto/ logic:equal name=creditApplicationListDto property=businessLine value=true bean:message key=label.bln/nbsp;, /logic:equal logic:equal name=creditApplicationListDto property=businessCard value=true bean:message key=label.bcard/nbsp;, /logic:equal logic:equal name=creditApplicationListDto property=securedCard value=true bean:message key=label.seccard/nbsp;, /logic:equal logic:equal name=creditApplicationListDto property=equipmentExpress value=true bean:message key=label.equipExpress/nbsp; /logic:equal Mick Knutson Wells Fargo Business Direct Information Systems (415) 222-1020 This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help with logic tags, and commas please.
Not exactly the same, since I have use of a list but here's how I handled it in JSTL... c:forEach items=${sessionScope.auditorList} var=auditor varStatus=status c:if test=${!status.last} c:out value=${auditor.name}/,nbsp /c:if c:if test=${status.last} c:out value=${auditor.name}/ /c:if /c:forEach Bart [EMAIL PROTECTED] wrote on 01/14/2005 02:04:07 PM: I have the following code that prints something like this: BLN, BCard, SecCard, EquipExp There may be any combination of any of these 4 items, or non at all. And what I want is the ability to properly add commas after each item, or not print a comma if there is not an item: logic:equal name=creditApplicationListDto property=businessLine value=true bean:message key=label.bln/nbsp;, /logic:equal logic:equal name=creditApplicationListDto property=businessCard value=true bean:message key=label.bcard/nbsp;, /logic:equal logic:equal name=creditApplicationListDto property=securedCard value=true bean:message key=label.seccard/nbsp;, /logic:equal logic:equal name=creditApplicationListDto property=equipmentExpress value=true bean:message key=label.equipExpress/nbsp; /logic:equal Mick Knutson Wells Fargo Business Direct Information Systems (415) 222-1020 This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Action Chaining
Hi, Joe, I think you sort of punched the pouch here. Let me explain. All your questions were answered in my posts, which you must have not read. Maybe you just read the first post and did not check out the later ones? I have suggested an answer to cluster related behavior, if you read what I said and the code I provided. What I objected to has nothing to do with what you said. In fact, that is exactly what the code provided does. I could not agree with you more, so it is sort of humous reading your post. What I objected to was the LOOKUP mechanism in LookupDispatchAction and the reason that is seen as horribly inefficient, hard to maintain, and generally belonging to the stone ages in this area, is explained in detail at the citation/URL mentioned. So, we are in agreement given what you said. If you use LookupDispatchAction and you look at the StateBaseAction which was provided in this thread (which retains the clustering and the reflection in LookupDispatchAction) you might want to dump LookupDispatchAction. I have no idea why someone would want to retain LookupDispatchAction at this point in Java history. Jack (see below) snip On Fri, 14 Jan 2005 12:09:37 -0600, Joe Germuska [EMAIL PROTECTED] wrote: I'm not sure what the perceived inefficiencies are. /snip I guess you did not look over the URL I sent. CHECK OUT: http://www.michaelmcgrady.com/button/jsp/button_talk.jsp snip We use a variation of this extensively at my day job, /snip Yes. So do I and I have offered such a variation (without the tortuous lookup logic) in this thread. Did you miss that? snip and I find the dispatch model a very nice way to organize code. /snip Yes. So do I and I used that in the code provided, sans the lookup monster code. snip We prefer to cluster related behavior (although at a level higher than per-page) rather than have an explosion of classes to understand. /snip Yes. So do I. I have no idea who's posts you were reading, but I cannot see how you thought otherwise reading mine. snip So, for us, from a code-grokking perspective, it gains efficiency. Joe /snip I gather than by grok you mean the traditional to drink or (metaphorically) to profoundly appreciate or understand in Martian in Grokking the GIMP by Carey Bunks? I agree when you talk about dispatch actons but disagree completely when you talk about lookup dispatch actions. That is what I said before your post, and I stick to that. I suspect you got in a hurry and assumed that a non-committer was not worth reading carefully. That is reasonable! I suggest you read or reread more thoroughly. You might like the code. I am actually fairly sure you will. -- -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ 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~ --- This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Different validations for one form
Hi, I surrounded the problem this way : I declared in struts-config two forms (that point to the same one) : form-bean name=commercialPlanForm type=com.mypack.CommercialPlanForm/ form-bean name=commercialPlanPrintForm type=com.mypack.CommercialPlanForm/ and I made two action mapping like this : actionpath=/commercialplan type=com.mypack.CommercialPlanAction name=commercialPlanForm scope=request input=/mainmenu.do forward name=displayList path=commercialplanList/ ... /action actionpath=/commercialplanprint type=com.mypack.CommercialPlanAction name=commercialPlanPrintForm scope=request input=/mainmenu.do forward name=displayList path=commercialplanList/ ... /action Then in validation.xml I did a validation for each form. And in the jsp I use one or other action path. Maybe it's not very nice but it works ! Anyway, thanks a lot for your help ! (I'm still curious to know how it could work by using action based validation...) Julie Seyhan Basmaci [EMAIL PROTECTED] wrote: oppss, just try to add language parameter,, -Original Message- From: Seyhan Basmaci Sent: Friday, January 14, 2005 3:13 PM To: Struts Users Mailing List Subject: RE: Different validations for one form add language and cuntry parameters ,, (country may be different from FR ) -Original Message- From: julie gautier [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 3:02 PM To: Struts Users Mailing List Subject: RE: Different validations for one form Done. I always have the same error... Seyhan Basmaci wrote:you have two formset tag, (Note: The FormSet has language, country, and variant attributes that correspond with the java.util.Locale class. If they are not used, the FormSet will be set to the default locale.) Put /commercialplanprint into first tag, like below property=prop1 depends=required property=prop2 depends=required property=prop3 depends=required -Original Message- From: julie gautier [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 2:40 PM To: Struts Users Mailing List Subject: RE: Different validations for one form Thanks again for your help. So, my two jsp are : commercialplanList.jsp and commercialplanPrint.jsp. I have one form : CommercialPlanForm.class I have one action class : CommercialPlanAction.class Here is my struts-config : type=com.mypack.CommercialPlanAction name=commercialPlanForm scope=request input=/mainmenu.do type=com.mypack.CommercialPlanAction name=commercialPlanForm scope=request input=/mainmenu.do In validation.xml, I have : property=prop1 depends=required property=prop2 depends=required property=prop3 depends=required See the fields to be validated in commercialplanList.jsp are prop1 and prop2 and the field to be validated in commercialplanPrint.jsp is prop3. Now, I wrote in my jsps : in commercialplanPrint.jsp : and in commercialplanList.jsp : And CommercialPlanForm.class extends ValidatorActionForm Now when I try to access commercialplanPrint.jsp I still have an error that says : javax.servlet.jsp.JspException: No form found under 'commercialPlanForm' in locale 'fr' at org.apache.struts.taglib.html.JavascriptValidatorTag.renderJavascript(JavascriptValidatorTag.java:364) at org.apache.struts.taglib.html.JavascriptValidatorTag.doStartTag(JavascriptValidatorTag.java:335) at org.apache.jsp.commercialplanPrint_jsp._jspx_meth_html_javascript_0(commercialplanPrint_jsp.java:734) at org.apache.jsp.commercialplanPrint_jsp._jspService(commercialplanPrint_jsp.java:210) What am I doing wrong ? Thanks ! Seyhan Basmaci wrote: in your struts config file , define two map to same action class, for example , pathA and PathB in validation.xml,, define validation for each path,, I hope it works :), formset -Original Message- From: julie gautier [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 2:07 PM To: Struts Users Mailing List Subject: RE: Different validations for one form Ok, but I have the same action class too... So how will it know that for one jsp, it's a validation and for the other jsp it's the other validation to use... My two jsp share the same form and the same action class... Do you have an idea ? Thanks for your help. Seyhan Basmaci wrote: you can use form based validation or action based validation in struts 1.2 , 1) to use form based validation, form classes must extend ValidatorActionForm or DynaValidatorActionForm classes. (org.apache.struts.validator.ValidatorActionForm,org.apache.struts.validator.DynaValidatorActionForm) 2) to use action based validation , form classes must extend ValidatorForm or DynaValidatorForm classes.
announce petstore demo
New petstore demo powered by XMoon http://www.demozone.org/petstore/index.do XMoon site http://www.xmoon.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
LookupDispatchAction Help
Hello... When I use this tags above, the Button works well, but the Link doesn't work. html:form action=/user html:submit property=actionbean:message key=button.new//html:submit html:link page=/user.do?action='button.new'New/html:link /html:form At the first moment, both are putting the button.new into the action variable. When I press the button, works well. But I need that the link do the same function of the button but I receive this error message when I try click on the link: java.lang.NullPointerException java.lang.Class.searchMethods(Class.java:1877) java.lang.Class.getMethod0(Class.java:1901) java.lang.Class.getMethod(Class.java:984) org.apache.struts.actions.DispatchAction.getMethod(DispatchAction.java:332) org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:264) org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.java:234) org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:465) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422) org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:505) javax.servlet.http.HttpServlet.service(HttpServlet.java:743) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) I extend my Action from LookupDispatchAction, and I implement this method... protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(button.new, newUser); return map; } With this mapping, I hope that the method above be executed... public ActionForward newUser(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response){ return mapping.getInputForward(); } but it's not happening... Some body can Help-me? I'm sorry for my bad english... ;) Thanks... Flávio Vilasboas Maldonado Diretor de Desenvolvimento SedNet Soluções em TI (35)3471-9381 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT - Friday] (was: Action Chaining)
snip I gather than by grok you mean the traditional to drink or (metaphorically) to profoundly appreciate or understand in Martian in Grokking the GIMP by Carey Bunks? I agree when you talk about dispatch actons but disagree completely when you talk about lookup dispatch actions. That is what I said before your post, and I stick to that. I suspect you got in a hurry and assumed that a non-committer was not worth reading carefully. That is reasonable! I suggest you read or reread more thoroughly. You might like the code. I am actually fairly sure you will. I am so creating a Dakota Steve GMail account and posting diatribe. flame-preventionI'm just having a little Friday fun. :)/flame-prevention - Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Action Chaining
At 11:36 AM -0800 1/14/05, Dakota Jack wrote: Hi, Joe, I think you sort of punched the pouch here. Let me explain. All your questions were answered in my posts, which you must have not read. Maybe you just read the first post and did not check out the later ones? must have passed each other in the mail; after I had sent my response, I did indeed see your explanations. I suspect you got in a hurry and assumed that a non-committer was not worth reading carefully. That is reasonable! Actually, no, I don't consider that reasonable. That's not my M.O. I will be happy to check out the alternate dispatch handling code. Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com Narrow minds are weapons made for mass destruction -The Ex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Pre-compiling Struts-based JSPs
the beauty and arguably ugliness of ant (Yet Another Duality Of Life) is that there are many ways to do the same thing. i simply use ant's loadfile and replace tasks. loadfile to load the web fragment file. replace to replace the token i created in my web.xml with the entire contents of the web fragment. for example: loadfile srcfile=jspwebfrag property=jsp_mappings/ replace file=web.xml token=REPLACE_WITH_WEB_FRAGMENT_HERE value=${jsp_mappings}/ i just had to make sure my token was in the correct place in my web.xml file hth, woodchuck --- Martin Wegner [EMAIL PROTECTED] wrote: Woodchuck, Thanks for the advice. Glad to hear someone has followed the road before me. I found this useful link as well: http://www.artima.com/forums/flat.jsp?forum=121thread=19915 Question: how do you handle the importing of the fragment into your web.xml? Are you using copy and filterset in Ant? If so, how do you put in your filterset token such that you still have a valid web.xml? Thanks. --Marty --- Woodchuck [EMAIL PROTECTED] wrote: i ran into the same problem as well. what i can tell you is that because jspc generates different import statements than tomcat, this is the reason why the generated web.xml fragment is useful. this fragment basically maps the pre-compiled jsps so that it when the jsp is requested your app will know where to look for the jsp class. i have tried to get jspc to produce the same import statements as tomcat does but i gave up after a while of unsuccessful attempts. in the end, i simply used the web.xml fragment and it works fine. and a positive side effect to this is that you don't need to include the actual jsps at all. you can deploy war files that can be completely free of jsp files, so your war file is smaller and your client never sees any jsp source. woodchuck --- Martin Wegner [EMAIL PROTECTED] wrote: I have been looking into using the jspc ant task to pre-compile our Struts-based application. In comparing the Java code generated by the jspc task and the Java code generated by Tomcat 4.1.x there are some differences, in particular the package names. Also, jspc wants to generate the fraction of web.xml for listing the servlets, which doesn't make sense to me in a Struts application. Is there any advice posted out there about pre-compiling Struts-based applications? Am I completely wrapped around the axle on this? Thanks. --Marty - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail - Find what you need with new enhanced search. http://info.mail.yahoo.com/mail_250 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Pre-compiling Struts-based JSPs
Woodchuck, That works unless you use something like StrutsTestCase which expects to see a value web.xml file in the source code tree (before building the WAR file). I assume that @REPLACE_WITH_WEB_FRAGMENT_HERE@ is in a place that makes your web.xml XML invalid. I used a regular expression filter to do the same thing. Thanks again for all of your help. --Marty --- Woodchuck [EMAIL PROTECTED] wrote: the beauty and arguably ugliness of ant (Yet Another Duality Of Life) is that there are many ways to do the same thing. i simply use ant's loadfile and replace tasks. loadfile to load the web fragment file. replace to replace the token i created in my web.xml with the entire contents of the web fragment. for example: loadfile srcfile=jspwebfrag property=jsp_mappings/ replace file=web.xml token=REPLACE_WITH_WEB_FRAGMENT_HERE value=${jsp_mappings}/ i just had to make sure my token was in the correct place in my web.xml file hth, woodchuck --- Martin Wegner [EMAIL PROTECTED] wrote: Woodchuck, Thanks for the advice. Glad to hear someone has followed the road before me. I found this useful link as well: http://www.artima.com/forums/flat.jsp?forum=121thread=19915 Question: how do you handle the importing of the fragment into your web.xml? Are you using copy and filterset in Ant? If so, how do you put in your filterset token such that you still have a valid web.xml? Thanks. --Marty --- Woodchuck [EMAIL PROTECTED] wrote: i ran into the same problem as well. what i can tell you is that because jspc generates different import statements than tomcat, this is the reason why the generated web.xml fragment is useful. this fragment basically maps the pre-compiled jsps so that it when the jsp is requested your app will know where to look for the jsp class. i have tried to get jspc to produce the same import statements as tomcat does but i gave up after a while of unsuccessful attempts. in the end, i simply used the web.xml fragment and it works fine. and a positive side effect to this is that you don't need to include the actual jsps at all. you can deploy war files that can be completely free of jsp files, so your war file is smaller and your client never sees any jsp source. woodchuck --- Martin Wegner [EMAIL PROTECTED] wrote: I have been looking into using the jspc ant task to pre-compile our Struts-based application. In comparing the Java code generated by the jspc task and the Java code generated by Tomcat 4.1.x there are some differences, in particular the package names. Also, jspc wants to generate the fraction of web.xml for listing the servlets, which doesn't make sense to me in a Struts application. Is there any advice posted out there about pre-compiling Struts-based applications? Am I completely wrapped around the axle on this? Thanks. --Marty - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail - Find what you need with new enhanced search. http://info.mail.yahoo.com/mail_250 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail - 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: LookupDispatchAction Help
From: Flávio Maldonado [EMAIL PROTECTED] html:link page=/user.do?action='button.new'New/html:link /html:form LDA follows the parameter value back to the property name, and uses the property name to pick a method. So instead of 'button.new' here, you need whatever text mapped to in the [usually] ApplicationResources.properties file. Maybe... button.new=Add New User There's supposed to be a way to add a parameter to the link, but I could not puzzle out which attributes of html:link should be used together to make it happen. I'd have to play with it and see what works. http://struts.apache.org/userGuide/struts-html.html#link -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Stuts forwarding does not work
Well just to check I installed Struts on my local machine, copied the same application there and it works fine! Could it be the JBoss that I use on the work server? David G. Friedman wrote: Alex, Check the Javadocs because the perform() method is GONE in Struts v1.2.4, deprecated in v1.1, and normal for the old v1.0. So, what version are you using? Probably v1.2.4 since defining perform() like that will never be called resulting in a standard dummy execute() method being invoked which, TADA, returns a blank page by default! Regards, David P.S. Check your computer's time. It looks like you sent your messages over a day ahead of us. Considering daylight savings time only allows for a 24 hour window, I'm guessing your computer's (whichever one you send email from) time might be off just a little, a tad, a pinch, a smidgeon, etc. -Original Message- From: Alex Kravets [mailto:[EMAIL PROTECTED] Sent: Saturday, January 22, 2005 9:51 AM To: Struts Users Mailing List Subject: Re: Stuts forwarding does not work Actually now it works. I moved everything to another application name and it started working. But, another problem. When I submit my page I get a blank page. Action class does not do anything, just forwards to success page. Here is the action mapping in struts-config.xml: !-- === Global Forward Definitions -- global-forwards forward name=test path=/Test.do/ /global-forwards !-- === Action Mapping Definitions -- action-mappings action path=/Test type=org.apache.struts.actions.ForwardAction parameter=/pages/Test.jsp/ action path=/QuerySubmit type=app.ExecuteQueryAction name=ExecuteQueryForm scope=request validate=true input=/pages/Test.jsp forward name=success path=/pages/QueryResults.jsp/ /action /action-mappings And ActionClass: package app; import java.io.IOException; import java.util.Vector; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.Action; import org.apache.struts.action.ActionError; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionServlet; //import com.kwi.DBDriver; public final class ExecuteQueryAction extends Action { public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // Obtain username and password from web tier String sqlQuery = ((ExecuteQueryForm) form).getSQLQuery(); // Return success return mapping.findForward(success); } } // End LogonAction The same blank screen after submit happens when I deploy and run application logon.war from Husted's Struts In Action source code. So may be my struts installation is wrong? thanks a lot, Alex Amit Gupta wrote: What are you writing in your index.jsp? Amit Gupta Mobile: 91-9891062552 Yahoo IM: amitguptainn MSN IM : amitguptainn -Original Message- From: Alex Kravets [mailto:[EMAIL PROTECTED] Sent: Thursday, January 13, 2005 1:11 AM To: user@struts.apache.org Subject: Stuts forwarding does not work I am trying to redirect from index.jsp to another page but no luck. I get this error: org.apache.jasper.JasperException: Exception forwarding for name queryInput: org.apache.jasper.JasperException at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 54) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at
RE: Stuts forwarding does not work
Alex, What version of Struts did you install on your machine? What is the same application you mention? Is it a struts example application or your application? Did you recompile it on your local machine after installing Struts? Regards, David -Original Message- From: Alex Kravets [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 01, 1980 4:36 PM To: Struts Users Mailing List Subject: Re: Stuts forwarding does not work Well just to check I installed Struts on my local machine, copied the same application there and it works fine! Could it be the JBoss that I use on the work server? David G. Friedman wrote: Alex, Check the Javadocs because the perform() method is GONE in Struts v1.2.4, deprecated in v1.1, and normal for the old v1.0. So, what version are you using? Probably v1.2.4 since defining perform() like that will never be called resulting in a standard dummy execute() method being invoked which, TADA, returns a blank page by default! Regards, David P.S. Check your computer's time. It looks like you sent your messages over a day ahead of us. Considering daylight savings time only allows for a 24 hour window, I'm guessing your computer's (whichever one you send email from) time might be off just a little, a tad, a pinch, a smidgeon, etc. -Original Message- From: Alex Kravets [mailto:[EMAIL PROTECTED] Sent: Saturday, January 22, 2005 9:51 AM To: Struts Users Mailing List Subject: Re: Stuts forwarding does not work Actually now it works. I moved everything to another application name and it started working. But, another problem. When I submit my page I get a blank page. Action class does not do anything, just forwards to success page. Here is the action mapping in struts-config.xml: !-- === Global Forward Definitions -- global-forwards forward name=test path=/Test.do/ /global-forwards !-- === Action Mapping Definitions -- action-mappings action path=/Test type=org.apache.struts.actions.ForwardAction parameter=/pages/Test.jsp/ action path=/QuerySubmit type=app.ExecuteQueryAction name=ExecuteQueryForm scope=request validate=true input=/pages/Test.jsp forward name=success path=/pages/QueryResults.jsp/ /action /action-mappings And ActionClass: package app; import java.io.IOException; import java.util.Vector; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.Action; import org.apache.struts.action.ActionError; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionServlet; //import com.kwi.DBDriver; public final class ExecuteQueryAction extends Action { public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // Obtain username and password from web tier String sqlQuery = ((ExecuteQueryForm) form).getSQLQuery(); // Return success return mapping.findForward(success); } } // End LogonAction The same blank screen after submit happens when I deploy and run application logon.war from Husted's Struts In Action source code. So may be my struts installation is wrong? thanks a lot, Alex Amit Gupta wrote: What are you writing in your index.jsp? Amit Gupta Mobile: 91-9891062552 Yahoo IM: amitguptainn MSN IM : amitguptainn -Original Message- From: Alex Kravets [mailto:[EMAIL PROTECTED] Sent: Thursday, January 13, 2005 1:11 AM To: user@struts.apache.org Subject: Stuts forwarding does not work I am trying to redirect from index.jsp to another page but no luck. I get this error: org.apache.jasper.JasperException: Exception forwarding for name queryInput: org.apache.jasper.JasperException at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java: 2 54) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio n FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC h ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j a va:256) at
RE: Stuts forwarding does not work
Alex, What is going on with your mail client? Now you're back to the 80's, as in January 1980 for your computer's time. -David -Original Message- From: Alex Kravets [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 01, 1980 4:36 PM To: Struts Users Mailing List Subject: Re: Stuts forwarding does not work Well just to check I installed Struts on my local machine, copied the same application there and it works fine! Could it be the JBoss that I use on the work server? David G. Friedman wrote: Alex, Check the Javadocs because the perform() method is GONE in Struts v1.2.4, deprecated in v1.1, and normal for the old v1.0. So, what version are you using? Probably v1.2.4 since defining perform() like that will never be called resulting in a standard dummy execute() method being invoked which, TADA, returns a blank page by default! Regards, David P.S. Check your computer's time. It looks like you sent your messages over a day ahead of us. Considering daylight savings time only allows for a 24 hour window, I'm guessing your computer's (whichever one you send email from) time might be off just a little, a tad, a pinch, a smidgeon, etc. -Original Message- From: Alex Kravets [mailto:[EMAIL PROTECTED] Sent: Saturday, January 22, 2005 9:51 AM To: Struts Users Mailing List Subject: Re: Stuts forwarding does not work Actually now it works. I moved everything to another application name and it started working. But, another problem. When I submit my page I get a blank page. Action class does not do anything, just forwards to success page. Here is the action mapping in struts-config.xml: !-- === Global Forward Definitions -- global-forwards forward name=test path=/Test.do/ /global-forwards !-- === Action Mapping Definitions -- action-mappings action path=/Test type=org.apache.struts.actions.ForwardAction parameter=/pages/Test.jsp/ action path=/QuerySubmit type=app.ExecuteQueryAction name=ExecuteQueryForm scope=request validate=true input=/pages/Test.jsp forward name=success path=/pages/QueryResults.jsp/ /action /action-mappings And ActionClass: package app; import java.io.IOException; import java.util.Vector; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.Action; import org.apache.struts.action.ActionError; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionServlet; //import com.kwi.DBDriver; public final class ExecuteQueryAction extends Action { public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // Obtain username and password from web tier String sqlQuery = ((ExecuteQueryForm) form).getSQLQuery(); // Return success return mapping.findForward(success); } } // End LogonAction The same blank screen after submit happens when I deploy and run application logon.war from Husted's Struts In Action source code. So may be my struts installation is wrong? thanks a lot, Alex Amit Gupta wrote: What are you writing in your index.jsp? Amit Gupta Mobile: 91-9891062552 Yahoo IM: amitguptainn MSN IM : amitguptainn -Original Message- From: Alex Kravets [mailto:[EMAIL PROTECTED] Sent: Thursday, January 13, 2005 1:11 AM To: user@struts.apache.org Subject: Stuts forwarding does not work I am trying to redirect from index.jsp to another page but no luck. I get this error: org.apache.jasper.JasperException: Exception forwarding for name queryInput: org.apache.jasper.JasperException at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java: 2 54) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio n FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC h ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j a va:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invo k eNext(StandardPipeline.java:643) at
Re: Stuts forwarding does not work
I just took example logon application from husted's website and installed on JBoss first. On JBoss it did not work since whenever I submit the form it would return a blank page if there was input submited or exception would be thrown if no data was filled in: 2005-01-13 17:10:41,636 ERROR [org.jboss.web.localhost.Engine] StandardWrapperValve[action]: Servlet.service() for servlet action threw exception org.apache.jasper.JasperException at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1056) at org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:994) at org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:959) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:206) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at
Re: [OT] Re: Using XML in struts
You do need a life. But... I just bought 2 books from your list. I keep a track of cool design ideas here: http://sandrasf.com/kiss - so if anyone wants to append there they can. (I like SQL Tuning, SQL for smartites and Doug Lea's book on concurency.) .V Erik Weber wrote: Joe Germuska wrote: Also, while I see your point that the overall concept of DOM might be more sensible in theory than that of SAX, I found that it's just easier to get going with the SAX API than with DOM or even JDOM. You can get something working with very few lines of code, and good examples are all over the Web. SAX can be a pain to debug though. Certainly not more sensible -- in fact, I've seen over and over again people who aren't comfortable with SAX implement things that involve reading enormous amounts of XML using DOM and then running out of memory. But they decompose the problem into first, get everything in; then do something to everything instead of get one in, handle it, and discard it. I was trying to agree with you. :) But yeah, you're right of course. I read this awesome book called Building Parsers in Java a couple years ago That sounds worth looking up... These days, so many books are about how to use vendor products or APIs. Mastering this or that, Up to Speed with this or that, and the ever popular Professional this or that. I'm not knocking those -- I need those too of course. But I really appreciate getting my hands on those rare books that just focus on the fruits of someone's creativity and inventiveness. You may never need to create your own language or even build your own regular expression parser, but, do you enjoy the art of programming? Do you enjoy math and science? Do you like to learn about different ways to approach the same problem? Do you like to build a better mousetrap? Dragging and dropping beans and jar files is not my idea of a good time. Too bad all any client/tech shop seems to want is the same thing someone else already has done, with a new marketing twist. Once we have CRUD in a bottle for $19.95 and all the legacy stuff is snuffed out, what will programmers do for a living? Ah, I'm just complaining as usual. Anyway, of the dozens of Java books I have discovered and/or bought in the last few years, a few stand out in the way I described: * Building Parsers With Java, by Steven John Metsker, Addison Wesley (0-201-71962-2) -- creative, well organized, well written, well edited, just a nice piece of work that definitely wasn't cranked out. A fun book about creating and interpreting your own languages. * Digital Audio with Java, by Craig A. Lindley, Prentice Hall (0-13-087676-3) -- ever wanted to know how to build a parametric EQ in Java, from the knobs and LEDs all the way to the wave shaping? * Java Design, by Peter Coad (TogetherSoft) and Mark Mayfield, Prentice Hall (0-13-981-6) -- offers a perspective on design that you probably won't find anywhere else (with chaper titles such as Design with Threads and Design with Notification, and hand-drawn diagrams); forget that IDE and get out your pad and pencil. Perhaps funny that I should say this, being a lover of lowest-level programming, but I have found that the books that have helped me the most as a programmer (in the long run) are ones about design patterns, idioms and algorithms (all high-level things in some fashion), rather than those about the latest API or product. Unfortunately I cannot back up that statement with $$$ earned -- at least not yet. The GoF book was published how long ago? How many tech books of today are of equal value? I guess it depends on your perspective. Speaking of perspective, ever read The Timeless Way of Building? How about (wyy OT) The Fourth Dimension? Man, I need a life. :) Cheers, Erik But I appreciate your elaborating on commons digester. That's the one I was thinking of. I'll have to check that out. Also, I've never even looked at Spring. By the way, do you happen to know what type of parser either of those uses? Just curious. Digester is a wrapper around SAX. Digester itself extends org.xml.sax.helpers.DefaultHandler And while the most common way people use Digester is to create a tree of objects, once you get inside it, you realize that you can do a lot more. You can write Digester rules that do the aforementioned get one, handle it and discard it as well as the more common rules which do get one and add it to the tree. Joe -- RiA-SoA w/JDNC http://www.SandraSF.com forums - help develop a community My blog http://www.sandrasf.com/adminBlog - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts chainging problem ?
I do know what exactly could be the problem I am having one JSP which calls Main Action Handler - this does some database job and get userid. This id i want to pass it to another page. If it is a direct JSP page then i can make use of something like request.setAttributeand can get the value. But if it is calling another struts Action Handler then seems value is not passed. I aways get in another Action Handler as null. Currently i put it in the session scope - but which i do not want. Is there any good solution to this ? regards Manisha - Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard.
Re: Opinions needed - My plan for directing navigation afters session timeouts and update actions?
You're going to have a tough time knowing whether a person isn't authenticated because they 1) haven't logged in yet or 2) their session timed out. I'd recommend use of a (session) cookie to help detect that. It's the only way I can think of. Basically, the scenario is: - User logs in - System validates credentials - If user is validated, create a cookie that tracks them - User does stuf and sits there idle like a bump on a log - Session times out - User requests resource - System notices they don't have a session, but that the cookie is there - Sytem knows the user was logged in and timed out No amount of keeping things up-to-date in the session is going to help you in the case of a timeout. You grab the current action and stick it in a cookie though. I can't think of another way to get the functionality you're looking for. Good Luck! Eddie HTH - Didn't see it in your write-up. Maybe I didn't read between the lines thoroughly enough. On Tue, 11 Jan 2005 11:15:34 -0500, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I have two situations I am trying to address with one generic solution: 1) For every update action, I had to maintain two separate result confirmation JSPs, one stating Update Successful and one Updated failed due to system error. Try again later. (must be a system error, as any data validation errors would have been returned to original data entry JSP.) Each of these also has a button with a unique link to take it to the appropriate action to build what should be the next view for that user (I want to be able to bounce them back to a page that was most recent or appropriate for where they were in the application.) 2) On session timeout, I want to bounce the user to a login page, then bring them back to the page/action they were attempting to go to, or the most appropriate location, based on the application knowing only the user id of the user and no other context. If you could review my plan below and let me know if it is sound from a Struts perspective OR whether there are Struts best practices to accomplish the same thing in a more elegant way, that would be great. I am pretty sure there is a bug in how I propose using the various session attibutes below, but please don't worry with that - I'll sort it out when I implement. I am really seeking an opinion on the overall approach. Thanks! MY PLAN: Keep three attributes in the session object up to date at all times: a) previousAction - the most recent action completed by the user b) currentAction - the next action the user was attempting when the error or session timeout occurred c) nextAction - the next action that should be invoked after a successful action (ONLY after successful actions) c) previousActionResult - the message to be displayed on actionResult.jsp (after ALL update actions, whether successful, failed, or timed-out) Psuedo-code for a session timeout scenario: User is on ChangePasswordDef and presses button to process change with ChangePasswordAction AuthenticationFilter (this is a filter that precedes ALL actions. It checks authority of the user to execute the action, logs that the user executed the action, and looks for session timeout) set previousAction = currentAction (no longer prev action. In fact, null in this scenario.) set currentAction = ChangePassword If new session (session timed out before this action) set previousActionResult = ...inactive too long... forward to actionResult.jsp actionResult.jsp display previousActionResult render OK button to go to GoToLoginAction GoToLoginAction forward to LoginDef (Tiles) LoginDef invoke LoginAction LoginAction process login successfully If currentAction != null forward to actionResultAction actionResultAction If currentAction = ChangePassword forward to ChangePasswordAction AuthenticationFilter pass authorization check and do not detect session timeout if current action != previousAction set previousAction = BuildHomeViewAction currentAction = ChangePassword ChangePasswordAction (finally where the user wanted to be!) -- NOTICE: The information contained in this electronic mail transmission is intended by Convergys Corporation for the use of the named individual or entity to which it is directed and may contain information that is privileged or otherwise confidential. If you have received this electronic mail transmission in error, please delete it from your system without copying or forwarding it, and notify the sender of the error by reply email or by telephone (collect), so that the sender's address records can be corrected. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Stuts forwarding does not work
Please limit your stack traces! Each line into the trace becomes less and less meaningful ... unless you're trying to debug the application server/servlet container. I don't think that's your goal ... -- Eddie Bush - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts FormFile and html:file
I can't think of any usecase where it would fail for not setting the FormFile property to null in the reset. On the otherhand it wouldn't hurt if you set the FormFile to null in the reset(), heeding to the warning that the docs give On Mon, 10 Jan 2005 17:43:43 -0800, Sullivan, Sean C - MWT [EMAIL PROTECTED] wrote: I read the documentation for the html:file tag http://struts.apache.org/userGuide/struts-html.html#file According to the Struts documentation: WARNING: In order to correctly recognize uploaded files, the ActionForm bean associated with this form must include a statement setting the corresponding org.apache.struts.upload.FormFile property to null in the reset() method. I examined the Struts Upload example application and I noticed that UploadForm.java has a reset method. However, UploadForm's reset method _does not_ set the FormFile property to null: http://cvs.apache.org/viewcvs.cgi/jakarta-struts/src/examples/org/apache /struts/webapp/upload/UploadForm.java?rev=HEADview=markup I have an upload form in my application and I want to know if I need to implement set the FormFile variable equal to null in my form's reset method. Thanks in advance. -Sean - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
problem with List-Backed Form
Hi, ok I am trying to get my Dynamic List-Backed form to work, no luck, here is what I have so far. ActionForm with a List in it: public ArrayList getFields() { return fields; } public void setFields(ArrayList fields) { this.fields = fields; } Now, a field itslelf is a bean: public class FormField { private String label; private String name; private String value; private String type; private java.util.ArrayList props; private boolean required; ... getter and setters here } There is an Action that gets the info from the database and populates into the ActionForm, no problem. Now Jsp page has something like this: c:forEach items=${formActionForm.fields} var=field tr tdhtml:text property=label name=field//td td html:select property=type name=field html:optionsCollection name=definitionFields/ /html:select /td / and so on for all the properties /tr /c:forEach So my question is, how do I make it so when this values are changed and submitted they are changed in the ActionForm ?? IS there a way to have that happen automatically like with a normal actionform or I have to do it programatically? I am really stuck here!!! Oleg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RE: [almost OT] Struts in Practice
-Original Message- BTW, what's HTH? Hope This Helps. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]