Re: Orkut
I would like to join. Vic Cekvenich wrote: If you want to join Struts in Orkut Social Network send me an e-mail saying so. .V (if you do not know what it is don't worry) - 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]
duplicate form object
im new, i have 2 subscriptionForm objects instead of a single OID. The trace below involves these activities: 1. subscription.jsp is submitted and handled by subscriptionForm whose configuration includes: name=subscriptionForm scope=session 2. a forward occurs on name success and the config codes for the action actionpath=/saveSubscription to forward to path=/Welcome.do/ 3. the forward action for path=/Welcome has attribute name=subscriptionForm and attribute parameter=/Welcome.jsp The Problem - There should only be 1 subscription object but there are 2 different ones : - one at step 1 - another one at step 3 Why the duplication? In step 3, in Welcome.jsp, when i say: pHavObj: %=subscription.toString()% why don't i reference the same Form object created in the subscription.jsp at step 1? - Gorey Details 1. webapps\struts-blank\subscription.jsp %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % ... jsp:useBean id=subscription scope=session class=com.borneo.beans.SubscriptionForm / 2. struts-config.xml actionpath=/saveSubscription type=com.borneo.beans.SaveSubscriptionAction name=subscriptionForm scope=session validate=true input=subscription forward name=successpath=/Welcome.do/ forward name=subscriptionpath=/subscription.jsp/ !-- forward name=success path=/Welcome/ -- /action action path=/Welcome name=subscriptionForm type=org.apache.struts.actions.ForwardAction parameter=/Welcome.jsp / 3. Welcome.jsp %@ taglib uri=/tags/struts-bean prefix=bean % %@ taglib uri=/tags/struts-html prefix=html % %@ taglib uri=/tags/struts-logic prefix=logic % html:html locale=true head titlebean:message key=welcome.title//title html:base/ /head body bgcolor=white !--jsp:useBean id=subscription scope=session class=com.borneo.beans.SubscriptionForm /-- logic:notPresent name=org.apache.struts.action.MESSAGE scope=application font color=red ERROR: Application resources not loaded -- check servlet container logs for error messages. /font /logic:notPresent h3bean:message key=welcome.heading//h3 pbean:message key=welcome.message//p a href='jsp:getProperty name=subscription property=jnlpaddr/ 'Launch JWS App./a pHavObj: %=subscription.toString()% /p /body -- StdOut from prints that prove 2 different objects on the server OID : [EMAIL PROTECTED] URL to Bean prop jnlpaddr : file:/G:/jakarta-tomcat-5.0.16/work/Catalina/localhost/struts-blank/A022B619 DD01CCEpoll.jnlp on IE Launch JWS App. HavObj: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: duplicate form object
I made the suggested changes and still get the same result = there are 2 subscriptionForm beans instead of a single one. The properties set in saveSubscription action are no longer avaiable when the forward to Welcome.jsp occurs. config file now contains form-bean name=subscriptionForm type=com.borneo.beans.SubscriptionForm /form-bean actionpath=/saveSubscription type=com.borneo.beans.SaveSubscriptionAction name=subscriptionForm scope=session validate=true input=/subscription.jsp forward name=successpath=/Welcome.do/ forward name=subscriptionpath=/subscription.jsp/ !-- forward name=success path=/Welcome/ -- /action action path=/Welcome name=subscriptionForm type=org.apache.struts.actions.ForwardAction parameter=/Welcome.jsp / i made the changes as per the reply... JSP's now contain subscription.jsp %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % --- I commented the usebean that was pointed out in prev. thread !-- jsp:useBean id=subscription scope=session class=com.borneo.beans.SubscriptionForm /-- Welcome.jsp %@ taglib uri=/tags/struts-bean prefix=bean % %@ taglib uri=/tags/struts-html prefix=html % %@ taglib uri=/tags/struts-logic prefix=logic % html:html locale=true head titlebean:message key=welcome.title//title html:base/ h3bean:message key=welcome.heading//h3 pbean:message key=welcome.message//p a href='bean:write name=subscriptionForm property=jnlpaddr/ 'Launch JWS App./a - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: NoClassDefFoundError in custom validator
Ok I figured out a way to make it all work ... The solution ended up being to put all the commons jar files in the root of the ear, and add them to application.xml as java modules. Looks like it was indeed a classloader issue then ... which would lead me to think that this is a bug. No reason why Struts shouldn't be able to do all of the reflection, especially since this is hardly pushing the envelope. Any thoughts? cheers Rob -Original Message- From: Rob van Oostrum [mailto:[EMAIL PROTECTED] Sent: November 14, 2003 6:11 PM To: [EMAIL PROTECTED] Subject: NoClassDefFoundError in custom validator I added the commons validator to my Struts implementation. The out-of-the-box stuff is working just fine. However, I added the following custom validator: public class BarnmanValidator implements Serializable { public static boolean validateEmailAddress(Object bean, Field field) { [etc, etc, etc] When this one is about to be invoked, I get this exception (as root cause of a servlet exception): java.lang.NoClassDefFoundError: org/apache/commons/validator/Field at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:1647) at java.lang.Class.getMethod0(Class.java:1893) at java.lang.Class.getMethod(Class.java:976) at org.apache.commons.validator.Validator.validateFieldForRule(Valida tor.java:4 01) the validator def: validator name=email.unique classname=com.springwell.barnman.validator.BarnmanValidator method=validateEmailAddress methodParams=java.lang.Object,org.apache.commons.validator.Field msg=errors.email.duplicate / the form def: form name=register field property=emailAddress depends=required,email,email.unique / field property=password1 depends=required / field property=password2 depends=required / field property=firstName depends=required / field property=lastName depends=required / /form If I omit my custom validator everything works fine. the commons-validator.jar is in my war file's WEB-INF/lib, and there seems to be no problem locating org.apache.commons.validator.Validator (as you can tell from the stacktrace). Only thing I can think of is that it's a different classloader trying to load the Field class through reflection? Any known solutions to known problems? thanks in advance, Rob - 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]
NoClassDefFoundError in custom validator
I added the commons validator to my Struts implementation. The out-of-the-box stuff is working just fine. However, I added the following custom validator: public class BarnmanValidator implements Serializable { public static boolean validateEmailAddress(Object bean, Field field) { [etc, etc, etc] When this one is about to be invoked, I get this exception (as root cause of a servlet exception): java.lang.NoClassDefFoundError: org/apache/commons/validator/Field at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:1647) at java.lang.Class.getMethod0(Class.java:1893) at java.lang.Class.getMethod(Class.java:976) at org.apache.commons.validator.Validator.validateFieldForRule(Validator.java:4 01) the validator def: validator name=email.unique classname=com.springwell.barnman.validator.BarnmanValidator method=validateEmailAddress methodParams=java.lang.Object,org.apache.commons.validator.Field msg=errors.email.duplicate / the form def: form name=register field property=emailAddress depends=required,email,email.unique / field property=password1 depends=required / field property=password2 depends=required / field property=firstName depends=required / field property=lastName depends=required / /form If I omit my custom validator everything works fine. the commons-validator.jar is in my war file's WEB-INF/lib, and there seems to be no problem locating org.apache.commons.validator.Validator (as you can tell from the stacktrace). Only thing I can think of is that it's a different classloader trying to load the Field class through reflection? Any known solutions to known problems? thanks in advance, Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: NoClassDefFoundError in custom validator
oops ... I'm running the Struts 1.1 binary release on jboss-3.2.1_tomcat-4.1.24 and the war file resides in an ear file. I've tried sticking jars in the ear's root and referencing them from the war file's manifest, but this gave exactly the same results. cheers Rob -Original Message- From: Rob van Oostrum [mailto:[EMAIL PROTECTED] Sent: November 14, 2003 6:11 PM To: [EMAIL PROTECTED] Subject: NoClassDefFoundError in custom validator - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validator required not working with String[] multi-select
Please do file a bug report. Thanks, Rob Bailey, Shane C. wrote: It sure appears that way from my code analysis. I JUST made it work though with a simple update of the commons source code. I guess I could look into submitting my update if they / anyone is interested in incorporating it in the commons code. I changed the org.apache.commons.validator.ValidatorUtil.getValueAsString() method from: public static String getValueAsString(Object bean, String property) { Object value = null; try { value = PropertyUtils.getProperty(bean, property); } catch (Exception e) { log.error(e.getMessage(), e); } return (value != null ? value.toString() : null); } to: public static String getValueAsString(Object bean, String property) { Object value = null; try { value = PropertyUtils.getProperty(bean, property); } catch (Exception e) { log.error(e.getMessage(), e); } //Special case, check if String[] try { String[] valueArray = (String[])value; if(valueArray==null || valueArray.length==0) { value = null; } } catch(ClassCastException cce) { //Then it wasn't a String[] } return (value != null ? value.toString() : null); } I guess, just to be safe the second catch could catch Exception. Anyway, it fixed my validation problem for String[] and doesn't appear to have broken and validations which worked before. -Original Message- From: Kris Schneider [mailto:[EMAIL PROTECTED] Sent: Monday, August 04, 2003 3:52 PM To: Struts Users Mailing List Subject: Re: Validator required not working with String[] multi-select AFAIK, the standard required validator doesn't work with arrays. Or, if it does, I wasted time writing a custom validator ;-). I'd be intersted to hear if anyone really has used the required validator successfully for an array field. I suppose I should check to see if there's a bug/RFE for an array validator and submit it... Quoting Bailey, Shane C. [EMAIL PROTECTED]: I sort of already sent this message to the list but I made a mistake (didn't proof read my message) so here it is again but corrected ... Validator required validation is NOT working for my String[] (in a dynaform. I have seen others on the list say it works for them. Anyone else experiencing the same problem? Possibly it is because I am using a multi-select? Basically, if nothing is selected then instead of null be sent back for that parameter I am getting a zero length String[]and it's toString() value is [Ljava.lang.String;@3cfaab which is important because of the way the validateRequired() method works... I looked at the source code (of my commons-validator.jar using jad). Maybe I am using an older version of the commons-validator jar and this was fixed or I am doing something else wrong? If so, where is the latest commons-validator.jar? Here is how my field is declared on the JSP: html:select property=roles multiple=true size=7 html:options collection=%=my.Const.ROLE_TYPES% property=roleName/ /html:select Here is how it is declared in the struts config: form-property name=roles type=java.lang.String[]/ Struts source Code: public static boolean validateRequired(Object bean, ValidatorAction va, Field field, ActionErrors errors, HttpServletRequest request) { String value = null; if (isString(bean)) { value = (String) bean; } else { value = ValidatorUtil.getValueAsString(bean, field.getProperty()); } if (GenericValidator.isBlankOrNull(value)) { errors.add(field.getKey(), Resources.getActionError(request, va, field)); return false; } else { return true; } } Problem: ValidatorUtil.getValueAsString(bean, field.getProperty()) does a toString() on the value and a toString() on a String[] which isn't null it is some String like [Ljava.lang.String;@3cfaab and so then isBlankOrNull() is checking for null OR value.trim().length==0 and so neither is true and so validation passes. -- - Rob Leland (703-525-3580) Choose a job you love, and you will never have to work a day of your life. -Confucius.
Re: NoSuchMethodException
Yansheng Lin wrote: Yes, it would be StrutsValidatorUtil now. It's part of struts util package. org.apache.struts.util? Weird, works fine for me just now. I am using struts-1.1-RC1. StrutsValidatorUtil was deprecated in struts 1.1, and removed in Struts 1.2. It would be better to use o.a.s.validator.Resources instead for all new code. -Rob -Original Message- From: Kamholz, Keith (corp-staff) USX [mailto:[EMAIL PROTECTED] Sent: August 1, 2003 1:35 PM To: 'Struts Users Mailing List' Subject: RE: NoSuchMethodException I just looked at the API, and the ValidatorUtil class doesn't have a getActionError method. Do you mean the StrutsValidatorUtil class? I tried that but it didn't like the import. :-( -Original Message- From: Yansheng Lin [mailto:[EMAIL PROTECTED] Sent: Friday, August 01, 2003 3:24 PM To: 'Struts Users Mailing List' Subject: RE: NoSuchMethodException I can see there are several issues here. First I think you might want to supply the ServletContext as well. Second, you want to add the error to Errors collection by adding: errors.add(field.getKey(), ValidatorUtil.getActionError(servletContext, request, va, field)); before the return statement. Try it. I spent a lot of time before on this too. -Original Message- From: Kamholz, Keith (corp-staff) USX [mailto:[EMAIL PROTECTED] Sent: August 1, 2003 10:40 AM To: Struts (E-mail) Subject: NoSuchMethodException Hey everyone, I'm working on a custom validator right now, and all the validation method does is return false. That means it fails that validation, right? Anyway, when I submit the form, I get a NoSuchMethod error. What would cause this? All of my regular validations work, just not this custom one. Here are some code snippets. Thanks in advance for any help! public class CustomValidator implements Serializable { public static boolean validateRange(Object bean, ValidatorAction va, Field field, ActionErrors errors, HttpServletRequest request) { return false; } } validator-rules.xml: !-- Custom Validators -- validator name=validRange classname=com.moog.us.app.ans.validation.CustomValidator method=validateRange methodParams=java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionErrors, javax.servlet.http.HttpServletRequest, javax.servlet.ServletContext msg=errors.invalid.range /validator And parts of my validation.xml: global /global form name=/AddAssignment field property=startRange depends=required arg0 key=app.label.startRange/ /field field property=endRange depends=validRange /field /form - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- - Rob Leland (703-525-3580) Choose a job you love, and you will never have to work a day of your life. -Confucius. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: extending Struts taglibs to indicate form field states
Mike Jasnowski wrote: We use a mechanism that basically wraps a set of Struts Form/Form Fields in a tag that applies a set of XSLT templates to the body of the tag. This enables use to add features like you describe w/o touching the Struts tags themselves. We use it for custom error placement, highlighting form fields for required, or error conditions, etc.. We also use this mechanism to share layout information for many of the forms, nice way to centralize this type of information. Cool ! -- - Rob Leland (703-525-3580) Choose a job you love, and you will never have to work a day of your life. -Confucius. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: Show validation errors in a dialog
If you are talking about presenting the server side validation errors on the client I believe you could do it on the 'onload' event handler in the BODY tag. If you want the client side validation performed by Javascript to display errors then look at the struts-validator example. Dirk Behrendt wrote: I want to be a bit more concret: With JavaScript you can create a window, after klicking a button. JavaScript Code: form pinput type= button value= Hello Button ... onClick= alert('Hello'); /p /form I want, that such a window appears, when errors occur. So I have to put code in the logic:messagesPresent tag. logic:messagesPresent bean:message key=errors.header/ ul html:messages id=error libean:write name=error//li /html:messages some JavaScript for a window alert('Don\'t forget to press the back button to return!') /ulhr /logic:messagesPresent Dirk -Ursprngliche Nachricht- *Von:* Dirk Behrendt [mailto:[EMAIL PROTECTED] *Gesendet:* Donnerstag, 31. Juli 2003 19:21 *An:* '[EMAIL PROTECTED]' *Betreff:* Show validation errors in an dialog Hello! What is necessary to show errors from validation not in a JSP , but in a dialog? Dirk -- - Rob Leland (703-525-3580) Choose a job you love, and you will never have to work a day of your life. -Confucius. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Transaction Token
Joshua White wrote: I have heard the session token mentioned a few times. Does anyone have any examples on when/how to use it? Regards, Joshua Look in the struts 'example' program. I am sure it uses it. -- - Rob Leland (703-525-3580) Choose a job you love, and you will never have to work a day of your life. -Confucius. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can Validator javascript show more than one error at a time?
Look for this to be fixed in the nightly dated July 29. Brian Alexander Lee wrote: There's currently a defect (http://issues.apache.org/bugzilla/show_bug.cgi?id=20754) in bugzilla that would use (bitwise operator) instead of so it would process all validations. You can apply the patch yourself. It's only two files ValidatorPlugIn.java and JavascriptValidatorTag.java. BAL - Original Message - From: Steve Raeburn [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Saturday, July 26, 2003 2:33 PM Subject: RE: Can Validator javascript show more than one error at a time? The generated Javascript groups tests by type (required, mask, min length etc) and calls them as follows: function validateRegistrationForm(form) { if (bCancel) return true; else return validateRequired(form) validateMask(form) validateMinLength(form) validateMaxLength(form) validateEmail(form); } Due to the way the expression is evaluated, if any test returns true the subsequent tests are not executed. If you had several missing required fields then those errors would be grouped together. But if you had only one missing required field and another type of error, you would not see the second error message until you correct the missing field error. See the struts-validator sample application (shipped with Struts) for examples. Steve -Original Message- From: news [mailto:[EMAIL PROTECTED] Behalf Of Brian Chaplin Sent: July 26, 2003 10:35 AM To: [EMAIL PROTECTED] Subject: Can Validator javascript show more than one error at a time? Somehow Ted Husted was able to get the javascript to show more than one error at a time in the javascript alert message. See screen shot on page 373 of Struts in Action. I'm using Struts 1.1 final and it seems the javascript won't support that? -- Rob Leland
Re: Using an extension of ModuleConfigImpl
Rob Leland wrote: Rob Leland wrote: Karachiwala, Aslam wrote: I do use extensions of ActionConfig ForwardConfig. What I've done is implement a layer of extensions of Struts classes, in which I've added custom fields and methods that I need. I'd like to do the same for ModuleConfig. Is that even possible without tinkering with the Struts code? I am assuming you want to use the same extension of the ModuleConfig for all modules ? If so then I'll see about adding a servlet parameter to set the factory used. The latest nightly build has a new ActionServlet Parameter named 'configFactory'. Set it to the factory that creates your implementation of the ModuleConfig interface in the web.xml -Rob No, but I am really glad you brought it up ! When I renamed all the application config stuff to ModuleConfig and made it an interface last November it was in response to the stated desire to provide hierarchical modules, or module inheritance. At first I hard coded the implementation, then later on a factory was provided. Since there was no immediate need the functionality you need was never implemented. As Mike says it should be configurable from the struts-config.xml file. I'll may get time to look at in the next week or so.If in the meantime you would like to suggest a patch that would greatly appreciated, but not required. -Rob --aslam -Original Message- From: Mike Jasnowski [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 23, 2003 10:41 AM To: Struts Users Mailing List Subject: RE: Using an extension of ModuleConfigImpl You can write minor extensions to some config elements like action and forward. This extension class is named via the className attribute of those elements. -Original Message- From: Karachiwala, Aslam Sent: Wednesday, July 23, 2003 10:39 AM To: Struts-users (E-mail) Subject: Using an extension of ModuleConfigImpl Hi, all. In Struts 1.1, is there a way to use one's own implementation/extension of ModuleConfig and/or ModuleConfigFactory? I couldn't find any info on how this could be done in any of the config *.xml files. If this is not configurable then an option that was suggested to me was to invoke ModuleConfigFactory.setFactoryClass() and set that to my own factory class which will create my extension of ModuleConfigImpl. If I wanted to do this then where/when should I set the factory class? --aslam -- Rob Leland -- Rob Leland -- Rob Leland
Re: Using an extension of ModuleConfigImpl
Rob Leland wrote: Karachiwala, Aslam wrote: I do use extensions of ActionConfig ForwardConfig. What I've done is implement a layer of extensions of Struts classes, in which I've added custom fields and methods that I need. I'd like to do the same for ModuleConfig. Is that even possible without tinkering with the Struts code? I am assuming you want to use the same extension of the ModuleConfig for all modules ? If so then I'll see about adding a servlet parameter to set the factory used. No, but I am really glad you brought it up ! When I renamed all the application config stuff to ModuleConfig and made it an interface last November it was in response to the stated desire to provide hierarchical modules, or module inheritance. At first I hard coded the implementation, then later on a factory was provided. Since there was no immediate need the functionality you need was never implemented. As Mike says it should be configurable from the struts-config.xml file. I'll may get time to look at in the next week or so.If in the meantime you would like to suggest a patch that would greatly appreciated, but not required. -Rob --aslam -Original Message- From: Mike Jasnowski [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 23, 2003 10:41 AM To: Struts Users Mailing List Subject: RE: Using an extension of ModuleConfigImpl You can write minor extensions to some config elements like action and forward. This extension class is named via the className attribute of those elements. -Original Message- From: Karachiwala, Aslam Sent: Wednesday, July 23, 2003 10:39 AM To: Struts-users (E-mail) Subject: Using an extension of ModuleConfigImpl Hi, all. In Struts 1.1, is there a way to use one's own implementation/extension of ModuleConfig and/or ModuleConfigFactory? I couldn't find any info on how this could be done in any of the config *.xml files. If this is not configurable then an option that was suggested to me was to invoke ModuleConfigFactory.setFactoryClass() and set that to my own factory class which will create my extension of ModuleConfigImpl. If I wanted to do this then where/when should I set the factory class? --aslam -- Rob Leland -- Rob Leland
Re: Testing Struts-Config
Edgar Dollin wrote: Does anyone know of a tool that just tests the struts-config for 'class correctness'? The situation I find myself in is I have a large project, which was heavily refactored (unfortunately w/o adequate struts tests), and I need to debug the struts-config. This may help you, though I haven't used it: http://sourceforge.net/projects/strutstestcase/ Thanks in advance. Edgar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Rob Leland - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validator validwhen
Lukas Bradley wrote: A quote from http://jakarta.apache.org/struts/userGuide/dev_validator.html The new validwhen validation rule, which will be included into the Struts release immediately after the 1.1 release, is designed to handle these cases. Does this mean validwhen is or is not supported in 1.1? I can interpret that statement either way. Nightly build only. Just because it is in the CVS HEAD doesn't mean it will be in the 1.2 release. -Rob Lukas -- Rob Leland - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using an extension of ModuleConfigImpl
Karachiwala, Aslam wrote: I do use extensions of ActionConfig ForwardConfig. What I've done is implement a layer of extensions of Struts classes, in which I've added custom fields and methods that I need. I'd like to do the same for ModuleConfig. Is that even possible without tinkering with the Struts code? No, but I am really glad you brought it up ! When I renamed all the application config stuff to ModuleConfig and made it an interface last November it was in response to the stated desire to provide hierarchical modules, or module inheritance. At first I hard coded the implementation, then later on a factory was provided. Since there was no immediate need the functionality you need was never implemented. As Mike says it should be configurable from the struts-config.xml file. I'll may get time to look at in the next week or so.If in the meantime you would like to suggest a patch that would greatly appreciated, but not required. -Rob --aslam -Original Message- From: Mike Jasnowski [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 23, 2003 10:41 AM To: Struts Users Mailing List Subject: RE: Using an extension of ModuleConfigImpl You can write minor extensions to some config elements like action and forward. This extension class is named via the className attribute of those elements. -Original Message- From: Karachiwala, Aslam [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 23, 2003 10:39 AM To: Struts-users (E-mail) Subject: Using an extension of ModuleConfigImpl Hi, all. In Struts 1.1, is there a way to use one's own implementation/extension of ModuleConfig and/or ModuleConfigFactory? I couldn't find any info on how this could be done in any of the config *.xml files. If this is not configurable then an option that was suggested to me was to invoke ModuleConfigFactory.setFactoryClass() and set that to my own factory class which will create my extension of ModuleConfigImpl. If I wanted to do this then where/when should I set the factory class? --aslam -- Rob Leland
Re: difference between Thread.currentThread().getContextClassLoader()and this.getClass().getClassLoader()
) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069) at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274) at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455) at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:320) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.iplanet.server.http.servlet.NSServletRunner.invokeServletService(NSServletRunner.java:919) at com.iplanet.server.http.servlet.WebApplication.service(WebApplication.java:1061) at com.iplanet.server.http.servlet.NSServletRunner.ServiceWebApp(NSServletRunner.java:981) , root cause: javax.servlet.jsp.JspException at org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:297) at _jsps._pages._Welcome_jsp._jspService(_Welcome_jsp.java:89) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:248) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.access$6(JspServlet.java:238) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:519) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:588) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.iplanet.server.http.servlet.NSServletRunner.invokeServletService(NSServletRunner.java:919) at com.iplanet.server.http.servlet.WebApplication.service(WebApplication.java:1061) at com.iplanet.server.http.servlet.NSServletRunner.ServiceWebApp(NSServletRunner.java:981) at com.iplanet.server.http.servlet.NSServletSession.internalRedirect(Native Method) at com.iplanet.server.http.servlet.NSRequestDispatcher.forward(NSRequestDispatcher.java:48) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069) at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274) at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455) at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:320) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279) at org.apache.struts.action.ActionServlet.process(ActionServlet.java This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only. If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately. You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited. Visit Us at http://www.polaris.co.in - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Rob Leland
Re: difficult problem, preventing population
Hi, I am fully aware of Struts transaction token implementation. My question was whether or not the token could be examined for validity prior to the population of the form bean. Instead of telling me to read the documentation, why don't you try and read my post first to see what I am really asking. Thanks Nagendra Kumar O V S wrote: hi, struts does support for transaction tokens , pl check the struts docs for the api implementation -- nagi /---Original Message---/ /*From:*/ Struts Users Mailing List mailto:[EMAIL PROTECTED] /*Date:*/ Wednesday, July 16, 2003 07:24:58 AM /*To:*/ [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] /*Subject:*/ difficult problem, preventing population I have the following scenario occuring. I have a form with several fields on it (the fields are sourced to a collection in an ActionForm). I have a button that allows the removal of fields from the form (items from the collection). If a user removes a field from the form and then double submits/clicks back and reloads then an exception is thrown from BeanUtils.populate() because it attempts to take details from the (now removed field) and populate it into the object that is stored in the position it was located in the collection. Obviously since the collection is now smaller this results in an IndexOutOfBoundsException. Is there any way to examine the transaction token from the form prior to the form bean being populated and then avoid population of the form bean if the token is not valid? Help with this problem would be greatly appreciated. Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] . http://www.incredimail.com/redir.asp?ad_id=309lang=9 /IncrediMail/ - *Email has finally evolved* - *_Click Here_* http://www.incredimail.com/redir.asp?ad_id=309lang=9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
dificult problem, preventing population (repost)
I have the following scenario occuring. I have a form with several fields on it (the fields are sourced to a collection in an ActionForm). I have a button that allows the removal of fields from the form (items from the collection). If a user removes a field from the form and then double submits/clicks back and reloads then an exception is thrown from BeanUtils.populate() because it attempts to take details from the (now removed field) and populate it into the object that is stored in the position it was located in the collection. Obviously since the collection is now smaller this results in an IndexOutOfBoundsException. Is there any way to examine the transaction token from the form prior to the form bean being populated and then avoid population of the form bean if the token is not valid? Help with this problem would be greatly appreciated. Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: URL validation with struts???
Prashanth.S wrote: Hi all, I need to upload a resource present at a particular location by making user enter a valid URL...How can i do URL name validation using struts???Is there anything to do so??Do i need to do this in action form or action class??[what User entered is a valid url i.e,both name as well as resource present at that url) The current commons-validator has a java class for validating a URL that I added, it is pretty extensive. I still need to write the equalivent Javascript. Look at the unit tests for how to use the class. Alternatively you can go to javascript.com to find a standalone version for javascript. Usually when we create the Javascript version it mirrors the java version so the two give the same results. The JavaDoc on the web site is really old so look at the source: http://cvs.apache.org/viewcvs/jakarta-commons/validator/src/share/org/apache/commons/validator/UrlValidator.java The Unit tests: http://cvs.apache.org/viewcvs/jakarta-commons/validator/src/test/org/apache/commons/validator/UrlTest.java Download the nightly which has all the below plus updated javadocs http://cvs.apache.org/builds/jakarta-commons/nightly/commons-validator/ Since method signatures have changed in commons-validator, the easiest way to get this though is to download a *nightly* version of struts:(**recommended**) http://cvs.apache.org/builds/jakarta-struts/nightly/ Thanks in advance Prashanth - Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month!
Re: URL validation with struts???
Dichotomy wrote: You could definitely do that, too. If you just create a new Url(yourstringhere) it will raise that exception if it's malformed, I would encourage you to look at the implementation of URL. It does only a small amount of validation on the format, but that may be enough, for your case. -Rob so it won't waste time creating a connection to a malformed url. I guess that's probably a better solution than the regex one, too, because it's simpler. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
difficult problem, preventing population
I have the following scenario occuring. I have a form with several fields on it (the fields are sourced to a collection in an ActionForm). I have a button that allows the removal of fields from the form (items from the collection). If a user removes a field from the form and then double submits/clicks back and reloads then an exception is thrown from BeanUtils.populate() because it attempts to take details from the (now removed field) and populate it into the object that is stored in the position it was located in the collection. Obviously since the collection is now smaller this results in an IndexOutOfBoundsException. Is there any way to examine the transaction token from the form prior to the form bean being populated and then avoid population of the form bean if the token is not valid? Help with this problem would be greatly appreciated. Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why html:xxx tags? / Dreamweaver and .do extension
tek1 wrote: Sorry for the newbie questions, but... [ Why html:xxx tags? ] On the .jsp page, why is it necessary to replace the standard html tags with the Struts-specific ones (i.e. html:form instead of just form). In other words, what special features of Struts requires these specially defined tags? The html: tags allow struts to automatically transfer information between the ActionForm and the html page. They are also module aware so a html:form tag knows which application module it belongs to. If you search in the mail-archives http://marc.theaimsgroup.com/?l=struts-userr=1w=4 there will be more detailed information. Also this should be covered in the on-line developers guide. -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DispatchAction?
Bjorn T Johansen wrote: I am starting to use DispatchAction instead of some of my actions to simplify CRUD operations, but I have a question. How do I integrate which method to call in a html:form tag? I.e. if I could write http://localhost/app/order?method=create then it wouldn't be a problem, but how do I write the same thing using html:form? Just create another global forward for submitting the form. forward name=order_submit path=/do/order?method=create/ Then use html:form action=order_submit/ (html:form action=/order focus=date where should I put the method parameter? ) Regards, BTJ --- Bjørn T Johansen (BSc,MNIF) Executive Manager [EMAIL PROTECTED] Havleik Consulting Phone : +47 67 54 15 17 Conradisvei 4 Fax : +47 67 54 13 91 N-1338 Sandvika Cellular : +47 926 93 298 http://www.havleik.no --- The stickers on the side of the box said Supported Platforms: Windows 98, Windows NT 4.0, Windows 2000 or better, so clearly Linux was a supported platform. --- - 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: UML diagrams in Struts source
Aaron Longwell wrote: Rob Leland wrote: Rahul wrote: Greetings All, As for the source, it's well-documented, explained and with UML diagrams. ah ! that reminds me .. I would like to know if these UML diagrams are being generated by an open source tool. May be I could use something like that to get some neat UML diagrams for other few java project trees sitting on my PC and whose number of source files is dreary enuff to make me dizzzy. The UML in the Java Doc was created with Silver Stream 1.1 which is a free UML tool. The ones in Ted's Book was created with Together J. Has anyone used ArgoUML? I've been wanting to try it for a while... is it worth the 10 second download? http://argouml.tigris.org Argo was a mess last time I used it, about a year. The application was huge and very buggy. I made a mistake it was SilverRun JD 1.1, not silver stream. Also, Do you have URLs for SilverStream and Together J? TogetherJ is only an evaliation, and you will have to go to borland.com now to get an evaluation copy. For SilverRun 'Google' it. -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: executing statements on subsets of actions without code duplication
Rob wrote: Rob Leland wrote: Rob wrote: I have a set of statements I would like executed every time an action is executed. I would also like to only have to code these set of statements once and have them transparently executed for all actions (except for a small subset). When we were using a Servlet 2.2 container we derived a class from Action named SecureAction, which checked that the user was logged in. Can you explain how this was done in a little more detail, particularly what methods were used, where they were used etc..? I have the current arrangement where I extend Action with a BaseAction, which implements my common method (the one to be called always) and then from subclasses of BaseAction.execute() I call the common method. Find out what method in Action calls the execute() method, which is empty. I forget. Override that method in BaseAction, then place a call to your common method in that method. That way no Action can be called unless your common method says it can. -Rob It is this having to manually call the common method I would like to eliminate and just have it transparently occur higher in the hierarchy. As for your suggestion of using filters could you direct me to more information regarding that method I'm interested in exploring it. Thanks Then all the applications Actions would be SecureAction Children. If struts had events then the event could be hooked instead, this is easy enough to do. Under Servlet 2.3 filters could be used. -Rob - 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: Documentation correction
Pedro Emanuel de Castro Faria Salgado wrote: Warning: on the struts documentation about multiple module support when it says: -- Now, to change to ModuleB, we would use a URI like this: http://localhost:8080/toModule.do?prefix=moduleBpage=index.do That's all there is to it! Happy module-switching! -- It should be: http://localhost:8080/toModule.do?prefix=/moduleBpage=/index.do Fixed, Thanks ! Pedro Salgado - 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: executing statements on subsets of actions without code duplication
Rob wrote: I have a set of statements I would like executed every time an action is executed. I would also like to only have to code these set of statements once and have them transparently executed for all actions (except for a small subset). When we were using a Servlet 2.2 container we derived a class from Action named SecureAction, which checked that the user was logged in. Then all the applications Actions would be SecureAction Children. If struts had events then the event could be hooked instead, this is easy enough to do. Under Servlet 2.3 filters could be used. -Rob Is there a facility in struts for doing this? Is there an example somewhere perhaps in the example application? (I couldn't see one) Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: executing statements on subsets of actions without code duplication
Rob Leland wrote: Rob wrote: I have a set of statements I would like executed every time an action is executed. I would also like to only have to code these set of statements once and have them transparently executed for all actions (except for a small subset). When we were using a Servlet 2.2 container we derived a class from Action named SecureAction, which checked that the user was logged in. Can you explain how this was done in a little more detail, particularly what methods were used, where they were used etc..? I have the current arrangement where I extend Action with a BaseAction, which implements my common method (the one to be called always) and then from subclasses of BaseAction.execute() I call the common method. It is this having to manually call the common method I would like to eliminate and just have it transparently occur higher in the hierarchy. As for your suggestion of using filters could you direct me to more information regarding that method I'm interested in exploring it. Thanks Then all the applications Actions would be SecureAction Children. If struts had events then the event could be hooked instead, this is easy enough to do. Under Servlet 2.3 filters could be used. -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: a jsp question:how to get the web application's directory?
I prefer html:base/ for this. lcl wrote: Hi all, I just have a question about jsp/servlet, how to gain the directory in the file system of a web application? because I want to create a file under the web application, and redirect it to user. Best Regards lcl - 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]
multiple request / query parameters in struts-config.xml
I have the following arrangement for some of my forwards. forward name=foo path=/do/foo?bar=10/ Now it's come time where I want to have more than one parameter specified in the struts-config.xml file. I tried: forward name=foo path=/do/foo?bar=10ampid=10/ However the second parameter ends up being null. How do you correctly specify more than one parameter? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: multiple request / query parameters in struts-config.xml
Thanks, I knew that I just can't believe I forgot it. Andrew Hill wrote: forward name=foo path=/do/foo?bar=10amp;id=10/ Note the ';' in the above. (proper xml terminates its entities with ; while html doesnt need it) -Original Message- From: Rob [mailto:[EMAIL PROTECTED] Sent: Friday, 13 June 2003 14:23 To: Struts Users Mailing List Subject: multiple request / query parameters in struts-config.xml I have the following arrangement for some of my forwards. forward name=foo path=/do/foo?bar=10/ Now it's come time where I want to have more than one parameter specified in the struts-config.xml file. I tried: forward name=foo path=/do/foo?bar=10ampid=10/ However the second parameter ends up being null. How do you correctly specify more than one parameter? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: multiple request / query parameters in struts-config.xml
hmm, actually I just looked at my config file and I didn't forget the ';'. I only forgot it when posting this question. Any other suggestions? Andrew Hill wrote: forward name=foo path=/do/foo?bar=10amp;id=10/ Note the ';' in the above. (proper xml terminates its entities with ; while html doesnt need it) -Original Message- From: Rob [mailto:[EMAIL PROTECTED] Sent: Friday, 13 June 2003 14:23 To: Struts Users Mailing List Subject: multiple request / query parameters in struts-config.xml I have the following arrangement for some of my forwards. forward name=foo path=/do/foo?bar=10/ Now it's come time where I want to have more than one parameter specified in the struts-config.xml file. I tried: forward name=foo path=/do/foo?bar=10ampid=10/ However the second parameter ends up being null. How do you correctly specify more than one parameter? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: UML diagrams in Struts source
Rahul wrote: Greetings All, As for the source, it's well-documented, explained and with UML diagrams. ah ! that reminds me .. I would like to know if these UML diagrams are being generated by an open source tool. May be I could use something like that to get some neat UML diagrams for other few java project trees sitting on my PC and whose number of source files is dreary enuff to make me dizzzy. The UML in the Java Doc was created with Silver Stream 1.1 which is a free UML tool. The ones in Ted's Book was created with Together J. Cheers, rahul ;o) -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
executing statements on subsets of actions without code duplication
I have a set of statements I would like executed every time an action is executed. I would also like to only have to code these set of statements once and have them transparently executed for all actions (except for a small subset). Is there a facility in struts for doing this? Is there an example somewhere perhaps in the example application? (I couldn't see one) Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Correct validator DTD
Raible, Matt wrote: Which is the correct DTD for the Validator: !DOCTYPE form-validation PUBLIC -//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN http://jakarta.apache.org/commons/dtds/validator_1_0.dtd; If you are using Validator with struts 1.1 RC 1 or RC2 then it is http://jakarta.apache.org/commons/dtds/validator_1_0_1.dtd OR 1.1? !DOCTYPE form-validation PUBLIC -//Apache Software Foundation//DTD Struts Validation Configuration 1.1//EN http://jakarta.apache.org/struts/dtds/validation_1_1.dtd; This is used if you are using the Validator nightly build by itself or have rebuilt struts from its source code against the nightly validator. -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: adding / creating new collection elements in a form
Hi Dan, This seems to be the most promising solution as of yet. I am however a little unclear as to how this avoids the need for a request for each row added. If I understand what your describing the LookupDispatchAction extension is for handling forms with multiple buttons. As you describe one of the operations of this action is to add a new element to the collection from which I am populating the form fields. My confusion is that I don't see how a request is avoided for every new row added. I would like to add multiple rows to my html form on the client side w/ javascript (making no request to the server) and then allow the user to populate and when submitted all new rows result in new instances of whatever kind of object being added to the collection. I can provide a more detailed explanation if it helps, I'm not entirely sure I can do what I want to do with struts at this point. Rob Dan Tran wrote: I just implemented myself, so let me throw a shot at this. In my case, I make my action derived from LookupDispatchAction which can handle multiple button submission handlers. One of the button is called something like addRow. When you hit this addRow button, struts will repopolate what ever on your screen and dispatch it to your addRow handler where you can add new empty row to your collection and forward back to your screen. regarding your out of index problem, I would suggest to use common Collection ListUtils.lazyList. Here is an example a lazy collection in a my form private List gradeViews = ListUtils.lazyList(new ArrayList(), new GenericFactory(org.glvnsjc.view.StudentGradeView)); //there is no direct setXXX, call getXXX first and populate the object // lazy list takes care all dynamic allocation public StudentGradeView getGradeView(int index) {return (StudentGradeView) gradeViews.get(index); } public void removeAllGradeView() { this.gradeViews.clear(); } public List getGradeViews() { return this.gradeViews;} Please look up GenericFactory in the maling list, I dont want to repost it If you dont know LookupDispatchAction yet, learn it. It has the magic that I cant live without Good luck!!! -Dan - Original Message - From: Rob [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Saturday, June 07, 2003 8:55 AM Subject: Re: adding / creating new collection elements in a form Perhaps I was not making myself clear when I first posted this. I know how to write the javascript, I know how to use struts nested/logic tags. What I was looking for when I posted was a solution whereby I could add new elements to a collection in a form. Not update existing elements, thus increasing the size of a collection based on properties from fields that were added by client side scripting. I've not been able to find a solution to this within the mailing list. But I would like to the following. I have a page with a collection of fields which are populated by a form (via it's collection). I also have a button which would allow the addition of a new row. (hopefully) Name Descrip [ xy ][ foo ] [ ab ][ bar ] Add (1) I would like to have the add button add a new pair of text input fields each time it is clicked. (2) I would like it if clicking add did not make a request to the server this being the case it suggests some kind of client side javascript adding the new fields. The problems of course with this are the following. (1) client side code won't be able to utilise the struts tags and as such I won't know what values to set the appropriate input text element attributes to. (2) It is highly likely that even if I solved problem (1) that it would result in a IndexOutOfBounds exception, or just not bother with the properties from the new fields. Has anyone else solved this? Does struts have a mechanism for dealing with this? I'm fully aware of nested/logic tags but if they are the way I can't see how. Suggestions would be appreciated, Thanks! Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts doesn't execute my ActionForm.
Thomas Miskiewicz wrote: Hi! I have a small HTML-Form with 3 textfields. I've implemented the validation rules in the validate() method of the ActionForm belonging to the html form. Unfortunately Struts isn't using the ActionForm. Why? Here my struts-config.xml ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.1//EN http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd; struts-config form-beans form-bean name=postTestForm type=com.mycompany.PostTestForm/ /form-beans This looks ok. global-forwards type=org.apache.struts.action.ActionForward global-forwards !-- instead -- forward name=system.error path=/WEB-INF/jsp/systemError.jsp/ forward name=default.action path=/execute/homePageSetuo/ /global-forwards action-mappings action path=/homePageSetup type=com.mycompany.HomePageSetupAction unknown=true forward name=homepage.success path=/WEB-INF/jsp/homePage.jsp/ /action action path=/postTestSetup type=com.mycompany.PostTestSetupAction name=postTestForm scope=request validate=false forward name=posttest.success path=/WEB-INF/jsp/postTest.jsp / /action action path=/postTest input=/WEB-INF/jsp/postTest.jsp It _is_ ok to have input=/WEB-INF/... name=postTestForm scope=request validate=true type=com.mycompany.PostTestForm You've definately gone wrong with the type here, the type=... should specify an Action not a Form. Perhaps type=com.mycompany.PostTestAction ? forward name=posttest.success path=/execute/homePageSetup/ /action /action-mappings /struts-config The validation checks, if the fields are not empty. Even through the fields are being empty, when I press the Submit button the applications presents me the entryform of the whole application. Also the URL looks pretty strange http://localhost/myapp/execute/postTest%20name= What doesn the %20name= mean? I think this is part of the problem. Can someone please tell me what am I doing wrong here? Regards Tom - 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: adding / creating new collection elements in a form
Perhaps I was not making myself clear when I first posted this. I know how to write the javascript, I know how to use struts nested/logic tags. What I was looking for when I posted was a solution whereby I could add new elements to a collection in a form. Not update existing elements, thus increasing the size of a collection based on properties from fields that were added by client side scripting. I've not been able to find a solution to this within the mailing list. But I would like to the following. I have a page with a collection of fields which are populated by a form (via it's collection). I also have a button which would allow the addition of a new row. (hopefully) Name Descrip [ xy ][ foo ] [ ab ][ bar ] Add (1) I would like to have the add button add a new pair of text input fields each time it is clicked. (2) I would like it if clicking add did not make a request to the server this being the case it suggests some kind of client side javascript adding the new fields. The problems of course with this are the following. (1) client side code won't be able to utilise the struts tags and as such I won't know what values to set the appropriate input text element attributes to. (2) It is highly likely that even if I solved problem (1) that it would result in a IndexOutOfBounds exception, or just not bother with the properties from the new fields. Has anyone else solved this? Does struts have a mechanism for dealing with this? I'm fully aware of nested/logic tags but if they are the way I can't see how. Suggestions would be appreciated, Thanks! Rob - 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]
adding / creating new collection elements in a form
I've not been able to find a solution to this within the mailing list. But I would like to the following. I have a page with a collection of fields which are populated by a form (via it's collection). I also have a button which would allow the addition of a new row. (hopefully) Name Descrip [ xy ][ foo ] [ ab ][ bar ] Add (1) I would like to have the add button add a new pair of text input fields each time it is clicked. (2) I would like it if clicking add did not make a request to the server this being the case it suggests some kind of client side javascript adding the new fields. The problems of course with this are the following. (1) client side code won't be able to utilise the struts tags and as such I won't know what values to set the appropriate input text element attributes to. (2) It is highly likely that even if I solved problem (1) that it would result in a IndexOutOfBounds exception, or just not bother with the properties from the new fields. Has anyone else solved this? Does struts have a mechanism for dealing with this? I'm fully aware of nested/logic tags but if they are the way I can't see how. Suggestions would be appreciated, Thanks! Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ValidatorUtil deprecated?
Raible, Matt wrote: I just downloaded and installed Struts from last night (6/02/2003). Now I'm getting deprecation errors for ValidationUtil, yet the API docs say nothing about what it's been replaced with (http://tinyurl.com/dac9). Any ideas? Also, ValidatorResources has a couple deprecated methods too. ValidatorResources.get(java.util.Locale,java.lang.Object) .getFieldMap() Your probably talking about commons-validator ? Struts 1.1 will ship with the 1.02 version of commons-validator not the 1.1 version. So I would say this is a bug in the Validator docs, they should point to the equivalent method in the new class. There are two ways to keep up with this: 1) Subscribe to commons-dev to get the commit messages or 2) Look at an old example that uses ValidatorUtil method then see what new method is used. 3) Using the old source code take a section and do a global search for that code. David has been on a mission to reorganize the commons-validator code, renaming forms to beans, changing method signatures Thanks, Matt Sorry I couldn't be of more help. -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 1.1 on z/OS with WebSphere Application Server 4.0
Markus Holzem wrote: Does anyone have experiences with Struts running on an IBM mainframe? I'm particularly interested in WebSphere 4.0 (z/OS, *not* z/Linux). I've tried to find anything in the archive, but I only found references on WebSphere running on Wintel, Linux or Solaris. Since WebSphere on z/OS is only 99.9% compatible to the other platforms I'm a bit anxious about giving it a try. I'd be very much obliged, if anyone could give some hints for running Struts 1.1 on this platform. Markus Check out Buziilla, I know there was a bug report files against zOs for the commons-fileupload, so there is atleast one other person who is using it. -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 1.1
[EMAIL PROTECTED] wrote: So, my question is, what exactly are we waiting for for the Struts 1.1 release? What can we do to get it there as soon as possible? We'd be willing to put some time into it to get it released. Using it in our production applications is out of the question though. I know this is a little harsh, but I have lost count of how long we've been waiting. At least 7 Struts books have been released since Struts 1.1 beta was released. (it's funny that all of them say that 1.1 will be out once the book is in print. :) Other web frameworks have gone from nothing to having released software during the beta of 1.1. I want quality software as much as the next guy, but was Struts 1.0 so poorly designed that it takes so long to come out with the next MINOR version? OK, flame away, but I hope we can get someone tell us exactly what we need to do to stop the hold up and get 1.1 released. Please let us know. I'll qualify this by saying I have not been in the release loop but here are my 2 cents. Martin has been working very hard on several packages in Jakarta-Commons. I believe at this point that commons-fileupload will go to a 1.0 final with known unsupported containers, such as zOs. Then struts 1.1 will go out. So for short term what you and other could contribute is mapping any know shortcomings in the nightly build by: 0) Contribute your time and experience doing: 1) Testing is always welcome under different containers. Make a entry under the Wiki to note what functionality was tested and under what container. There isn't currently a section for that but you could organize one. These results would eventually go into the official struts documentation. To facilitate Struts 1.2 to come out faster: 2) Use Bugzilla to find all open tickets, marked 'later'. Browse through them and see if improvements in the code that is suggested would benefit your project. If so then develop a patch that implements the fix and attach that to bugzilla. 3) Improvements to docs are always welcome as are diagrams, UML, etc... -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ANN: Site Launch
James Childers wrote: I am proud to announce the successful launch of a major vacation packaging site whose presentation tier has been built entirely with Struts: http://packaging.hotels.com/packaging/index.do It looks good. I didn't see any where on the site that mentioned that software from the Apache foundation was used, this has been discussed before see the thread: This should help out: http://marc.theaimsgroup.com/?l=struts-userm=103123221707143w=2 Also see http://www.apache.org/LICENSE - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: zip of struts diagrams
Vijay Pawar wrote: Resending the same mail to the mail list. This time the attachment is in .zip format. Hope it gets through to everyone ! The Diagram doesn't make a distinction between control flow and data flow, I would suggest breaking the Diagram into 2 parts: Control flow and data flow. At the very least use different type lines to represent data and control, maybe dashed vs solid. -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
bean:write / HashMap
Hi, I have checked struts documentation, including the index properties page, and cannot find the answer to this. I simply want to output some values stored in a hashmap without using scriptlets - ideally with the bean:write tag. Instead of doing this: %=myHash.get(NAME)% I would like to do something like this, but it doesn't work: bean:write name=myHash property=[NAME]/ ( but hopefully it serves to demonstrate what I'm trying to do ) I also tried this, but I'm just clutching at straws now: bean:write name=myHash[NAME]/ Using bean:write would be nice becuase it html encodes stuff without me needing to do anything. Using a bean instead of the HashMap would be a nice solution, but time constraints mean that the HashMaps need to stay for now... And, I thought I was about to find an answer here, but alas no: http://jakarta.apache.org/struts/faqs/indexedprops.html Apologies if I missed an obvious piece of documentation thanks, rob. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
struts-config.xml parse errors (can't find source)
I'm just throwing together a demo application to refresh myself w/ struts but have run into a problem where the struts-config.xml is resulting in parsing errors, problem is I can't figure out where the error is. If someone could point it out I would appreciate it. ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.1//EN http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd; struts-config global-forwards !-- Query Database -- forward name=query path=/do/query/ !-- Browse Database -- forward name=browse path=/do/browse/ !-- Submit Bug Report -- forward name=newbug path=/do/newbug/ /global-forwards form-beans form-bean name=QueryForm type=web.QueryForm/ form-bean name=BrowseForm type=web.BrowseForm/ form-bean name=NewbugForm type=web.NewbugForm/ /form-beans action-mappings action path=/query type=web.QueryAction name=QueryForm input=/WEB-INF/pages/query.jsp scope=request /action action path=/browse type=web.BrowseAction name=BrowseForm input=/WEB-INF/pages/browse.jsp scope=request /action action path=/newbug type=web.NewbugAction name=NewbugForm input=/WEB-INF/pages/newbug.jsp scope=request /action /action-mappings /struts-config The error I'm getting from tomcat is, line 46 column 17 refers to a non-existent position in the document. While the document does have 46 lines it is the last line and column 17 is beyond the closing of the /structs-config tag. SEVERE: Parse Error at line 46 column 17: The content of element type struts-config must match (data-sources?,form-beans?,global-exceptions?,global-forwards?,action-mappi ngs?,controller?,message-resources*,plug-in*). org.xml.sax.SAXParseException: The content of element type struts-config must match (data-sources?,form-beans?,global-exceptions?,global-forwards?,action-mappi ngs?,controller?,message-resources*,plug-in*). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
application configuration suggestions
I have a number of variables I would like to specify to my application at startup time. I was wondering what the best method to do this is? Does struts provide any facilities related to this? An example of a configuration value would be that I want to be able to specify the location of a set of files on the disk. Rob
Re: URL Validation with Struts validator
I started coding a URL client/server side validation 2 weeks ago, that I hope to contribute to the Validation framework. I put it on hold while getting other work finished before going on vacation. I modeled it on the email validation items, and used the w3.org definition of A URI to write the validation code. If all elements are there my code can tell if it is a valid URL, however I can't figure out when testing for a URL regular expression pattern how to make some items optional, it may not be possible, any Perl/PHP people out there ? The Unit tests I created are extensive and test all possible combinations, but take almost a 2 minutes to complete :( ! I have just come back from vacation and hope to have it finished by next week. If you want a quick and dirty method then go to javascript.com and look for some of their URL validations items, turning them into Java is easy to achieve using the ORO package. David Graham wrote: What is URL validation? David From: Greg Hess [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts [EMAIL PROTECTED] Subject: URL Validation with Struts validator Date: Wed, 5 Mar 2003 16:53:36 -0500 Hi All, Has anyone implemented URL validation for Struts validator? Can you share? Thanks, Greg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: URL Validation with Struts validator
Greg Hess wrote: I was looking at that but the RFC compliant Regex I found needs to split the string up and examine each segment separately. Could you send me the URL where I can get the RFC compliant Regex, or e-mail me directly ? It would have to make the port optional, and with that I can finish the Validator extension and submit it a patch to the commons-validator, and include the Struts part as a 1.2, more likely a 1.3 enhancement to struts. -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Any good suggestions on implementing Security
On the free side of things, I believe you could use a JNDI Realm in Tomcat for this purpose. You would need to roll your own SOAPInitialContextFactory and use that in the configuration of the JNDI Realm. Weblogic has an implementation of a SOAPInitialContextFactory: http://edocs.bea.com/wls/docs61/javadocs/weblogic/soap/http/SoapInitialConte xtFactory.html that may be configurable as part of a Weblogic security realm as well. -Rob -Original Message- From: Tony Baity [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 13, 2003 9:57 AM To: Struts Users Mailing List Subject: RE: Any good suggestions on implementing Security Craig, Would you by any chance know anyone/anyproduct that instead of using JDBCRealm has create a SOAPRealm where the user data is available via a web service instead of a database? Craig R. McClanahan [EMAIL PROTECTED] wrote: On Wed, 12 Feb 2003 [EMAIL PROTECTED] wrote: Date: Wed, 12 Feb 2003 09:57:38 -0600 From: [EMAIL PROTECTED] Reply-To: Struts Users Mailing List To: Struts Users Mailing List Subject: RE: Any good suggestions on implementing Security Depending on the container, your groups and group memberships can be dynamically mapped to roles, with declarative specification of what resources can be accessed. Is this the case with tomcat? I did not think so. It is. The element (in web.xml) includes a section that maps URL patterns to the role(s) that a user must have in order to access that URL. This is all in the servlet spec, and portable across containers. The only part that's not portable across containers is how you actually set up the users and roles database (in Tomcat terms, that is a matter of which Realm implementation you use). Our needs our very similar. The users with a admin page that allows them to change access to pages. For Tomcat specifically, this can be done easily if you use a JDBCRealm to get user and role information from a database. Then, writing an admin program to manage users is just like any other database maintenance application -- just make it update the same tables that JDBCRealm is using to authenticate and authorize users. Struts also has some built-in support for checking roles dynamically during execution: * You can use a roles attribute on an to limit which users can execute that Action. * You can use to conditionally display parts of your UI to only people that have the role you specify. Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] . . . Tony Baity . . . - Do you Yahoo!? Yahoo! Shopping - Send Flowers for Valentine's Day - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Any good suggestions on implementing Security
+1 on the ServletFilter approach. Even better if you can get container managed security to meet your needs. Depending on the container, your groups and group memberships can be dynamically mapped to roles, with declarative specification of what resources can be accessed. This approach is optimal because the security context can be shared down to the EJB tier (and even to EIS, depending on your system) for tighter top-to-bottom security. This didn't meet our needs, so we went a step further with a ServletFilter. This is nice because it puts all of your security in one place rather than sprinkled across a variety of Actions, ActionMappings, etc. If you have access to a servlet 2.3 container, use this as your second option. Programmatic security built into your Struts-related code should be a last resort, and I can't even think of an occasion where it would be justified (unless the other two options aren't available, in which case I'd suggest you put effort into an upgrade instead). -Rob -Original Message- From: Rao, Nagraj [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 12, 2003 9:53 AM To: 'Struts Users Mailing List' Subject: RE: Any good sugestions on implementing Security Well the best approach I can think of is to keep it separate from the MVC model. You could use a FilterServlet to handle security , which then forwards the request to the Struts framework. Thus making it more pluggable, than embedded -Original Message- From: Ntolios Christos [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 12, 2003 9:38 AM To: Struts Users Mailing List Subject: Any good sugestions on implementing Security Hi folks, I was wondering which would be the best approach on implementing security? Basically I have an application and I only want specific groups of people to have access and i want it to be Dynamic. I thought of changing the ActionMappings to have an extra attribute of the groups that satisfy the conditions has any body tried this? Thanks in advance chris - 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] Any good suggestions on implementing Security
Depending on the container, your groups and group memberships can be dynamically mapped to roles, with declarative specification of what resources can be accessed. Is this the case with tomcat? I did not think so. Our needs our very similar. The users with a admin page that allows them to change access to pages. I haven't used Tomcat to do it, but it appears that this document addresses some of the details: http://www.jaydeetechnology.co.uk/planetjava/tutorials/server/SecuringJavaWe bApplications.pdf It looks like you can use JDBC, XML files, or JNDI (allows LDAP) to retrieve your users, etc. This didn't meet our needs, so we went a step further with a ServletFilter. This is nice because it puts all of your security in one place rather than sprinkled across a variety of Actions, ActionMappings, etc. If you have access to a servlet 2.3 container, use this as your second option. Is this checking based on checking the requested the action_mapping against a dynamic list of allowable action_mappings? Is there an area I can look that suggests how to implement this type of dynamic security with a servlet filter? I didn't have anything to follow, but it sounds like declarative security via Tomcat can meet your needs. In my implementation, users belong to groups (roles), and groups are authorized for resources matching certain patterns. We store a list of resources a user is authorized for in their session (there is also a list of globally accessible resources), check the attempted URL against the user's list, and process or deny the user's request based on that. I don't know that it's the best implementation, and overall, I'd say to stick with container managed security. Our need to go beyond CMS was caused by a requirement to run different sites with different user groups from within the same web-app. We were concerned about the security implications of a user being authenticated with certain privileges being able to access sensitive data on another site. Sorry for the simple questions. It is a new area for us. Not a problem - web apps seem to be getting more complex yet powerful by the day -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: LookupDispatchAction
The keys in your KeyMethodMap should correspond to messages in your message bundle used to render the button. So you would have in your jsp: html:submit bean:message key=button.add.banana/ /html:submit in your action: protected Map getKeyMethodMap(ActionMapping mapping, ActionForm form, HttpServletRequest request) { Map map = new HashMap(); map.put(button.add.banana, addBanana); map.put(button.delete.banana, deleteBanana); return map; } And in your message-resources file: button.add.banana=Add Banana button.delete.banana=Delete Banana If you don't need the message resources (for i18n or something), you might want to use DispatchAction instead. -Rob -Original Message- From: JONATHAN PHILIP HOLLOWAY [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 12, 2003 12:04 PM To: Struts Users Mailing List Subject: LookupDispatchAction Does anybody know why the following is casuing me so many problems. I'm using LookupDispatchAction and have a number of methods defined in my action class including an execute method. The problem is that the execute method ALWAYS gets executed and not the intended method. I have in the addbanana.jsp: html:submit value=Add Banana property=action/ and in Struts-config: action path=/addbanana type=com.example.AddBananaAction name=BananaForm input=/addbanana.jsp scope=session parameter=action /action In my action class I've defined the following: public ActionForward addBanana(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { return (mapping.findForward(success)); } public ActionForward deleteBanana(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { return (mapping.findForward(success)); } /** * Get key method map just obtains the map that maps the button * text onto the particular method in this action * @param mapping is the action mapping * @param form is the action form * @param request is the http request */ protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(Add Banana, addBanana); map.put(Delete Banana, deleteBanana); return map; } /** * Execute method * @param mapping is the information regardin gthe URI mapping and the action * @param form is the action form used * @param request is the request * @param response is the response * @return the action forward, a destination to forward the user onto (eg another JSP) */ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { Logger.logInfo(Execute Called); //We can now put these bits in the database return (mapping.findForward(success) } Does anybody know why EXECUTE is called but the intended ADDBANANA method is not called? Many thanks, Jon. *-* Jonathan Holloway, Dept. Of Computer Science, Aberystwyth University, Ceredigion, West Wales, SY23 3DV. 07968 902140 http://users.aber.ac.uk/jph8 *-* - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Exception loading sessions from persistent storage
Due to this strange exception i am getting, i can't access my beans/forms in jsps. I will appreciate any help/clues. Many Thanks, Scot 2003-02-11 21:53:35 StandardManager[/strutsvom] IOException while loading persisted sessions: java.io.WriteAbortedException: Writing aborted by exception; java.io.NotSerializableException: org.apache.struts.config.impl.DefaultModuleConfigFactory java.io.WriteAbortedException: Writing aborted by exception; java.io.NotSerializableException: org.apache.struts.config.impl.DefaultModuleConfigFactory at java.io.ObjectInputStream.readObject(ObjectInputStream.java:445) at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2263) at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:519) at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1412) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386) at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2263) at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:519) at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1412) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386) at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2263) at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:519) at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1412) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386) at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2263) at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:519) at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1412) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236) at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1268) at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:810) at org.apache.catalina.session.StandardManager.load(StandardManager.java:411) at org.apache.catalina.session.StandardManager.start(StandardManager.java:617) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1104) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3345) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:454) at org.apache.catalina.core.StandardHost.install(StandardHost.java:714) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:324) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:389) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:232) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:155) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131) at org.apache.catalina.core.StandardHost.start(StandardHost.java:614) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343) at org.apache.catalina.core.StandardService.start(StandardService.java:388) at org.apache.catalina.core.StandardServer.start(StandardServer.java:506) at org.apache.catalina.startup.Catalina.start(Catalina.java:781) at org.apache.catalina.startup.Catalina.execute(Catalina.java:681) at org.apache.catalina.startup.Catalina.process(Catalina.java:179) at java.lang.reflect.Method.invoke(Native Method) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243) 2003-02-11 21:53:35 StandardManager[/strutsvom] Exception loading sessions from persistent storage java.io.WriteAbortedException: Writing aborted by exception; java.io.NotSerializableException: org.apache.struts.config.impl.DefaultModuleConfigFactory at java.io.ObjectInputStream.readObject(ObjectInputStream.java:445) at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2263) at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:519) at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1412) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386) at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2263) at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:519) at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1412) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386) at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2263) at
How to handle Collections (List,Map etc.)
Hi, I am not sure how can i pass a collection of beans from my action class to jsp? In my Action class, if i set a session attribute with a list/Map Object. Which struts tags can i use on jsp side? Please help ? Scot __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Exception:: tag nesting error ?
Hi, I am getting this strange tag nesting erorr. Does anyone any possible reason for it ? Pls see output from Tomcat log file below. Many Thanks Scot 2003-02-10 20:49:34 ApplicationDispatcher[/strutsvom] Servlet.service() for servlet jsp threw exception org.apache.jasper.compiler.ParseException: End of content reached while more parsing required: tag nesting error? at org.apache.jasper.compiler.JspReader.popFile(JspReader.java:293) at org.apache.jasper.compiler.JspReader.hasMoreInput(JspReader.java:337) at org.apache.jasper.compiler.JspReader.nextChar(JspReader.java:346) at org.apache.jasper.compiler.JspReader.skipUntil(JspReader.java:473) at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java:868) at org.apache.jasper.compiler.Parser.parse(Parser.java:1145) at org.apache.jasper.compiler.Parser.parse(Parser.java:1103) at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java:892) at org.apache.jasper.compiler.Parser.parse(Parser.java:1145) at org.apache.jasper.compiler.Parser.parse(Parser.java:1103) at org.apache.jasper.compiler.Parser.parse(Parser.java:1099) at org.apache.jasper.compiler.ParserController.parse(ParserController.java:213) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:210) at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:552) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:177) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:189) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:683) 2003-02-10 20:49:34 ApplicationDispatcher[/strutsvom] Servlet.service() for servlet jsp threw exception javax.servlet.ServletException: End of content reached while more parsing required: tag nesting error? at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:463) at org.apache.jsp.template$jsp._jspService(template$jsp.java:1205) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:683) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:497) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:819) at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:391) at org.apache.struts.taglib.template.InsertTag.doEndTag(InsertTag.java:158) at org.apache.jsp.pending_0005fuser_0005flist$jsp._jspService(pending_0005fuser_0005flist$jsp.java:1316) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:683) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:431) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:355) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1033) at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:269) at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:436) at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:312) at org.apache.struts.action.RequestProcessor.processActionForward(RequestProcessor.java:401) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422) at
Re: Design Questio
Justin F. Knotzke wrote: Hi, I am sure this is a basic question. Take a situation in where we have 2 JSPs, 2 ActionForms, and 2 ActioForward classes: a.jsp b.jsp ActionFormA.class ActionFormB.class ActionForwardA.class ActionForwardB.class a.jsp has form who's action parameter calls ActionForwardA.class with ActionFormA.class as it's form object. ActionForwardA.class does some happy-happy stuff and then calls b.jsp. Correct me if I am wrong but b.jsp will be called using ActionFormA.class's data. Keeping in mind that ActionForwardA.class requires data from ActionFormA.class, what do I do if I want b.jsp to be mapped to ActionFormB.class? The pattern that the struts example uses is EditAAction SaveAAction --EditBAction SaveBAction \ / \/ \ / \ / \/ / \/ / (AActionForm) + A.jsp (BActionForm)+B.jsp To keep your code maintainable after SaveAAction is 'happy' It looks up the 'success' or 'happy' mapping in your struts-config.xml That maps to EditBAction which takes care of filling in the data for BActionForm, and then forwards to b.jsp. All this is covered in Ted Husted's 'A Walking tour of the struts example'. in the resources section of the Struts web site, it is also included in the 'struts-documentation' web application in the binary struts download. Taking the time to look at that explaination of the 'example' included with struts, look at the code and trace through the program flow, and after some digging you'll get an AH or two that will be worth it. -Rob P.S. As always there are other articles out there on the Jakarta web site/ or Javaworld, sites to name a few. You can also pickup one of the very good struts books that have come out. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validator question
Did you 'new HashMap()' all your HashMap's in you ActionForm ? Any ideas why I am getting this error? I will really appreciate the help. It looks like I am not defining the error properly and the MessageTag is throwing excetpion. I will really appreciate any help I can get. Thanks!! Jamal - Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: how to access a specific object inside a List efficiently
The problem you're hitting is that there's really no concept of a key in a List - it's just an ordered collection of objects. The closest you'd find is the contains( Object o) method, but that looks for the entire object and not just a key. I would suggest using a HashMap for what you're looking for. As for the break on logic:iterate, I think the closest way to approximate this is by setting up a flag for the loop such that you can do this: set up loop flag logic:iterate logic:equals name=loopFlag value=true (do important stuff) /logic:equals set loopFlag to false when criteria are met /logic:iterate This won't save the loop iterations, but will keep extra content from being written after you meet the criteria. If possible, however, you may want to trim your data set in the Action before you ever get to the jsp. -Rob -Original Message- From: Derek Shen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 12:51 PM To: [EMAIL PROTECTED] Subject: how to acccess a specific object inside a List efficiently I have trouble to access a specific object inside a List based on a key. Before the first page, I load all the objects(meetings) into a list and only show the name of the meeting to the user. By following the link (with id as parameter), user goes to the next page. Based on the id, I want to show the detail of the object (meeting). For my current implementation, I have to iterate through every single object in the list and try to match the key. It works, but pretty stupid. Is there a better way to do it? Or should I use Hashmap (keyed by id) at the very beginning instead? Also, to use logic:iterate, is there something like a break? Thanks! ds First page: logic:iterate id=m name=meetings li html:link forward=showMeeting paramId=id paramProperty=id paramName=m bean:write name=m property=name/nbsp; /html:link /li /logic:iterate It will build: http://myproject/showMeeting?id=1 Second Page: logic:iterate id=row name=meetings logic:equal name=row property=id value=%=request.getParameter (id)% tr TH align=right width=50%Meeting Name:/TH TD align=leftbean:write name=row property=name//TD /tr ... /logic:equal /logic:iterate _ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Tiles] loses current url
In the header file, try request.getRequestURL() - it should give you the page that was called. Tiles effectively does a jsp:insert, which means that the request parameters are the same for any included tiles. -Rob -Original Message- From: Kevin Tung [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 3:17 PM To: Struts-user Subject: [Tiles] loses current url Is there anyway for a tiles component to detect the URL that was used to call up the page in the first place? For example, http://myhost/mypage1.jsp http://myhost/mypage2.jsp may both contain a tiles:insert tag that points to /myheader.jsp is there anyway for the header file to detect which of the two url's were called by the user? Without adding code in mypage1 mypage2 to save the url in the session/request/page/application scope. And without adding request parameters to the tiles:insert tag. Is this possible with Struts 1.1b3? Thanks, Kevin - 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: form naming
In fairness, I don't think it's clear from the documentation. However, a google search yields: http://www.mail-archive.com/struts-user@jakarta.apache.org/msg52038.html, which indicates someone looked at the source to find the answer. Also in fairness, searching the list is not an easy task - searching through the links from the struts site yields Text search not available for this list. -Rob -Original Message- From: Pani, Gourav [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 3:52 PM To: 'Struts Users Mailing List' Subject: RE: form naming Please consult the struts-html.tld file for syntax formatting issues. -Original Message- From: Vinay [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 3:48 PM To: Struts Users Mailing List Subject: form naming How can I name a html:form form name=transactions method=POST action=ActionServlet How can I do this using html:form I have to do JavaScript functions using that. Thanks help appreciated Vinay - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to access a valueObject inside a Map?
I think a shift in how you approach your JSPs and Actions will get you the most mileage here. It seems that by storing this map in session, you're trying to get around ever creating any additional references to it. What I'd suggest is that you handle this in your Action. In your action, fetch the object from the map using the key, then store that valueObject in the request. The page can then access the object using the request-scoped bean. I think you're trying to do too much through the session/page combination, and not enough in your Action. -Rob -Original Message- From: Derek Shen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 5:18 PM To: [EMAIL PROTECTED] Subject: Re: How to access a valueObject inside a Map? No one is helping me out, or it's too easy a question? :) I know how to do it through script. Just wondering can I use any struts bean tag to do it? Thanks From: Derek Shen [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: How to access a valueObject inside a Map? Date: Wed, 05 Feb 2003 20:38:47 + I have a bean which is a HashMap in the session. I want to access a specific valueObject in the map based on a Key. And then show the information inside the valueObject. Should I define a bean for the valueObject? How? _ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] N _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Tiles] loses current url
I think to solve your problem, you're going to need to define the problem in broader terms. A redirect is much like a forward, except the client doesn't know about it. Once the Action has executed and mapped to a page, a redirect is executed (unless you specify a forward). Either way, what this means is that after Struts finds the URL to access after it processes your action, the request is against that JSP, and the previous request URL is gone from the HTTP headers. What's the overall problem you're trying to solve? That may be a better approach, because given the parameters of the current problem, you're walled in with nowhere to go. It sounds like perhaps you're trying to solve some sort of navigation or form population problem? -Rob -Original Message- From: Kevin Tung [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 5:05 PM To: Struts Users Mailing List Subject: RE: [Tiles] loses current url Ok.. I think I over-simplified my scenario :) sorry. What I have in fact, is the following definition name=Layout path=/layout.jsp put name=header value=/header.jsp type=page/ /definition in the tiles-defs.xml file. and action path=/Layout forward=Layout/ in the struts-config file When I access the url http://myhost/Layout.do the request.getRequestURL() call from both the layout.jsp and the header.jsp files return http://myhost/layout.jsp; and not http://myhost/Layout.do; Is this by design? is there anyway to get the correct original url from within these jsp pages? Thanks, Kevin -Original Message- From: Rob Kischuk [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 3:43 PM To: 'Struts Users Mailing List' Subject: RE: [Tiles] loses current url In the header file, try request.getRequestURL() - it should give you the page that was called. Tiles effectively does a jsp:insert, which means that the request parameters are the same for any included tiles. -Rob -Original Message- From: Kevin Tung [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 3:17 PM To: Struts-user Subject: [Tiles] loses current url Is there anyway for a tiles component to detect the URL that was used to call up the page in the first place? For example, http://myhost/mypage1.jsp http://myhost/mypage2.jsp may both contain a tiles:insert tag that points to /myheader.jsp is there anyway for the header file to detect which of the two url's were called by the user? Without adding code in mypage1 mypage2 to save the url in the session/request/page/application scope. And without adding request parameters to the tiles:insert tag. Is this possible with Struts 1.1b3? Thanks, Kevin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
(newbie) Problem getting request level bean data in jsps
Hi, I am setting some data in DynaActionForm userRegisterForm in my Action registerUser and it forwards request to a jsp page through another Action showRegisterForm (which is a ForwardAction). Now, i am trying to get data in the jsp page using html:text property=name name=userRegisterForm/ but it does not get any data. I also tried bean:write property=name name=userRegisterForm/ but this doesn't return any data as well. I wanted to avoid making userRegisterForm bean's scope session level. I 'd appreciate if someone can point out my mistake or the right way to do it? Many thanks Asif ___ action path=/registerUser type=actions.RegisterUserAction name=userRegisterForm scope=request parameter=type forward name=showRegisterForm path=/showRegisterForm.vo redirect=true / forward name=confirmRegisterForm path=/comfirmRegisterForm.vo redirect=true / /action action path=/showRegisterForm parameter=unreg_user_registration_form.jsp type=org.apache.struts.actions.ForwardAction name=userRegisterForm scope=request / __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Does anyone out there use Scaffold?
[EMAIL PROTECTED] wrote: We are currently developing Struts apps and incorporating Scaffold code into them. Firstly, I was wondering if anyone else out there is using Scaffold code and what comments they have on their success or otherwise with it? Secondly, with the latest release of Struts (1.1b3), Scaffold code has been packaged into the contrib section. However the commons-scaffold components are not there. It was decided about 2 weeks ago that the struts 1.1 release would only contain commons libs needed to build the main distribution and provided examples. However there has been some talk about providing a seperate download to package items needed to build the contrib items, and a build of the contrib itself. They are in jakarta-commons-sandbox but only the source in the CVS repository. Should commons-scaffold be somewhere in jakarta-commons now that scaffolds is being packaged with Struts 1.1b3 and should there be a built version of this code somewhere? -Rob -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Any reflection based utility to copy ActionForm to/from Domainobject?
Reply in-Line: Jagdish Arora wrote: On my ActionForm, I have a lot of HTML input elements, which come from the domain object (Shipment). To copy them to the ActionForm (in displayPage(), and from the ActionForm (in saveShipment()), I have quite repetitive code such as: // in displayPage.. form.setName (shipment.getName()); form.setEndDate (shipment.getEndDate()); .. .. // 26 such lines. // in saveShipment.. shipment.setName (form.getName()); Beanutil.copyProperties() will handle bean names that are exactly the same. The struts example uses it. shipment.setBeginDate (form.getBeginName()); Bean names are different and so won't be copied. -Rob -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Struts Validator Problem
Amit Keshav Kulkarni wrote: Hi All I facing problem in Validator - Struts 1.1 . I am having two fields and checking for the empty fields.While submitting the form with empty fields, I am getting the following error in Tomcat 4.0.3 This is the error that it is throwing in the Browser.. java.lang.NullPointerException at java.util.Hashtable.put(Hashtable.java:380) at org.apache.jasper.runtime.PageContextImpl.setAttribute(PageContextImpl.java:229) at org.apache.struts.taglib.html.MessagesTag.doStartTag(MessagesTag.java:250) at org.apache.jsp.login$jsp._jspService(login$jsp.java:185) This doesn't look like a validator problem, since the error is occurring from the bean:message Tag. You don't seem to be using a recient struts 1.1 version because the line numbers in the trace don't match the current CVS source. -Rob -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Struts validating with beta2 not working for server-side validation
I haven't been following this thread, but whenever a bug is discovered try downlading a recient nightly build. A number of bugs have been fixed since 1.1b2. -Rob -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Validator requiredIf
Michelle Wynn wrote: Has anyone had any success validating conditionally with requiredIf client-side? There does not seem to have been a javascript method created for this validation method. I looked in 1.1B and the most recent nightly build. Also haven't had success validating server side (although I do have the source for the method in the FieldChecks class). Have you updated your project with the validator-rules.xml file from the nightly build, besides updating all the other associated commeons-xxx.jar files? -Rob -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Struts design: All actions in one ActionClass
David Graham wrote: Definitely b. It will be far easier to maintain. If you're worried about having a lot of actions you can look at DispatchAction or using DynaBeans. I'll second that. For a project we started back in Feb 2001, I used small Action classes. I went away on my Honeymoon in May and came back 3 weeks later and moved on to another project. One of the developers that took over the project merged a number of the actions edit, delete, create, list into one big ugly mess. New developers that same along used that same pattern when adding new Actions, ugh ! Now 18 months later we have 5+ projects using the same set of core Action classes and there is alot of complaints about how hard it to maintain ! We are now moveing to break up those action classes. Some people just have to learn the hard way , and very expensive too I might add -Rob David From: Jordan Thomas [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts-User [EMAIL PROTECTED] Subject: Struts design: All actions in one ActionClass Date: Wed, 11 Dec 2002 19:05:36 +0100 Hi, What is the best way to design my application? Is it better to a) Put all my actions for a particluar area (i.e. creating, editing and deleting user accounts) in one Action class or b) Use a seperate action class for every action in my application or c) Put all of the actions for a particular workflow in a single Action class. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: How to resolve why java element deprecated?
David Graham wrote: The version of java has nothing to do with this. Check the PropertyUtil javadoc in the jakarta commons for details. David I didn't think struts 1.0 use commons-xxx jars ? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: using tomcat version
contactrajib wrote: Hi, I was trying to figure out the best version of Tomcat for using Struts 1.0.2. Some people told me that it is best to use tomcat 3.2.2. Any ideas or suggestions are welcome. Regards Rajib If you are just starting to learning Struts, I would --Highly-- recommend using the latest Nightly build. If you aren't using the new items (modules, validator, tiles, nested tags, declarative exception handling), whatever documentation/articles you may have read on Struts 1.0 should apply equally we'll. It will also save you time in converting later on. Plus the Struts 1.1 bugs are actively fixed. Then you can use Tomcat 4.1.12 which has speed improvements. -Rob -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [Validator] Not validating any more since update? - Urgent
There is a know problem when the default LOCALE of the server and the default LOCALE of the client are different. If you download The Latest Nightly build and view the struts-documentation.jar validator notes it mentions that. The bug is in the commons-validator code. If this is not the problem, make sure your DTD references at the tops of your validator.xml files have been updated, and make sure you are using the new validator-rules.xml in your web app. -Rob Axel wrote: Hi. After updating struts and all common libs (including common-validator) from nightly-build 2002-07-31 to nightly-build 2002-11-11 (and later on nightly-build 2002-11-18, too), all our forms usually validated by the Struts-Validator-Framework are not validated any more. It seems as if all that validator methods are not called any more. After taking the old libs, everything works out fine again. We raised our debug-level to DEBUG for org.apache.struts.validator and org.apache.commons.validator. The only thing i can find in the logfiles is the loading of validator.xml and validator-rules.xml. Any suggestions? Does anybody know what has happened here? Thanks in advance. Axel -- To unsubscribe, e-mail: For additional commands, e-mail: -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Upgrading to STRUTS 1.1
Savantraj, Chennamakal Subramanian wrote: Hi, I had written a small sample DB application with STRUTS1.0. But when I tried to just copy the 1.1 STRUTS.jar and run the application, I got the error servlet not found. What should I do to make my application run? Is there any place I can look for resources for upgrade? Please recompile your program against the 1.1 jar file and all the associated commons-*.jars included in it. In most cases it should just recompile and run. Also someone published a 'case study' of converting over from Struts 1.0 - 1.1 so search the mailing archive for the word 'case study'. -Rob -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: Validate and nightly build problem
Michael Delamere wrote: Hi, I posted a problem yesterday concerning validating forms in several sub-apps, whereby it only seemed to work for one and not all... this was using struts1.1b2. As suggested, I downloaded the nightly build that you tried today and now validation doesn´t seem to work at all... The Javascript tag looks good html:javascript formName=loginFormBean/ Please try the struts-validator.war and report back if it works. Were all the *.jar files, including common-*.jar files and all the validator*.xml also updated with the versions included using the Nightly struts builds ? -Rob -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: Validate and nightly build problem
Michael Delamere wrote: I tried the registration and to me it seemed not to work Unless of course it is normal behaviour that when leaving the fields blank that it takes me to the start screen Yes, that is the behavior. If the field MUST be filled in then in your validator.xml you need to add `required' so for an integer field depends=required,integer would then cause an error message to be displayed when the submit button is pressed. -Rob Infact, the same happens when populating all the fields is this correct? Regards, Michael If the fields are blank and you hit submit then yes, the default is to go back to the main page -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: [REMINDER] --- Struts Nightly and 1.1B1 1.1B2 users
James Mitchell wrote: The only tests that are failing are in Tomcat 3.2 (but I'm hot the trail) Up to this point the 'folk lore' was that it was a bug in TC 3.2. So you think it might be in Struts/Commons code, or possible to work around it ? Give the Man a Cigar !!! -Rob -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
[REMINDER] --- Struts Nightly and 1.1B1 1.1B2 users
Were in the process of renaming, cleaning up the code and docs for our next release. As such, it is --always-- a good idea to recompile your projects against the new jar files. If you are a struts 1.1 B1 or B2 user, I Strongly encourage you to download the latest Nightly Builds. You'll get all the bug fixes and a few new features added. The more people we have banging on the Nightly builds, and submitting reproducible Bugzilla reports, the higher quality release we can give you. Also remember to update all your .tld and .xml files. Thank you for taking the time to upgrade ! -Rob -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: org.apache.struts.validator.FieldChecks missing?
Wendy Smoak wrote: I have last night's (10/5) nightly build, and when I call myValidatorForm.validate( mapping, request), I get this: SEVERE: reflection: org.apache.struts.validator.FieldChecks java.lang.ClassNotFoundException: org.apache.struts.validator.FieldChecks This seems like an obvious question, are you sure you are using the new struts.jar ? -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: problem using the 1.1b2 validator dependency feature
Eric Weidner wrote: I am running Struts 1.1b2 on Jboss 3.0.3 w/ Tomcat 4.1.12 with JDK 1.4.1 on Windows XP. Is this truely Struts 1.1B2, or a nightly ? The requiredif javascript method wasn't added until Oct 18 or so. Mixing different functionality from 1.1B2 a nightly build will get you unknown results and puzzled looks :-)! Also the date of the commons-*.jars should match the date of struts. java.lang.NullPointerException at org.apache.struts.taglib.html.JavascriptValidatorTag.doStartTag(JavascriptValidatorTag.java:297) If it is truely 1.1B2 then it died at String javascript = va.getJavascript(); I would try the nightly build. The validator code has had about 6 bugs fixed sinse B2. -Rob -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: problem using the 1.1b2 validator dependency feature
Eric Weidner wrote: Yes, this is truly 1.1b2 and that is the line that failed. I figured the requiredif was in there since the documentation mentioned it as a feature in 1.1. When downloading a struts version always refer to the version of the docs that come with that download. The docs on the web site tend to reflect functionality of the current nightly build. BTW, was one of the bugs that was fixed validating max and min length on password fields? I don't believe so, I had seen something mentioned in the news group in the last week about that. If there is a problem then file a bugzilla bug report. -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: Doc changes and 1.1
Josh Berry wrote: Second, as to the docs, I would love to help. However, I am better at proofreading then I am at most anything else. Josh, I tend to be a bad spellar and my Grammer is ain't so good either so dig in. ;-) Better docs are --always-- needed. I would suggest first cleaning up the existing docs, then once you have worked with them for a while, add additional docs. Ted Husted has done most of the care and feeding of our docs, though using the mailing list is always the best place to make comments. Finally, yes using Bugzilla with patches created by 'diff -u' is the recommended may to contribute! -Rob -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: error checking in Action
David Graham wrote: Why do you need to move error checking into an action? Why not just let the form bean do it's job and validate itself? Have you looked at using the validator? Validation belongs in the form bean; actions' main job is to direct traffic and execute business layer methods. David Agreed, For Generic type of validation the ActionForm is an appropiate place to do validation. To restate what David said, the ActionForm is designed to be passive, and have values info it needs passed to it. It should definately not make method calls to other Business Logic. To add to that,Any complex validation would take place in the Business Logic, with the Action being the go between loading and unloading the ActionForm and calling validation methods in the Business Logic. -Rob -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: [Validator] StrutsValidatorUtil.getActionError
Jerry Jalenak wrote: In the latest nightly build the StrutsValidatorUtil.getActionError method has been deprecated. I took a look at the JavaDoc but it hasn't been updated to reflect this, nor does it indicate what the new method is. Does anyone know? The JavaDoc has been updated, take a look at your struts-documentation web app. It Just wasn't updated on the Jakarta Web Site. It was renamed o.a.s.validator.Resources.getActionError() -Rob -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: Struts validator for date field
Down load the Nightly build for Oct 25, it should now work. The patch that James Turner Championed was comitted, to remove the depends=required attribute form the validator-rules.xml -Rob -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: Validator and required dependency
Comments inline, also see: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13526 Peterkofsky, Don wrote: I'm not sure of the background on this thread, but there may be some misunderstanding with this. I looked at the canned rule sets, and was confused by the use of the depends attribute in the rules file, which appears to be the same as the depends attribute in the validation file. However, my experiments showed that the required dependency in the rules file doesn't have the effect/behavior that you would assume, like the attribute in the validation file. The required dependency in the rule set did not appear to evaluate the required rule; in other words, when a rule is used in the validation file, and the rule definition has the required dependency, it does not seem to embed the required rule in the evaluation. For example, I could use the maxlength rule, and leave the form field empty, and no validation error would result. My interpretation of this is that the required dependency in the rules file has a different meaning than in the validation file, or perhaps is not used. If anyone has a better understanding or contradictory experience I'd be interested to hear and understand. Thanks for your experimentation, I had suspected something like this. In July patches were applied to the Validator that changes its behavior. Specifically it no longer ignored blank fields. I was waiting till this weekend when I get a solid block of time, so I could analyze the intent and purpose of these rules. I believe James Turner asked a similar question back in July and Dave replied that 'depends' determines if the field is evaluated individually, or all together with the form as a whole. Like I said I will take a better look at it this weekend. I am still new at using the Validator so right now what I say needs to be 'taken with a grain of salt', evaluated by considering my experience. -Rob -Original Message- From: James Turner [mailto:turner;blackbear.com] Sent: Tuesday, October 22, 2002 12:24 PM To: [EMAIL PROTECTED] Subject: Validator and required dependency At 11:33 AM 10/22/2002, Eddie Bush [EMAIL PROTECTED] wrote: Point noted :-) I'll let someone else explain what the rationale was for doing that. I don't know. I am aware that there is change taking place in commons-validator, and also in the struts-specific validator, but I couldn't really speak to what changes have been effected by that change. I don't know the original rationale, but there is a bug report and patch filed to remove the required dependency from the canned rulesets. Hopefully someone will apply it soon James -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: {Validator] Required Fields
Jerry Jalenak wrote: Has Validator changed in its use of 'required'? I pulled down the 20021008 build a couple of weeks ago, and found that Validator is now 'requiring' all of my form fields even when I don't specify the required parameter. I did a quick check in the archives but didn't see anything immediately. Has anyone else come across this? Is this fixed in a newer build? I have started fixing a few of the bugs in Validator but I am unfamilar with how it worked before. James Turner has a bug report in to remove 'required' the Bug is 13526, take a look at it. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13526 However there will need to be some changes to the basic validator-rules.xml. -Rob -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: {Validator] Required Fields
Rob Leland wrote: Jerry Jalenak wrote: Has Validator changed in its use of 'required'? I pulled down the 20021008 build a couple of weeks ago, and found that Validator is now 'requiring' all of my form fields even when I don't specify the required parameter. Looking a little further at the CVS logs a patch to the validator-rules.xml was applied on July 17 2002, that when checking for a value that changed the code from: if (!iValue || !(iValue = -128 iValue = 127)) { to if (isNaN(iValue) || !(iValue = -128 iValue = 127)) { This is done in about 8 places in the file. This could be causing the difference in behaviour, try reverting the code to !iValue. Let me us know if the behaviour returns to what it was before. -Rob -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: Struts taglibs without Struts
[EMAIL PROTECTED] wrote: The problem with trying is that whilst you can prove that some tags work, it is much harder to prove that all tags in all taglibs will work. For that you need knowledge of the architecture. Someone who had this knowledge sent me the answer. Originally, the answer was yes. I am sure struts 1.0 tags will work outside of struts. However, in 1.1 the ApplicationConfig objects were added for application modules, and so there will probably be cases where they won't work. Now that the JSTL is out, use those tags first. -Rob -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: anyone seen this startup error?
Vincent Stoessel wrote: Oct 16, 2002 2:53:00 PM org.apache.struts.validator.ValidatorPlugIn init SEVERE: null java.util.ConcurrentModificationException at This was fixed last Friday Oct 11, so download the latest nightly build, which also has other Validator fixes. -Rob -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Struts-EL contrib library
David: It seems that by default the struts-el library wants to build, I though the default was not to build ? It tries to build if there is no custom property file. I tried creating the file but setting the jstl.jar='', and it still wants to build. -Rob -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
url parameters not being copied to form bean
I'm not sure why but I have parameters that are not being copied to my form bean. The url written on the page is correct but when the link is followed only the parameter specified in the global forward (action=choose) is copied to the bean and (selected=N) is not. Surely it's a subtle error somewhere but can anyone suggest what exactly? I've successfully done this in other applications and this is the first time it's not worked. Thanks Rob I have a little something like the following to write my link. html:form action=foo nested:iterate parameter=items nested:link forward=viewitem paramId=selected paramName=ItemForm paramProperty=itemId Item nested:write property=itemId/ /nested:link /nested:iterate /html:form My form-bean looks like so: form-bean name=ItemForm type=web.ItemForm/ My global-forward looks like so: forward name=viewitem path=/do/viewitem?action=choose/ My action mapping looks like so: action path=/viewitem type=web.ItemAction name=ItemForm input=/WEB-INF/pages/chooseitem.jsp validate=true scope=session /action -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
struts 1.0.2 logging - destination fd
I've taken a quick look through the archives and haven't found what I was looking for but; Where does jakarta-struts log to by default? I've checked my container logs (tomcat 3.2.4) but I can't think of where else the output from the logging would be going. I'm using debug/verbosity level 2 in web.xml. My apologies for the simple question, perhaps it's simplicity indicates that it should be on one of the various FAQ's. Thanks Rob -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: No action instance for path /action could not be created. (solved)
The reason it was biting me was because the struts.jar was in the CLASSPATH of the user who was starting the servlet container. Better explanation here. So not obvious. http://w6.metronet.com/~wjm/tomcat/2001/Feb/msg00096.html rob wrote: This seems to be a fairly common problem and I have gone through the archives prior to posting this but have yet to discover a solution. I'm getting that common error Error 500 No action instance for path /login could be created. The difficulty I'm having is that the application was and is running perfectly fine on a tomcat 4.x servlet container. The error I'm observing are occuring under a tomcat 3.x servlet container. I'm kind of desperate here, solutions would be good. Thanks Rob struts-config.xml !-- Struts Login Form Bean -- form-bean name=LoginFormtype=web.LoginForm/ !-- Struts Login Global Forward -- forward name=login path=/do/login/ !-- Struts Login Action Mapping -- !-- leading slash on path is present -- action path=/login type=web.LoginAction name=LoginForm input=/WEB-INF/pages/login.jsp scope=request forward name=error path=/WEB-INF/pages/login.jsp/ /action web.xml !-- struts action servlet mapping -- servlet-mapping servlet-nameaction/servlet-name url-pattern/do/*/url-pattern /servlet-mapping login.jsp !-- start form tag -- !-- does not require prepended /do/ because I use -- !-- path servlet mapping -- html:form action=login WEB-INF/classes (shown to contain LoginAction.class) % ls -l webapps/manager/WEB-INF/classes/web/ total 6 -rw-r--r-- 1 rtr users 1565 Sep 11 18:58 LoginAction.class -rw-r--r-- 1 rtr users 735 Sep 11 18:58 LoginForm.class LoginAction.java /* shown to indicate class is public */ /* shown to indicate class extends Action */ % grep 'public class' LoginAction.java public class LoginAction extends Action -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Another question
If you keep your pages above WEB-INF/ it's necessary infact. I have one page ctxtroot/index.jsp that does nothing but forward the request to ctxtroot/WEB-INF/pages/login.jsp. Rob Eddie Bush wrote: accepted? I think it's probably a best practice. That's the impression I get. You can either do it through index.html or index.jsp -- makes no difference. Regards, Eddie Mark Kaye wrote: Is it accepted practice to have /index.html redirect to an action in order to kick off the application from initial session creation? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Dynamic number of form fields
There was a good tutorial on this possibly linked from the struts page titled Monkey Struts. I found it to be quite good, very easy to follow. David Graham wrote: I want to have a form with a variable number of input boxes. For example, a simple edit person form that has a first name and last name input box for each person in your db. So the first set would be named firstName_12 lastName_12, the second set might be firstName_45623 and lastName_45623. The number after the underscore is the personID from the db table. When the form is submitted you loop over these fields and update the appropriate row in the database from the _ID info. I've read through the docs on DynaBeans and that seems like the way to go but I'm still not sure how to go about this. When populating the DynaFormBean, does struts just go through the request params and assign them to new form properties? How would you validate this type of form? Advice and links to info are appreciated. Thanks, Dave _ Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [Struts Tip] # 10 Use Struts JSP Tags to create dynamic JavaScripts
Ted Husted wrote: For more see http://husted.com/struts/tips/010.html Ted, I got File not found 404 when clicking on this link. -Rob -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Directories and Files structure for sub applications
Does anyone have a best practices suggestion for how to organize the directory and files structure for a Struts application composed of sub applications? I don't know if there is a best practices yet. Here is what I have done. Our source tree looks much like the struts source tree src/ java/ test/ web/ portal/ module/ catalog/ - application module (sub-app) src/ java/ test/ web/ portal/ catalog/ WEB-INF/ struts-catalog.xml tld/ catalog.tld So the modules tends to be grouped together. What we really need though is a generic build-module.xml I started to modify the struts build-webapp.xml a few months ago, but never had time to finish it. Heligon Sandra wrote: Does anyone have a best practices suggestion for how to organize the directory and files structure for a Struts application composed of sub applications? Where the different strus-config files, application resources files, common JSP views have to be placed ? Thanks a lot. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]