Must specify type attribute if name is specified error
Hi I have the following exception : javax.servlet.ServletException: Must specify type attribute if name is specified when I insert a name parameter to my html:form as shown here. html:form action=Aliquot.do name=aliquotForm The reason for the name is for my javascript. Why is it throwing this exception? I can't even find 'type' in the struts javadoc for html:form. Thanks Sebastian Ho - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to validate the indexed properties using the vaildation framework ?
Hi, Can anybody please help on this issue. Regds Ravi -Original Message- From: Vasu Johnson [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 28, 2004 6:33 PM To: Struts Users Mailing List Subject: Re: How to validate the indexed properties using the vaildation framework ? After browsing through the struts archives, I have done the following changes to validation.xml. form name=beanForm field property=bd indexedListProperty=lines depends=required arg0 name=required key=${var:bp} resource=false/ var var-namebp/var-name var-valuebp/var-value /var /field /form No exceptions thrown, but the error is not getting fired. Not sure what could be the issue. Can someone help me please. Rick, can you pls help me. Regds Vasu Johnson Vasu Johnson [EMAIL PROTECTED] wrote: Hi, I am using DynaValidatorForm. The entry in my struts-config.xml looks like : Where, the Line class looks : public class Line { private String bId; private String dId; } bId and dId are actually drop downs on the UI. Basically, when the jsp loads, the drop down will be filled with data. Now the requirement is, if the user do not select any item of both the drop-downs, I need to tell the user to select atleast one item in each of the drop-downs. The issue is, how to give the entry in validation.xml ? I tried giving the following, but it didnt work : property=lines.bId depends=required bp bp property=lines.dd depends=required dp dp Can anybody help me how to solve this problem ? I had been struggling for almost a day on this. Yahoo! India Matrimony: Find your life partneronline. Yahoo! India Matrimony: Find your life partneronline. Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: struts and oracle
Dante - you can just swap out the shipped 1.1 version of Struts with the 1.2.4 distribution - see the article http://www.oracle.com/technology/products/jdev/tips/mills/struts1_2_1.html The version numbers need updating but it should be the same with 1.2.4 Duncan Mills --- Original Message --- Hi all, I hope this is the right m.l. for this post. I was wondering why Oracle Application Server/JDeveloper is not supported by Struts 1.2.4. We are planning to use struts for a couple of year project and we are worried about struts future development strategies and containers integration. So I ask: do you foresee to support Oracle A.S. in the near future? If the answer is negative, do you continue supporting IBM WebSphere or do you suggest any other A.S.? Your answers will be precious in driving our technology decisions. Thank you very much -- Dante Profeta - 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: Must specify type attribute if name is specified error
For the tag html:form, the attribute name, type and scope have been removed from Struts 1.2, they were deprecated in 1.1. They have been used to override the action mapping in the struts-config.xml file between an action and its form-bean. The name of the form element in the resulting HTML page will have the name of the form bean related to the action and there is no way to change it. So if you want to reference it in JavaScript, use its form bean name. Anyway in your code there is an error. You have to rewrite it this way: html:form action=/Aliquot .. /html:form Ciao Antonio Petrelli Sebastian Ho wrote: Hi I have the following exception : javax.servlet.ServletException: Must specify type attribute if name is specified when I insert a name parameter to my html:form as shown here. html:form action=Aliquot.do name=aliquotForm The reason for the name is for my javascript. Why is it throwing this exception? I can't even find 'type' in the struts javadoc for html:form. Thanks Sebastian Ho - 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: Search engine friendly URLs
There's a filter that does URL rewriting already, urlrewrite , mod_rewrite would be okay but who wants to run mod_jk - apache as his/her development environments. http://tuckey.org/urlrewrite/ The only problem then is generating the links. so rather than html:link page=/action.do .. you'd use something like.. c:url var=link value=/action.do c:param name=name value=somevalue / .. and so on /c:url this will render to /appname/action.do?name=somevalue so now lets say you've set a boolean called cleanURL, this means you can switch the functionality off if you want to deactivated urlrewrite during development. An init param in web.xml i suggest would be the best place, but for now lets set in the page. c:set var=cleanURL value=true /' c:if test=${cleanURL} c:forTokens var=badChar items=?, delims=, c:set var=cleanLink value=${fn:replace(link,badChar,'/'}'' / c:set var=link value=${cleanLink} / /c:forTokens /c:if a href=${link}Link/a Once you've set urlrewrite filter up you'll want something like this. rule from/action.do/*/*/from to type=redirect/action.do?$1=$2/to /rule HTH Mark On 2 Oct 2004, at 17:59, David G. Friedman wrote: You should be able to do with in 1.2.4 with WildCard mapping, see section 4.10 - Using Wildcards in Action Mappings. http://struts.apache.org/userGuide/building_controller.html Regards, David -Original Message- From: Ben [mailto:[EMAIL PROTECTED] Sent: Saturday, October 02, 2004 11:53 AM To: Struts; Tomcat Subject: Search engine friendly URLs Hi Is it possible to make the URLs on my site search engine friendly? I am using Tomcat and Struts. I would like to turn: http://localhost/site.do?section=bookssubsection=architecture into this: http://localhost/do/site/books/architecture Regards, Ben - 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]
Is it possible to call a dispatchAction form an Action ?
Hi, I have a form that is submited to a DispatchAction and work very well. But I would like to reuse this DispatchAction and call it from another Action. Is it possible to do that ? I found nothing that indicate me how to pass the parameter value... Any Idea ? Yves-Marie * Tout usage de ce message par une personne autre que son destinataire est strictement interdit. L'integrite de ce message n'etant pas assuree sur Internet, Le groupement des Mousquetaires ne peut etre tenu responsable de son contenu. Toute utilisation ou diffusion non autorisee est interdite. Si vous n'etes pas destinataire de ce message, merci de le detruire et d'avertir l'expediteur * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Loosing session while redirecting
Hello evelyone, I'm facing the following problem. I try to switch from http to https using forward tags in the struts-config.xml forward name=standard redirect=true path=http://pc:8989/cdn-data-new/tvmode.jsp/ forward name=secure redirect=true path=https://pc:8989/cdn-data-new/tvmode.jsp/ In the Action class I use : return mapping.findForward(standard); Everything works fine up to here. When the redirection has been completed I have lost the session. At first I thought that switching form http to https and vice versa causes the problem, but I noticed that the same thing happens when I use the same protocol, http and use redirect. It is a critical problem for my project and I would appriciated if you could help me. Thank you in advance Konstantina - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mailreader sample question
Sorry, I think you are using a more recent version of Struts than I have. Perhaps someone else can help. Erik Richard wrote: Thanks Erik, I am already at that point now. the link from the web page points to http://localhost:8080/struts-mailreader/EditRegistration.do?action=Edit and at struts-config-registration.xml... actionpath=/Edit* type=org.apache.struts.webapp.example.Edit{1}Action name={1}Form scope=request validate=false forward name=success path=/{1}.jsp/ /action it points to editregistrationaction.java. Now in editregistrationaction.java i dont see anything that might have populate the subscriptions? On Tue, 05 Oct 2004 01:47:41 -0400, Erik Weber [EMAIL PROTECTED] wrote: Look at the form action URL. Use that to look up the handlers for that form in struts-config.xml. Submittals to /saveSubscription are handled by org.apache.struts.webapp.example.SaveSubscriptionAction, while submittals to /editSubscription are handled by org.apache.struts.webapp.example.EditSubscriptionAction. Hope that helps. Erik Richard wrote: hello guys i am studying the mailreader sample that comes with the struts binary ed. I cant seem to figure out where ( what form actions ) the records are being retrieved when you edit your subscriptions. thank is advance. richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Best load testing tool for Java applications
If I only have 1 machine and I want to approximate best maximum load on struts application on the line I have, what can I do?? Ok, so the result will likely be under estimated ( i.e. less than real maximum load due to same cpu running both application and test) but it's better to under estimate than over estimate. Thanks - Original Message - From: Craig McClanahan [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, October 05, 2004 1:00 PM Subject: Re: Best load testing tool for Java applications You can run JMeter on the same machine as your server if you like, but it's pretty likely to influence your results due to the resource requirements of the test application itself. I wouldn't use any performance testing tool on the same machine, for that reason. Unit tests and system integration tests, of course, are a different story. Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ActionError and JSP display
Hi, Platorm is : Tomcat 5, Struts 1.1 Context: HTML Form submissions and validation. I'm trying to conditionally test for the existince of error messages by their keys. And I'd then like to show the error with HTML formatting around it. Basically, using tags, I'd like to do the same as the following following pseudo code. if (errorMessage named 'usernameError' exists) { showError('usernameError' + some html) } The error message is set from within the Form class as: errors.add(usernameError, new ActionError(errors.form.username.required)); I've been trawling around and have found lots of references to logic:messagesPresent and then looping through each message using html:messages but not a test for the existence of a particular message. I'm trying to display the error message next to each appropriate form element rather than in a list. I probably can't see the solution for looking. Can anyone help? Many thanks Robin This e-mail and any attachments may be confidential and/or legally privileged. If you have received this e-mail and you are not a named addressee, please inform Landmark Information Group on 01491 413030 and then delete the e-mail from your system. If you are not a named addressee you must not use, disclose, distribute, copy, print or rely on this e-mail. This email and any attachments have been scanned for viruses and to the best of our knowledge are clean. To ensure regulatory compliance and for the protection of our clients and business, we may monitor and read e-mails sent to and from our servers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ActionError and JSP display
Robin Mannering wrote: Hi, Platorm is : Tomcat 5, Struts 1.1 Context: HTML Form submissions and validation. I'm trying to conditionally test for the existince of error messages by their keys. And I'd then like to show the error with HTML formatting around it. Basically, using tags, I'd like to do the same as the following following pseudo code. if (errorMessage named 'usernameError' exists) { showError('usernameError' + some html) } The error message is set from within the Form class as: errors.add(usernameError, new ActionError(errors.form.username.required)); I've been trawling around and have found lots of references to logic:messagesPresent and then looping through each message using html:messages but not a test for the existence of a particular message. I'm trying to display the error message next to each appropriate form element rather than in a list. I probably can't see the solution for looking. Can anyone help? Many thanks Robin Read http://struts.apache.org/api/org/apache/struts/taglib/html/package-summary.html#doc.Other.errors, paying attention to the property attribute of html:errors -- Jeff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: ActionError and JSP display
Hi, I was intending to use html:errors property=username/, specifying the property for display, but it still doesn't allow me to test for it's existence. What I'd like to do is test if an error exists, then add a new HTML table row and cell into the output containing the error message, otherwise I do not want to create the HTML table row and cell at all. Is there a way to do this ? Thanks Robin -Original Message- From: news [mailto:[EMAIL PROTECTED] Behalf Of Jeff Beal Sent: 05 October 2004 13:40 To: [EMAIL PROTECTED] Subject: Re: ActionError and JSP display Robin Mannering wrote: Hi, Platorm is : Tomcat 5, Struts 1.1 Context: HTML Form submissions and validation. I'm trying to conditionally test for the existince of error messages by their keys. And I'd then like to show the error with HTML formatting around it. Basically, using tags, I'd like to do the same as the following following pseudo code. if (errorMessage named 'usernameError' exists) { showError('usernameError' + some html) } The error message is set from within the Form class as: errors.add(usernameError, new ActionError(errors.form.username.required)); I've been trawling around and have found lots of references to logic:messagesPresent and then looping through each message using html:messages but not a test for the existence of a particular message. I'm trying to display the error message next to each appropriate form element rather than in a list. I probably can't see the solution for looking. Can anyone help? Many thanks Robin Read http://struts.apache.org/api/org/apache/struts/taglib/html/package-summary.html#doc.Other.errors, paying attention to the property attribute of html:errors -- Jeff This e-mail and any attachments may be confidential and/or legally privileged. If you have received this e-mail and you are not a named addressee, please inform Landmark Information Group on 01491 413030 and then delete the e-mail from your system. If you are not a named addressee you must not use, disclose, distribute, copy, print or rely on this e-mail. This email and any attachments have been scanned for viruses and to the best of our knowledge are clean. To ensure regulatory compliance and for the protection of our clients and business, we may monitor and read e-mails sent to and from our servers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
textbox format date i18n date handling
Multiple related questions: 1) I have a java.util.Date field that needs to be displayed in a textbox. In bean:write there are formatting methods to have the date display using a MM/dd/ for example. however I don't see the same for html:text. I'm sure there's a way I'm not seeing... I tried putting the bean:write in between the html:text tags hoping it would render the formatted date but I couldn't write html:text with no property item and using an empty space didn't work. I was thinking about using a ConvertUtils String and Date conversion methods to only show the format that I wanted in this case but these are static methods and I can say for certain that there will be a case where I would want the Date formatted with the time portion as well. 2) We have an i18n app where the date should be displayed/set as used locally. The ConvertUtils method again would restrict to one date format so what I am thinking for i18n is to populate it into a hidden field (US Format always) and use javascript to do the formatting for the user view and to update the hidden field again so struts only needs to worry about one date format on submit. Seems like a lot of work though, I would think other's have run into this as well. What's the better solution that I'm not seeing? Thanks for your assistance. Regards...djsuarez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem parsing validation-rules depends= with jboss
Erik Weber wrote the following on 10/5/2004 1:36 AM: Zoinks, JBoss 3.2.4 (on unix) and 3.2.5 (on win 2000) have been able to parse the default validator-rules.xml (version 1.1, which has several 'depends=') for me without any problems. However, I did run into some problems with parsing errors on hot redeploys, but never could discover a pattern to them. I don't recall seeing your particular error. One thing I discovered that helped in my case was to invalidate any existing sessions before a hot redeploy. Sorry to be of little help. Are you sure that is a parsing error? No, I'm not sure at all:) Let me look into some more things today. I wonder if maybe it's using a cached version of an invalid rules file that I had replaced but I never cleared out the temp directory. I'll try that when I get to work. Thanks for the help. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Missing resources - Struts 1.2.4 + Validator + Multiple Modules
Hi, I have a Struts 1.2.4 application with multiple modules. I am using the Struts Validator plugin to validate my forms. I have defined the Validator plugin in the default Struts config file as well as the module specific struts config file. The validator-rules.xml file is common across all modules. I am using separate validation.xml files for each module. I am also using separate message resources for each module (saved under different keys) along with the default message resources. In one of my modules, the validation.xml file contains the following form definition... form name=someForm field property=someProperty depends=required arg position=0 bundle=resources.moduleX key=label.someProperty / /field /form label.someProperty is defined as 'Some Property' in the resource bundle resources.moduleX Now when this form is submitted without specifying any value for the property 'someProperty'. I expect to see a message 'Some Property is required'. But all I see is 'is required'. The resource is not being fetched. The Validator developer guide in the Struts documentation says... -- Note that as of the Struts 1.1 release, you must explicitly define your message resource in any module that is going to use the Validator, due to a problem accessing the top-level resource. This only effects applications which are using modules. -- I take this to mean that message resources (stored under the default bundle key) must be defined in every module. And if my 'arg' element didn't specify a 'bundle' attribute, the resource would be keyed out of the default resource bundle. This also means that the 'bundle' attribute in the 'arg' element doesn't work as it should. A Bug? Can someone through some light one this. Am I doing something wrong. Regards, Akbar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: ActionError and JSP display
At 1:45 PM +0100 10/5/04, Robin Mannering wrote: Hi, I was intending to use html:errors property=username/, specifying the property for display, but it still doesn't allow me to test for it's existence. What I'd like to do is test if an error exists, then add a new HTML table row and cell into the output containing the error message, otherwise I do not want to create the HTML table row and cell at all. Is there a way to do this ? Personally, I think html:errors is the old way, although at least one committer has expressed a preference for it. I prefer html:messages It is essentially a combination conditional block and iterator. Here is my standard error messages JSP block: html:messages id=msgdiv class=errorc:out value=${msg} //div/html:messages By default, it looks for an ActionMessages object saved using Struts' saveErrors semantics (that is, stored in the request under org.apache.struts.action.ERROR You can set the message attribute to true to get messages instead, and you can set the name attribute to fetch any arbitrary ActionMessages. Furthermore, you can use the property attribute to constrain the condition to only if the ActionMessages contains messages for the given property. If you're not using the JSTL, you can use bean:write instead of c:out to display the message itself. And, of course, you can use table rows instead of divs to wrap each message provided by the iterator. http://struts.apache.org/userGuide/struts-html.html#messages Hope this helps... Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com In fact, when I die, if I don't hear 'A Love Supreme,' I'll turn back; I'll know I'm in the wrong place. - Carlos Santana
RE: ActionError and JSP display
Try: c:set var=usernameError html:errors property=username/ /c:set c:if test=${usernameError != null} trtdc:out value=${usernameError}//td/tr /c:if Or something similar. Paul -Original Message- From: Robin Mannering [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 05, 2004 1:45 PM To: Struts Users Mailing List Subject: RE: ActionError and JSP display Hi, I was intending to use html:errors property=username/, specifying the property for display, but it still doesn't allow me to test for it's existence. What I'd like to do is test if an error exists, then add a new HTML table row and cell into the output containing the error message, otherwise I do not want to create the HTML table row and cell at all. Is there a way to do this ? Thanks Robin -Original Message- From: news [mailto:[EMAIL PROTECTED] Behalf Of Jeff Beal Sent: 05 October 2004 13:40 To: [EMAIL PROTECTED] Subject: Re: ActionError and JSP display Robin Mannering wrote: Hi, Platorm is : Tomcat 5, Struts 1.1 Context: HTML Form submissions and validation. I'm trying to conditionally test for the existince of error messages by their keys. And I'd then like to show the error with HTML formatting around it. Basically, using tags, I'd like to do the same as the following following pseudo code. if (errorMessage named 'usernameError' exists) { showError('usernameError' + some html) } The error message is set from within the Form class as: errors.add(usernameError, new ActionError(errors.form.username.required)); I've been trawling around and have found lots of references to logic:messagesPresent and then looping through each message using html:messages but not a test for the existence of a particular message. I'm trying to display the error message next to each appropriate form element rather than in a list. I probably can't see the solution for looking. Can anyone help? Many thanks Robin Read http://struts.apache.org/api/org/apache/struts/taglib/html/pac kage-summary.html#doc.Other.errors, paying attention to the property attribute of html:errors -- Jeff This e-mail and any attachments may be confidential and/or legally privileged. If you have received this e-mail and you are not a named addressee, please inform Landmark Information Group on 01491 413030 and then delete the e-mail from your system. If you are not a named addressee you must not use, disclose, distribute, copy, print or rely on this e-mail. This email and any attachments have been scanned for viruses and to the best of our knowledge are clean. To ensure regulatory compliance and for the protection of our clients and business, we may monitor and read e-mails sent to and from our servers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How To Upload Files from Clients' Machine?
You can look at the struts example struts-upload.war (I think that is the name in the examples directory) for how to do this. Basically you want to make your form something like this: html:form action=uploadData.do enctype=multipart/form-data html:file property=filename / /html:form You will of course need an actionForm and an action class. The action form would have code such as Public class uploadDataForm extends ActionForm { protected FormFile filename; public FormFile getFilename() { return filename; } public setFilename(FormFile filename) { this.filename = filename; } } and in the action class public class UploadDataAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { UploadDataForm dataForm = (UploadDataForm) form; FormFile file = dataForm.getFilename(); String filename = file.getFileName(); try { //retrieve the file data ByteArrayOutputStream baos = new ByteArrayOutputStream(); InputStream stream = file.getInputStream(); byte[] buffer = new byte[8192]; int bytesRead = 0; while ((bytesRead = stream.read(buffer, 0, 8192)) != -1) { baos.write(buffer, 0, bytesRead); } //close the stream stream.close(); // You now have the file in a ByteArrayOutputStream and you can do // something with it } catch (FileNotFoundException fnfe) { return null; } catch (IOException ioe) { return null; } } HTH, Al -Original Message- From: Caroline Jen [mailto:[EMAIL PROTECTED] Sent: Monday, October 04, 2004 4:51 PM To: [EMAIL PROTECTED] Subject: How To Upload Files from Clients' Machine? In my JSP I have this: code: --- input type=file name=filename --- for visitors of the web page to browse their PCs' directories to select a file to upload (when the Submit button is clicked). The files can be .doc, .txt, .pdf, .jpg, ..., etc. However, I do not have to convert files into certain format. I simply retrieve them from clients' machine and store them into a database. Later on, clients can ask to view those files in their original format. What appears in the text field: input type=file name=filename will be a file name. How do I get both the file name and the content of that file to be saved in the database? ___ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[validator] dependent field
Consider two fields, type and time. The first mandatory, the second dependent on the value of the first. What I'm trying to do enforce a not null and not empty value for the time field, when the type has a value of 'time'. I've been trying to do this for more than an hour; I was hoping someone can spot my error as i have become really unproductive here :-) Below I have both my generated validator.xml fragment and my webdoclet tags. Please let me know whats wrong with either! type field @struts.validator type=required msgkey=error.form.eauction.type time field @struts.validator type=minlength arg1value=${var:minlength} @struts.validator type=validwhen @struts.validator-args arg0resource=error.form.eauction.time @struts.validator-var name=minlength value=1 @struts.validator-var name=test value=((type != 'time') or (*this* != null)) And my XML fragment: field property=type depends=required msg name=required key=error.form.eauction.type/ arg0 key=auctionDefinitionForm.type/ /field field property=time depends=minlength,validwhen arg0 key=error.form.eauction.time / arg1 name=minlength key=${var:minlength} resource=false / var var-nameminlength/var-name var-value1/var-value /var var var-nametest/var-name var-value((type != 'time') or (*this* != null))/var-value /var /field - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: ActionError and JSP display
Thanks for all the help received on this one.. As pointed out by Joe, the html:messages tag is conditional, and when supplying the parameter atribute I get exactly what I need. For reference, it looks like this: %-- Display error message keyed under 'usernameError' if it exists --% html:messages id=error property=usernameError tr td/td td${error}/td /tr /html:messages Thanks again all! -Original Message- From: Joe Germuska [mailto:[EMAIL PROTECTED] Sent: 05 October 2004 14:00 To: Struts Users Mailing List Subject: RE: ActionError and JSP display At 1:45 PM +0100 10/5/04, Robin Mannering wrote: Hi, I was intending to use html:errors property=username/, specifying the property for display, but it still doesn't allow me to test for it's existence. What I'd like to do is test if an error exists, then add a new HTML table row and cell into the output containing the error message, otherwise I do not want to create the HTML table row and cell at all. Is there a way to do this ? Personally, I think html:errors is the old way, although at least one committer has expressed a preference for it. I prefer html:messages It is essentially a combination conditional block and iterator. Here is my standard error messages JSP block: html:messages id=msgdiv class=errorc:out value=${msg} //div/html:messages By default, it looks for an ActionMessages object saved using Struts' saveErrors semantics (that is, stored in the request under org.apache.struts.action.ERROR You can set the message attribute to true to get messages instead, and you can set the name attribute to fetch any arbitrary ActionMessages. Furthermore, you can use the property attribute to constrain the condition to only if the ActionMessages contains messages for the given property. If you're not using the JSTL, you can use bean:write instead of c:out to display the message itself. And, of course, you can use table rows instead of divs to wrap each message provided by the iterator. http://struts.apache.org/userGuide/struts-html.html#messages Hope this helps... Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com In fact, when I die, if I don't hear 'A Love Supreme,' I'll turn back; I'll know I'm in the wrong place. - Carlos Santana This e-mail and any attachments may be confidential and/or legally privileged. If you have received this e-mail and you are not a named addressee, please inform Landmark Information Group on 01491 413030 and then delete the e-mail from your system. If you are not a named addressee you must not use, disclose, distribute, copy, print or rely on this e-mail. This email and any attachments have been scanned for viruses and to the best of our knowledge are clean. To ensure regulatory compliance and for the protection of our clients and business, we may monitor and read e-mails sent to and from our servers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: back button
andy wix wrote: Hi, As usual I think I must be missing something fundamental! It would be pretty serious to leave the back functionality - someone could delete a contact, then press back and see the name again. If they subsequently do another delete, there's trouble! I'm thinking this problem is not simply due to the caching - if I loaded the page from the db each time the browser would still have its own copy of what-was-once there. I think this must be a problem which occurs in many projects? Regards, Andy _ Want to block unwanted pop-ups? Download the free MSN Toolbar now! http://toolbar.msn.co.uk/ Have a look at http://www.useit.com/alertbox/990530.html. The author (Jakob Nielsen) is a web usability expert and placed breaking the back button as the number one mistake in web design (as of 1999). His reasoning is that the back button is the second most frequently used feature on the web (behind the hyperlink itself) and that web designers who use any of several mechanisms to prevent users from accessing that functionality are annoying and perturbing their users. Speaking specifically to the point of showing out-of-date data, Mr. Nielsen is of the opinion that backtracking should be instantaneous - i.e., should not cause a refresh to the server. As I mentioned before, there are always exceptions to this rule. The application I am developing, for example, is a commercial application. The only people who use it are our employees and our clients (who pay us money). We have a high degree of control over the end users' environments and train all of the users on how to use the application. It's more of a traditional desktop application than a web application, it's just using HTML as the user interface instead of Swing. We hide all of the browser chrome, maximize the window, and disable all standard browser shortcuts using IE-specific JavaScript. One of the most important principles in usability design is to do what the user expects. In our application, we train our users on what to expect from our application and provide visual reminders by hiding the browser chrome. They know they are not in a stanard Web environment. If you can't do that, I think you should allow their browser to do what their browser usually does. Regardless of which approach you use, your server-side application *always* needs to be robust enough to handle invalid requests. If a user attempts to delete something that has already been deleted or add something that has already been added, you should simply provide them with a friendly message that they or somebody else already did that, and the token mechanism seems to be a good solution to all of those potential problems. Just my two cents, -- Jeff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ActionError and JSP display
Robin Mannering wrote: Thanks for all the help received on this one.. As pointed out by Joe, the html:messages tag is conditional, and when supplying the parameter atribute I get exactly what I need. For reference, it looks like this: %-- Display error message keyed under 'usernameError' if it exists --% html:messages id=error property=usernameError tr td/td td${error}/td /tr /html:messages Thanks again all! -Original Message- From: Joe Germuska [mailto:[EMAIL PROTECTED] Sent: 05 October 2004 14:00 To: Struts Users Mailing List Subject: RE: ActionError and JSP display At 1:45 PM +0100 10/5/04, Robin Mannering wrote: Hi, I was intending to use html:errors property=username/, specifying the property for display, but it still doesn't allow me to test for it's existence. What I'd like to do is test if an error exists, then add a new HTML table row and cell into the output containing the error message, otherwise I do not want to create the HTML table row and cell at all. Is there a way to do this ? Personally, I think html:errors is the old way, although at least one committer has expressed a preference for it. I prefer html:messages It is essentially a combination conditional block and iterator. Here is my standard error messages JSP block: html:messages id=msgdiv class=errorc:out value=${msg} //div/html:messages By default, it looks for an ActionMessages object saved using Struts' saveErrors semantics (that is, stored in the request under org.apache.struts.action.ERROR You can set the message attribute to true to get messages instead, and you can set the name attribute to fetch any arbitrary ActionMessages. Furthermore, you can use the property attribute to constrain the condition to only if the ActionMessages contains messages for the given property. If you're not using the JSTL, you can use bean:write instead of c:out to display the message itself. And, of course, you can use table rows instead of divs to wrap each message provided by the iterator. http://struts.apache.org/userGuide/struts-html.html#messages Hope this helps... Joe There's also the logic:messagesPresent/ tag that takes a property attribute: http://struts.apache.org/userGuide/struts-logic.html#messagesPresent - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to iterate through Validator errors only in JSP?
Hi This is rather wordy, but a probably a simple question, so please bear with me! All using Struts 1.2 I have an ActionForward execute method which creates and populates an ActionMessages object. The ActionMessage objects that I populate it with are given the property of violation, and the key error.wizard.workflow.violation. This works fine - Code snippet below: --- ActionMessages errors = new ActionMessages(); if (null != WorkflowUtils.getNextStateViolationAction(request)) { errors.add(violation, new ActionMessage(error.wizard.workflow.violation)); saveErrors(request, errors); } --- To display these contents of this ActionMessages object, I use the following snippet of code (which also works fine): --- p logic:messagesPresent property=violation bean:message key=wizardForm.violation.errors.header/ ul html:messages id=violation libean:write name=violation//li /html:messages /ulhr /logic:messagesPresent /p --- My code uses an ValidatorForm to gain the use of the Struts Validator. This (again!) works fine, but what I'm stuck on is how to display the errors only found by the Validator - not those errors which I have added to my ActionMessages object (ie, not those with the property of violation). If I use the following code snippet in my JSP, then messages from both the Validator and my ActionMessages object are written to the page in the same place (which is not what I want): --- p logic:messagesPresent bean:message key=wizardForm.validation.errors.header/ ul html:messages id=violation libean:write name=violation//li /html:messages /ulhr /logic:messagesPresent /p --- I guess what would be ideal is a property= value for the Struts Validator messages, but I can't seem to find one referenced or online. Please could someone suggest a solution, or point me at online resource which would answer my query? Many Thanks, Mark. __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Loosing session while redirecting
I don't know any reason why a redirect should be the cause of session breaking, though I admit I haven't used a redirect from HTTP to HTTPS in the middle of a user's workflow (only at the very beginning -- by using the CONFIDENTIAL transport-guarantee in web.xml). Is your test browser accepting cookies? Or, are your links generated in such a way (either with Struts tags, or by using response.encodeURL directly) that a session can be tracked without cookies? Erik Konstantina Stamopoulou wrote: Hello evelyone, I'm facing the following problem. I try to switch from http to https using forward tags in the struts-config.xml forward name=standard redirect=true path=http://pc:8989/cdn-data-new/tvmode.jsp/ forward name=secure redirect=true path=https://pc:8989/cdn-data-new/tvmode.jsp/ In the Action class I use : return mapping.findForward(standard); Everything works fine up to here. When the redirection has been completed I have lost the session. At first I thought that switching form http to https and vice versa causes the problem, but I noticed that the same thing happens when I use the same protocol, http and use redirect. It is a critical problem for my project and I would appriciated if you could help me. Thank you in advance Konstantina - 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 submit buttons on a form
Hello Everyone, I have this problem. I have several submit buttons on a form and I am using a modified version of LookupDispatchAction class. Is there any way for the buttons to have the same name instead of having separate names as required by LookupDispatchAction. I also want internationalization to be taken care of. Any help would be appreciated. Thanks. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: multiple submit buttons on a form
Lucky you, Struts Lover, this has already been done. See http://wiki.apache.org/struts/StrutsCatalogVariousButtonSolutions . You can get everything you want without the incredibly heavy load of having LookupDispatchAction create a reverse map of your entire ApplicationResource.properties file. With the solutions in this reference, the name values for (new) DispatchAction are completely decoupled from the dispatch functionality, leaving you free to do whatever you want to do with the names, and without configuring struts-config.xml. What more could you ask? LOL Michael McGrady struts lover wrote: Hello Everyone, I have this problem. I have several submit buttons on a form and I am using a modified version of LookupDispatchAction class. Is there any way for the buttons to have the same name instead of having separate names as required by LookupDispatchAction. I also want internationalization to be taken care of. Any help would be appreciated. Thanks. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] . - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Load-on-startup init servlet
I am trying to set up a start up sequence for my app but I have never set up something like that. Basically I want to initialize some classes with attributes found in my resources file. How would I go about doing this? I set up my web.xml file to load a servlet on startup, but I am not sure how I am supposed to get to the message resources that are loaded in the ActionServlet. I know I saw this done before but I can't remember how it was set up. Thanks. Denis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: multiple submit buttons on a form
Thanks Michael very much. I will go through it. If I dont understand anything, will come back :). Thanks again. --- Michael McGrady [EMAIL PROTECTED] wrote: Lucky you, Struts Lover, this has already been done. See http://wiki.apache.org/struts/StrutsCatalogVariousButtonSolutions . You can get everything you want without the incredibly heavy load of having LookupDispatchAction create a reverse map of your entire ApplicationResource.properties file. With the solutions in this reference, the name values for (new) DispatchAction are completely decoupled from the dispatch functionality, leaving you free to do whatever you want to do with the names, and without configuring struts-config.xml. What more could you ask? LOL Michael McGrady struts lover wrote: Hello Everyone, I have this problem. I have several submit buttons on a form and I am using a modified version of LookupDispatchAction class. Is there any way for the buttons to have the same name instead of having separate names as required by LookupDispatchAction. I also want internationalization to be taken care of. Any help would be appreciated. Thanks. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] . - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail is new and improved - Check it out! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: multiple submit buttons on a form
http://wiki.apache.org/struts/StrutsCatalogVariousButtonSolutions Mike, why not link directly to the Struts related stuff from the wiki. Or are you trying to drum up business for your flash skills? ;) - Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: multiple submit buttons on a form
1. He authored that WIKI and 2. That WIKI now directly links to his homepage, so why make the OP suffer redirection? Dennis Durham David R Jr Contr 805 CSPTS/SCE [EMAIL PROTECTED] 10/05/2004 10:24 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To Struts Users Mailing List [EMAIL PROTECTED] cc Subject RE: multiple submit buttons on a form http://wiki.apache.org/struts/StrutsCatalogVariousButtonSolutions Mike, why not link directly to the Struts related stuff from the wiki. Or are you trying to drum up business for your flash skills? ;) - Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: multiple submit buttons on a form
LOL :)) --- Durham David R Jr Contr 805 CSPTS/SCE [EMAIL PROTECTED] wrote: http://wiki.apache.org/struts/StrutsCatalogVariousButtonSolutions Mike, why not link directly to the Struts related stuff from the wiki. Or are you trying to drum up business for your flash skills? ;) - Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: multiple submit buttons on a form
Hi, David, that is a good question, which Steve Raeburn once solved by changing the link. The reason is that I may want to change this page without having to go to every place it is linked to do so. Just decoupling, as they say. In fact, since Steve changed the link, I have changed the page. I want to be able to do so again without inconveniencing anyone. Michael McGrady ///;-) P.S. I have no Flash skills. That is the work of a friend. I do use a Java program that rewrites image files to Flash, which I intend to use as a photo application because of the superior functionality in that arena you can get from vector mathematics. Durham David R Jr Contr 805 CSPTS/SCE wrote: http://wiki.apache.org/struts/StrutsCatalogVariousButtonSolutions Mike, why not link directly to the Struts related stuff from the wiki. Or are you trying to drum up business for your flash skills? ;) - Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: multiple submit buttons on a form
Never mind, I misread Davids post. Dennis [EMAIL PROTECTED] 10/05/2004 10:31 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To Struts Users Mailing List [EMAIL PROTECTED] cc Subject RE: multiple submit buttons on a form 1. He authored that WIKI and 2. That WIKI now directly links to his homepage, so why make the OP suffer redirection? Dennis Durham David R Jr Contr 805 CSPTS/SCE [EMAIL PROTECTED] 10/05/2004 10:24 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To Struts Users Mailing List [EMAIL PROTECTED] cc Subject RE: multiple submit buttons on a form http://wiki.apache.org/struts/StrutsCatalogVariousButtonSolutions Mike, why not link directly to the Struts related stuff from the wiki. Or are you trying to drum up business for your flash skills? ;) - Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Load-on-startup init servlet
MessageResources res = MessageResources.getMessageResources(ApplicationResources); If you are using the property file name ApplicationResources in the root folder. In the init method of the servlet that you are loading at startup, you can do whatever you want. public void init(ServletConfig config) throws ServletException { --- Denis Avdic [EMAIL PROTECTED] wrote: I am trying to set up a start up sequence for my app but I have never set up something like that. Basically I want to initialize some classes with attributes found in my resources file. How would I go about doing this? I set up my web.xml file to load a servlet on startup, but I am not sure how I am supposed to get to the message resources that are loaded in the ActionServlet. I know I saw this done before but I can't remember how it was set up. Thanks. Denis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] RE: multiple submit buttons on a form
The reason is that I may want to change this page without having to go to every place it is linked to do so. Does that qualify as a splash screen? HA HA - Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Load-on-startup init servlet
So I can call MessageResources.getMessageResources(blah) in the init() method? Is there an order I have to load the servlets in web.xml in order for that to work? (if I remember correctly, ActionServlet actually loads those resources, right?) On Tue, 5 Oct 2004 07:49:02 -0700 (PDT), Varun Garg [EMAIL PROTECTED] wrote: MessageResources res = MessageResources.getMessageResources(ApplicationResources); If you are using the property file name ApplicationResources in the root folder. In the init method of the servlet that you are loading at startup, you can do whatever you want. public void init(ServletConfig config) throws ServletException { --- Denis Avdic [EMAIL PROTECTED] wrote: I am trying to set up a start up sequence for my app but I have never set up something like that. Basically I want to initialize some classes with attributes found in my resources file. How would I go about doing this? I set up my web.xml file to load a servlet on startup, but I am not sure how I am supposed to get to the message resources that are loaded in the ActionServlet. I know I saw this done before but I can't remember how it was set up. Thanks. Denis - 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: Load-on-startup init servlet
Hi, Denis. To get your servlet loaded after the Struts ActionServlet, simply use load-on-startup2load-on-startup (assumed that your ActionServlet is loaded with load-on-startup1load-on-startup=. This simply tells Tomcat to load your servlet after the ActionServlet. Hiran - Hiran Chaudhuri SAG Systemhaus GmbH Elsenheimer Straße 11 80867 München Phone +49-89-54 74 21 34 Fax +49-89-54 74 21 99 -Original Message- From: Denis Avdic [mailto:[EMAIL PROTECTED] Sent: Dienstag, 5. Oktober 2004 15:55 To: Struts Users Mailing List Subject: Re: Load-on-startup init servlet So I can call MessageResources.getMessageResources(blah) in the init() method? Is there an order I have to load the servlets in web.xml in order for that to work? (if I remember correctly, ActionServlet actually loads those resources, right?) On Tue, 5 Oct 2004 07:49:02 -0700 (PDT), Varun Garg [EMAIL PROTECTED] wrote: MessageResources res = MessageResources.getMessageResources(ApplicationResources); If you are using the property file name ApplicationResources in the root folder. In the init method of the servlet that you are loading at startup, you can do whatever you want. public void init(ServletConfig config) throws ServletException { --- Denis Avdic [EMAIL PROTECTED] wrote: I am trying to set up a start up sequence for my app but I have never set up something like that. Basically I want to initialize some classes with attributes found in my resources file. How would I go about doing this? I set up my web.xml file to load a servlet on startup, but I am not sure how I am supposed to get to the message resources that are loaded in the ActionServlet. I know I saw this done before but I can't remember how it was set up. Thanks. Denis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Load-on-startup init servlet
Or, extend ActionServlet and put your code after the call to super.init(): -- public class fooServlet extends ActionServlet{ public fooServlet () { super(); } public void init() throws ServletException { super.init(); // do something here; } } -- Don't forget to update web.xml. Dennis [EMAIL PROTECTED] 10/05/2004 10:58 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To [EMAIL PROTECTED], [EMAIL PROTECTED] cc Subject RE: Load-on-startup init servlet Hi, Denis. To get your servlet loaded after the Struts ActionServlet, simply use load-on-startup2load-on-startup (assumed that your ActionServlet is loaded with load-on-startup1load-on-startup=. This simply tells Tomcat to load your servlet after the ActionServlet. Hiran - Hiran Chaudhuri SAG Systemhaus GmbH Elsenheimer Straße 11 80867 München Phone +49-89-54 74 21 34 Fax +49-89-54 74 21 99 -Original Message- From: Denis Avdic [mailto:[EMAIL PROTECTED] Sent: Dienstag, 5. Oktober 2004 15:55 To: Struts Users Mailing List Subject: Re: Load-on-startup init servlet So I can call MessageResources.getMessageResources(blah) in the init() method? Is there an order I have to load the servlets in web.xml in order for that to work? (if I remember correctly, ActionServlet actually loads those resources, right?) On Tue, 5 Oct 2004 07:49:02 -0700 (PDT), Varun Garg [EMAIL PROTECTED] wrote: MessageResources res = MessageResources.getMessageResources(ApplicationResources); If you are using the property file name ApplicationResources in the root folder. In the init method of the servlet that you are loading at startup, you can do whatever you want. public void init(ServletConfig config) throws ServletException { --- Denis Avdic [EMAIL PROTECTED] wrote: I am trying to set up a start up sequence for my app but I have never set up something like that. Basically I want to initialize some classes with attributes found in my resources file. How would I go about doing this? I set up my web.xml file to load a servlet on startup, but I am not sure how I am supposed to get to the message resources that are loaded in the ActionServlet. I know I saw this done before but I can't remember how it was set up. Thanks. Denis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem parsing validation-rules depends= with jboss
I'm still stumped. I stopped server, deleted all temp files, re-deployed, and get the same error with jboss3.2.5 (listed below) What I find odd is if I remove all the rules that have depends= in them and redploy with the modified validation-rules then everything is fine. Very frustrating. 11:02:13,530 INFO [ValidatorPlugIn] Loading validation rules file from '/WEB-INF/validator-rules.xml' 11:02:13,546 INFO [ValidatorPlugIn] Loading validation rules file from '/WEB-INF/validation.xml' 11:02:13,686 ERROR [Digester] Begin event threw exception java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) snip Caused by: java.lang.NullPointerException at java.util.StringTokenizer.init(StringTokenizer.java:146) at java.util.StringTokenizer.init(StringTokenizer.java:162) at org.apache.commons.validator.ValidatorAction.setDepends(ValidatorAction.java:255) ... 147 more 11:02:13,921 ERROR [ValidatorPlugIn] Skipping all validation java.lang.NullPointerException at org.apache.commons.digester.Digester.createSAXException(Digester.java:2540) at org.apache.commons.digester.Digester.createSAXException(Digester.java:2566) Rick Reumann wrote the following on 10/5/2004 8:56 AM: Erik Weber wrote the following on 10/5/2004 1:36 AM: Zoinks, JBoss 3.2.4 (on unix) and 3.2.5 (on win 2000) have been able to parse the default validator-rules.xml (version 1.1, which has several 'depends=') for me without any problems. However, I did run into some problems with parsing errors on hot redeploys, but never could discover a pattern to them. I don't recall seeing your particular error. One thing I discovered that helped in my case was to invalidate any existing sessions before a hot redeploy. Sorry to be of little help. Are you sure that is a parsing error? No, I'm not sure at all:) Let me look into some more things today. I wonder if maybe it's using a cached version of an invalid rules file that I had replaced but I never cleared out the temp directory. I'll try that when I get to work. Thanks for the help. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: multiple submit buttons on a form
struts lover wrote the following on 10/5/2004 10:12 AM: I have this problem. I have several submit buttons on a form and I am using a modified version of LookupDispatchAction class. Is there any way for the buttons to have the same name instead of having separate names as required by LookupDispatchAction. I also want internationalization to be taken care of. Answer: Don't use the LookupDispatchAction:) Much more trouble than it's worth. Use one of Michael's solutions (which are great for multiple button forms) or simply use a basic DispatchAction. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: multiple submit buttons on a form
[EMAIL PROTECTED] wrote: 1. He authored that WIKI and 2. That WIKI now directly links to his homepage, so why make the OP suffer redirection? Dennis Because indirection decouples the link and leaves me free to change my site, Dave
Redirecting and getting the original URL
Hello. In my Struts application, I have an action which forwards to a second action. The redirect parameter is set to false, so the browser's URL doesn't change. I'd like to get the original URL that the user requested (the one that's in his browser). But request.getServletPath() and the various other request methods return the URL of the second action. One method, getRequestURL(), seems to return the original URL, but this only works on Tomcat. On WebLogic, it returns the second one. Is there a reliable way to get this information? Thanks, Jacob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
introduce Struts and Tapestry
Hello, I have to introduce and compare between (using Struts and Tapestry) and another Web Application technologies to a customer. I thought maybe anybody can link me to read the most important advantages from using Struts and Tapestry. My duty is not to program with them, its just to tell WHY are better than the other tools. Regards. Sako. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: input form
Hi, Allen... I have a similar question: when you say create the action form and put it into request scope... I suppose you refer to the same ActionForm that will be used when, say, saving that prepopulated form again (the changes you've made). Right? Then, what I'm not really sure is this: should I put that object with any key I want, use an specific key or do I have to use a particular Class / Method for doing so? Thanx, Freddy. -Mensaje original- De: Fogleson, Allen [mailto:[EMAIL PROTECTED] Enviado el: lunes, 04 de octubre de 2004 22:13 Para: 'Struts Users Mailing List' Asunto: RE: input form Anna, What I would do is start with an action (lets call it PopulateCreateAction) that gets the collection from the DB, creates a new ActionForm and populates that action form with the collections. I would place that in the request scope and then do a standard action forward to the create.jsp. You should then come into create.jsp with the form prefilled and everything works normally from there. :) Al -Original Message- From: Anna Kerekes [mailto:[EMAIL PROTECTED] Sent: Monday, October 04, 2004 3:58 PM To: Struts Users Mailing List Subject: input form Hello, I have a jsp (create.jsp), a form-bean (CreateMessageForm.java), and an action (CreateMessageAction.java). Currently, the user inputs their info into create.jsp, hits 'submit', and the action gets the info from the form-bean and does stuff with it. Instead, I would like to get some information( collections) from a database and populate create.jsp with them. So I would like to: - get a collection from the database - put this collection into the request - populate create.jsp from the request object - let the user edit the form (including the pre-populated parts) - hit submit - CreateMessageAction gets info from form-bean and does stuff... Do I have to write a separate Action class for putting the collection (from database) into the request object? Or can I somehow incorporate this into my current CreateMessageAction class ? please help, Anna Kerekes - 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: problem parsing validation-rules depends= with jboss
Do you have Struts 1.1 around? Can you deploy any of the example webapps from that dist? How about the examples from your dist? Sorry, I know it's not much help. But it looks like ValidatorAction is trying to instantiate a StringTokenizer with a null String, so I was just trying to narrow it down to a possible bug in a newer version of Struts. I don't have the Struts source code or even the latest version. Also just as a note, I found that I need to clean out both the work and the tmp directories in the server instance home and then restart to get a clean JBoss/Tomcat. I needed it so often I wrote an ant target to do it. Erik Rick Reumann wrote: I'm still stumped. I stopped server, deleted all temp files, re-deployed, and get the same error with jboss3.2.5 (listed below) What I find odd is if I remove all the rules that have depends= in them and redploy with the modified validation-rules then everything is fine. Very frustrating. 11:02:13,530 INFO [ValidatorPlugIn] Loading validation rules file from '/WEB-INF/validator-rules.xml' 11:02:13,546 INFO [ValidatorPlugIn] Loading validation rules file from '/WEB-INF/validation.xml' 11:02:13,686 ERROR [Digester] Begin event threw exception java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) snip Caused by: java.lang.NullPointerException at java.util.StringTokenizer.init(StringTokenizer.java:146) at java.util.StringTokenizer.init(StringTokenizer.java:162) at org.apache.commons.validator.ValidatorAction.setDepends(ValidatorAction.java:255) ... 147 more 11:02:13,921 ERROR [ValidatorPlugIn] Skipping all validation java.lang.NullPointerException at org.apache.commons.digester.Digester.createSAXException(Digester.java:2540) at org.apache.commons.digester.Digester.createSAXException(Digester.java:2566) Rick Reumann wrote the following on 10/5/2004 8:56 AM: Erik Weber wrote the following on 10/5/2004 1:36 AM: Zoinks, JBoss 3.2.4 (on unix) and 3.2.5 (on win 2000) have been able to parse the default validator-rules.xml (version 1.1, which has several 'depends=') for me without any problems. However, I did run into some problems with parsing errors on hot redeploys, but never could discover a pattern to them. I don't recall seeing your particular error. One thing I discovered that helped in my case was to invalidate any existing sessions before a hot redeploy. Sorry to be of little help. Are you sure that is a parsing error? No, I'm not sure at all:) Let me look into some more things today. I wonder if maybe it's using a cached version of an invalid rules file that I had replaced but I never cleared out the temp directory. I'll try that when I get to work. Thanks for the help. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
good book about struts
Hi Struters, I am working in a project which use struts. I would like to buy a book about struts. But there are many of them in the market. Can you recommend the one which you think is best? Thanks a lot - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: good book about struts
Hi, Can't say which is best as I have only read Struts in Action: Ted Husted. I find it invaluable as a reference and very easy to read ! I recommend it. Nice extra chapters too, especially the chapter on replacing JSPs with Velocity templates Robin -Original Message- From: Ye, Young [mailto:[EMAIL PROTECTED] Sent: 05 October 2004 16:39 To: 'Struts Users Mailing List' Subject: good book about struts Hi Struters, I am working in a project which use struts. I would like to buy a book about struts. But there are many of them in the market. Can you recommend the one which you think is best? Thanks a lot - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail and any attachments may be confidential and/or legally privileged. If you have received this e-mail and you are not a named addressee, please inform Landmark Information Group on 01491 413030 and then delete the e-mail from your system. If you are not a named addressee you must not use, disclose, distribute, copy, print or rely on this e-mail. This email and any attachments have been scanned for viruses and to the best of our knowledge are clean. To ensure regulatory compliance and for the protection of our clients and business, we may monitor and read e-mails sent to and from our servers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: good book about struts
How much u know about Struts? I read programming Jakarta Struts of chuck Cavaness, OReally. It is a very very nice book if u dont know anything about Struts. On Tue, 5 Oct 2004 16:45:44 +0100, Robin Mannering wrote Hi, Can't say which is best as I have only read Struts in Action: Ted Husted. I find it invaluable as a reference and very easy to read ! I recommend it. Nice extra chapters too, especially the chapter on replacing JSPs with Velocity templates Robin -Original Message- From: Ye, Young [mailto:[EMAIL PROTECTED] Sent: 05 October 2004 16:39 To: 'Struts Users Mailing List' Subject: good book about struts Hi Struters, I am working in a project which use struts. I would like to buy a book about struts. But there are many of them in the market. Can you recommend the one which you think is best? Thanks a lot - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail and any attachments may be confidential and/or legally privileged. If you have received this e-mail and you are not a named addressee, please inform Landmark Information Group on 01491 413030 and then delete the e-mail from your system. If you are not a named addressee you must not use, disclose, distribute, copy, print or rely on this e-mail. This email and any attachments have been scanned for viruses and to the best of our knowledge are clean. To ensure regulatory compliance and for the protection of our clients and business, we may monitor and read e-mails sent to and from our servers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Ricardo Andrés Quintero R. Ubiquando Ltda. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: back button
Hi, Just for the record the following javascript works (in the body tag of the html page): body onload=history.forward(); It's not pretty, but it works. Regards, Andy _ Want to block unwanted pop-ups? Download the free MSN Toolbar now! http://toolbar.msn.co.uk/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: good book about struts
+1 for Ted Husted's Struts in Action On Tue, 5 Oct 2004 10:48:41 -0400, Ricardo Andres Quintero [EMAIL PROTECTED] wrote: How much u know about Struts? I read programming Jakarta Struts of chuck Cavaness, OReally. It is a very very nice book if u dont know anything about Struts. On Tue, 5 Oct 2004 16:45:44 +0100, Robin Mannering wrote Hi, Can't say which is best as I have only read Struts in Action: Ted Husted. I find it invaluable as a reference and very easy to read ! I recommend it. Nice extra chapters too, especially the chapter on replacing JSPs with Velocity templates Robin -Original Message- From: Ye, Young [mailto:[EMAIL PROTECTED] Sent: 05 October 2004 16:39 To: 'Struts Users Mailing List' Subject: good book about struts Hi Struters, I am working in a project which use struts. I would like to buy a book about struts. But there are many of them in the market. Can you recommend the one which you think is best? Thanks a lot - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail and any attachments may be confidential and/or legally privileged. If you have received this e-mail and you are not a named addressee, please inform Landmark Information Group on 01491 413030 and then delete the e-mail from your system. If you are not a named addressee you must not use, disclose, distribute, copy, print or rely on this e-mail. This email and any attachments have been scanned for viruses and to the best of our knowledge are clean. To ensure regulatory compliance and for the protection of our clients and business, we may monitor and read e-mails sent to and from our servers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Ricardo Andrés Quintero R. Ubiquando Ltda. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tiles inheritance
Can anyone explain to me strait how tiles inheritance model actually works? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: input form
Freddy, You want to use the formName that you gave in the struts-config.xml in general. Here is a short example. Assume TestForm is an actionform named testForm in the struts-config.xml. In the action class you would do something like this public Actionforward execute(...) { . . . TestForm form1 = new TestForm(); . . . populate the form here . . . request.setAttribute(testForm, form1); return mapping.findForward(success); } When you enter the page mapped as the input for the actionClass (that you are submitting to) Struts will look up the action form from the request. Note that if you set the form to session scope in the struts-config you would of course have to do a request.getSession().setAttribute() versus the request.setAttribute() The flow is something like this User ---requests action.do populates and forwards to jsp displays with form filled in --submit action2.do Action1.do is the initial action class above and action2.do is the action where you are going to act on the submitted data. Al p.s. if you need an example I can probably strip one down and send it to you direct, just let me know. -Original Message- From: Freddy Villalba A. [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 05, 2004 11:28 AM To: Struts Users Mailing List Subject: RE: input form Hi, Allen... I have a similar question: when you say create the action form and put it into request scope... I suppose you refer to the same ActionForm that will be used when, say, saving that prepopulated form again (the changes you've made). Right? Then, what I'm not really sure is this: should I put that object with any key I want, use an specific key or do I have to use a particular Class / Method for doing so? Thanx, Freddy. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: input form
Wendy, True enough, the original question though revolved around prepopulating the form from the DB before getting to the view of the submitting page so that initial page would have data pre-populated. :) Al -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 05, 2004 12:05 PM To: Struts Users Mailing List Subject: Re: input form From: Freddy Villalba A. [EMAIL PROTECTED] I have a similar question: when you say create the action form and put it into request scope... I suppose you refer to the same ActionForm that will be used when, say, saving that prepopulated form again (the changes you've made). Struts will instantiate the ActionForm and place it in the correct scope according to your struts-config.xml setup. All you have to do is use the 'form' object that's passed into your 'execute' (or similar) method, setting values as necessary. You have a reference to the form, you don't have to worry about where it lives, or put it anywhere. -- Wendy Smoak - 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]
JSPC and struts problem
Hi all, I'm trying to compile JSP from my webapp and run into this Null Pointer problem. It's seem that MessageResources.java can't be loaded has is (need to be loaded in the webapp environment) I'm running Struts 1.1. I'm pretty sure this should work .. do I need to update my struts version? I tried to search the archive about jspc and struts and haven`t got any result (bizarre)... Any help will be appreciated! Thanks! /David enerateJavaFromJSP: [jasper2] 2004-10-05 12:25:42 org.apache.struts.util.MessageResourcesFactory createFactory [jasper2] GRAVE: MessageResourcesFactory.createFactory [jasper2] java.lang.ClassNotFoundException: org.apache.struts.util.PropertyMessageResourcesFactory [jasper2] at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.jav a:1150) [jasper2] at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1091) [jasper2] at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:961) [jasper2] at java.lang.ClassLoader.loadClass(ClassLoader.java:235) [jasper2] at org.apache.struts.util.RequestUtils.applicationClass(RequestUtils.java:210) [jasper2] at org.apache.struts.util.MessageResourcesFactory.createFactory(MessageResource sFactory.java:192) [jasper2] at org.apache.struts.util.MessageResources.getMessageResources(MessageResources .java:576) [jasper2] at org.apache.struts.util.RequestUtils.clinit(RequestUtils.java:137) [jasper2] at org.apache.struts.util.MessageResourcesFactory.createFactory(MessageResource sFactory.java:192) [jasper2] at org.apache.struts.util.MessageResources.getMessageResources(MessageResources .java:576) [jasper2] at org.apache.struts.taglib.html.HtmlTag.clinit(HtmlTag.java:96) [jasper2] at java.lang.Class.forName0(Native Method) [jasper2] at java.lang.Class.forName(Class.java:141) [jasper2] at org.apache.strutsel.taglib.html.ELHtmlTagBeanInfo.class$(ELHtmlTagBeanInfo.j ava:88) [jasper2] at org.apache.strutsel.taglib.html.ELHtmlTagBeanInfo.getPropertyDescriptors(ELH tmlTagBeanInfo.java:88) [jasper2] at java.beans.Introspector.getTargetPropertyInfo(Introspector.java:459) [jasper2] at java.beans.Introspector.getBeanInfo(Introspector.java:372) [jasper2] at java.beans.Introspector.getBeanInfo(Introspector.java:144) [jasper2] at org.apache.jasper.compiler.Generator$TagHandlerInfo.init(Generator.java:19 46) [jasper2] at org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:10 93) [jasper2] at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:707) [jasper2] at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:1028) [jasper2] at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:1070) [jasper2] at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:1076) [jasper2] at org.apache.jasper.compiler.Node$Root.accept(Node.java:232) [jasper2] at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:1028) [jasper2] at org.apache.jasper.compiler.Generator.generate(Generator.java:1917) [jasper2] at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:242) [jasper2] at org.apache.jasper.JspC.processFile(JspC.java:573) [jasper2] at org.apache.jasper.JspC.execute(JspC.java:801) [jasper2] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [jasper2] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) [jasper2] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) [jasper2] at java.lang.reflect.Method.invoke(Method.java:324) [jasper2] at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:124) [jasper2] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269) [jasper2] at org.apache.tools.ant.Task.perform(Task.java:364) [jasper2] at org.apache.tools.ant.Target.execute(Target.java:301) [jasper2] at org.apache.tools.ant.Target.performTasks(Target.java:328) [jasper2] at org.apache.tools.ant.Project.executeTarget(Project.java:1215) [jasper2] at org.apache.tools.ant.Project.executeTargets(Project.java:1063) [jasper2] at org.apache.tools.ant.Main.runBuild(Main.java:632) [jasper2] at org.apache.tools.ant.Main.startAnt(Main.java:183) [jasper2] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:197) [jasper2] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56) [jasper2] 2004-10-05 12:25:42 org.apache.struts.util.MessageResourcesFactory createFactory [jasper2] GRAVE: MessageResourcesFactory.createFactory [jasper2] java.lang.ExceptionInInitializerError [jasper2] at org.apache.struts.util.MessageResourcesFactory.createFactory(MessageResource sFactory.java:192) [jasper2] at org.apache.struts.util.MessageResources.getMessageResources(MessageResources .java:576) [jasper2] at org.apache.struts.taglib.html.HtmlTag.clinit(HtmlTag.java:96)
RE: Tiles inheritance
Honestly pretty much like regular OO inheritance. If you define values in the subclassed tile then they replace the ones in the parent, if you do not then the parents value is used. Al -Original Message- From: Wylie van den Akker [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 05, 2004 12:04 PM To: [EMAIL PROTECTED] Subject: Tiles inheritance Can anyone explain to me strait how tiles inheritance model actually works? - 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: input form
Hi All, Just chewing over this problem myself since it was brought up. The solution is here I believe, yet to implement it but I'm sure it'll work. http://struts.apache.org/faqs/newbie.html#prepopulate Hope this helps, not sure if it repeats what has been said already. Robin -Original Message- From: Fogleson, Allen [mailto:[EMAIL PROTECTED] Sent: 05 October 2004 17:32 To: 'Struts Users Mailing List' Subject: RE: input form Wendy, True enough, the original question though revolved around prepopulating the form from the DB before getting to the view of the submitting page so that initial page would have data pre-populated. :) Al -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 05, 2004 12:05 PM To: Struts Users Mailing List Subject: Re: input form From: Freddy Villalba A. [EMAIL PROTECTED] I have a similar question: when you say create the action form and put it into request scope... I suppose you refer to the same ActionForm that will be used when, say, saving that prepopulated form again (the changes you've made). Struts will instantiate the ActionForm and place it in the correct scope according to your struts-config.xml setup. All you have to do is use the 'form' object that's passed into your 'execute' (or similar) method, setting values as necessary. You have a reference to the form, you don't have to worry about where it lives, or put it anywhere. -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail and any attachments may be confidential and/or legally privileged. If you have received this e-mail and you are not a named addressee, please inform Landmark Information Group on 01491 413030 and then delete the e-mail from your system. If you are not a named addressee you must not use, disclose, distribute, copy, print or rely on this e-mail. This email and any attachments have been scanned for viruses and to the best of our knowledge are clean. To ensure regulatory compliance and for the protection of our clients and business, we may monitor and read e-mails sent to and from our servers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: input form
Thanx Allen! Your explanations is clear enough. -Mensaje original- De: Fogleson, Allen [mailto:[EMAIL PROTECTED] Enviado el: martes, 05 de octubre de 2004 18:30 Para: 'Struts Users Mailing List' Asunto: RE: input form Freddy, You want to use the formName that you gave in the struts-config.xml in general. Here is a short example. Assume TestForm is an actionform named testForm in the struts-config.xml. In the action class you would do something like this public Actionforward execute(...) { . . . TestForm form1 = new TestForm(); . . . populate the form here . . . request.setAttribute(testForm, form1); return mapping.findForward(success); } When you enter the page mapped as the input for the actionClass (that you are submitting to) Struts will look up the action form from the request. Note that if you set the form to session scope in the struts-config you would of course have to do a request.getSession().setAttribute() versus the request.setAttribute() The flow is something like this User ---requests action.do populates and forwards to jsp displays with form filled in --submit action2.do Action1.do is the initial action class above and action2.do is the action where you are going to act on the submitted data. Al p.s. if you need an example I can probably strip one down and send it to you direct, just let me know. -Original Message- From: Freddy Villalba A. [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 05, 2004 11:28 AM To: Struts Users Mailing List Subject: RE: input form Hi, Allen... I have a similar question: when you say create the action form and put it into request scope... I suppose you refer to the same ActionForm that will be used when, say, saving that prepopulated form again (the changes you've made). Right? Then, what I'm not really sure is this: should I put that object with any key I want, use an specific key or do I have to use a particular Class / Method for doing so? Thanx, Freddy. - 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: input form
Hi All, Just tried it out as defined in the struts link below and it works a treat... You don't need to instantiate an instance of the form, as this has already been done for you by the Struts framework before the Action is reached, and you don't need to set the form as a request attribute. My edit action method (the pre-populating action) is as follows: public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response ) throws Exception { UserRegForm userRegForm = (UserRegForm)form; userRegForm.setEmailAddressDisplay(defaultValue); // return the ActionForward you use for success return mapping.findForward(success); } -Original Message- From: Robin Mannering [mailto:[EMAIL PROTECTED] Sent: 05 October 2004 17:55 To: Struts Users Mailing List Subject: RE: input form Hi All, Just chewing over this problem myself since it was brought up. The solution is here I believe, yet to implement it but I'm sure it'll work. http://struts.apache.org/faqs/newbie.html#prepopulate Hope this helps, not sure if it repeats what has been said already. Robin -Original Message- From: Fogleson, Allen [mailto:[EMAIL PROTECTED] Sent: 05 October 2004 17:32 To: 'Struts Users Mailing List' Subject: RE: input form Wendy, True enough, the original question though revolved around prepopulating the form from the DB before getting to the view of the submitting page so that initial page would have data pre-populated. :) Al -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 05, 2004 12:05 PM To: Struts Users Mailing List Subject: Re: input form From: Freddy Villalba A. [EMAIL PROTECTED] I have a similar question: when you say create the action form and put it into request scope... I suppose you refer to the same ActionForm that will be used when, say, saving that prepopulated form again (the changes you've made). Struts will instantiate the ActionForm and place it in the correct scope according to your struts-config.xml setup. All you have to do is use the 'form' object that's passed into your 'execute' (or similar) method, setting values as necessary. You have a reference to the form, you don't have to worry about where it lives, or put it anywhere. -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail and any attachments may be confidential and/or legally privileged. If you have received this e-mail and you are not a named addressee, please inform Landmark Information Group on 01491 413030 and then delete the e-mail from your system. If you are not a named addressee you must not use, disclose, distribute, copy, print or rely on this e-mail. This email and any attachments have been scanned for viruses and to the best of our knowledge are clean. To ensure regulatory compliance and for the protection of our clients and business, we may monitor and read e-mails sent to and from our servers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail and any attachments may be confidential and/or legally privileged. If you have received this e-mail and you are not a named addressee, please inform Landmark Information Group on 01491 413030 and then delete the e-mail from your system. If you are not a named addressee you must not use, disclose, distribute, copy, print or rely on this e-mail. This email and any attachments have been scanned for viruses and to the best of our knowledge are clean. To ensure regulatory compliance and for the protection of our clients and business, we may monitor and read e-mails sent to and from our servers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] RE: multiple submit buttons on a form
Durham David R Jr Contr 805 CSPTS/SCE wrote: The reason is that I may want to change this page without having to go to every place it is linked to do so. Does that qualify as a splash screen? HA HA - Dave Well, you live and learn, Dave. I had never heard of splash screens before. LOL Michael
Servlet action is not available.
hi, i have struts.jar in myStrutsApp1\WEB-INF\lib and even in tomcat\bin the code is an example from the net, which i thing it must run. but i still get this error : HTTP Status 404 - Servlet action is not available type Status report message Servlet action is not available description The requested resource (Servlet action is not available) is not available. Apache Tomcat/5.0.25 thnaks Sako - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Servlet action is not available.
Did u configure the servlet controller in your app web.xml? On Tue, 5 Oct 2004 19:16:24 +0200, WOLips wrote hi, i have struts.jar in myStrutsApp1\WEB-INF\lib and even in tomcat\bin the code is an example from the net, which i thing it must run. but i still get this error : HTTP Status 404 - Servlet action is not available type Status report message Servlet action is not available description The requested resource (Servlet action is not available) is not available. Apache Tomcat/5.0.25 thnaks Sako - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Ricardo Andrés Quintero R. Ubiquando Ltda. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Servlet action is not available.
Did u configure the servlet controller in your app web.xml? On Tue, 5 Oct 2004 19:16:24 +0200, WOLips wrote hi, i have struts.jar in myStrutsApp1\WEB-INF\lib and even in tomcat\bin the code is an example from the net, which i thing it must run. but i still get this error : HTTP Status 404 - Servlet action is not available type Status report message Servlet action is not available description The requested resource (Servlet action is not available) is not available. Apache Tomcat/5.0.25 thnaks Sako - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Ricardo Andrés Quintero R. Ubiquando Ltda. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validation in Struts for Required fields
Hi , I have a JSP Page where I have two dropdowns displaying default values. Before submitting that page, the user should select something from these two dropdowns and if he doesn't selects, there should be an error message displayed on the top saying This field is required. This is what I am doing but it doesn't gives me an error message and am able to proceed to the next page. Any idea as to what could be possibly wrong/missing ? In my validator.xml , I have form name=ClientReportingForm !-- Struts validation -- field property=reportType depends=required arg0 key=prompt.reportType/ /field field property=productLine depends=required arg0 key=prompt.productLine/ /field /form In my ApplicationResources.properties I have prompt.reportType value= Report Type/ prompt.productLinevalue= Product Line/ And in my JSP Page I have logic:messagesPresent message=error bean:message key=errors.header / ul font color=redb html:messages id=error libean:write name=error filter=false //li /html:messages /b /font /ul bean:message key=errors.footer / /logic:messagesPresent Thanks, Priya
Re: Servlet action is not available.
thank you for answer. i addes these jars to myStrutsApp1\WEB-INF\lib and it worked. commons-beanutils.jar commons-collections.jar commons-digester.jar commons-fileupload.jar commons-logging.jar commons-validator.jar jakarta-oro.jar struts.jar Sako. - Original Message - From: Ricardo Andres Quintero [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, October 05, 2004 6:23 PM Subject: Re: Servlet action is not available. Did u configure the servlet controller in your app web.xml? On Tue, 5 Oct 2004 19:16:24 +0200, WOLips wrote hi, i have struts.jar in myStrutsApp1\WEB-INF\lib and even in tomcat\bin the code is an example from the net, which i thing it must run. but i still get this error : HTTP Status 404 - Servlet action is not available type Status report message Servlet action is not available description The requested resource (Servlet action is not available) is not available. Apache Tomcat/5.0.25 thnaks Sako - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Ricardo Andrés Quintero R. Ubiquando Ltda. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation in Struts for Required fields
In your JSP, where are your selects? Are you using html:select tags to produce them? Erik Priya Jotwani wrote: Hi , I have a JSP Page where I have two dropdowns displaying default values. Before submitting that page, the user should select something from these two dropdowns and if he doesn't selects, there should be an error message displayed on the top saying This field is required. This is what I am doing but it doesn't gives me an error message and am able to proceed to the next page. Any idea as to what could be possibly wrong/missing ? In my validator.xml , I have form name=ClientReportingForm !-- Struts validation -- field property=reportType depends=required arg0 key=prompt.reportType/ /field field property=productLine depends=required arg0 key=prompt.productLine/ /field /form In my ApplicationResources.properties I have prompt.reportType value= Report Type/ prompt.productLinevalue= Product Line/ And in my JSP Page I have logic:messagesPresent message=error bean:message key=errors.header / ul font color=redb html:messages id=error libean:write name=error filter=false //li /html:messages /b /font /ul bean:message key=errors.footer / /logic:messagesPresent Thanks, Priya - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: multiple submit buttons on a form
Rick Reumann wrote: struts lover wrote the following on 10/5/2004 10:12 AM: I have this problem. I have several submit buttons on a form and I am using a modified version of LookupDispatchAction class. Is there any way for the buttons to have the same name instead of having separate names as required by LookupDispatchAction. I also want internationalization to be taken care of. Answer: Don't use the LookupDispatchAction:) Much more trouble than it's worth. Use one of Michael's solutions (which are great for multiple button forms) or simply use a basic DispatchAction. He cannot use a basic DispatchAction, Rick, since he wants to use multiple buttons. He needs multiple buttons with the same value. Since the value of the name parameter in the HTML is completely decoupled from all of my solutions, he is free to do that with all the solutions. Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Redirecting and getting the original URL
On a Servlet 2.4 container (such as Tomcat 5.x), the server will store the original path-related information as a set of request attributes with well known names: javax.servlet.forward.request_uri javax.servlet.forward.context_path javax.servlet.forward.servlet_path javax.servlet.forward.path_info javax.servlet.forward.query_string On a pre-2.4 container, you'll need to save the values yourself prior to performing the forward. Craig On Tue, 5 Oct 2004 15:26:55 + (UTC), Jacob Weber [EMAIL PROTECTED] wrote: Hello. In my Struts application, I have an action which forwards to a second action. The redirect parameter is set to false, so the browser's URL doesn't change. I'd like to get the original URL that the user requested (the one that's in his browser). But request.getServletPath() and the various other request methods return the URL of the second action. One method, getRequestURL(), seems to return the original URL, but this only works on Tomcat. On WebLogic, it returns the second one. Is there a reliable way to get this information? Thanks, Jacob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Servlet action is not available.
WOLips wrote the following on 10/5/2004 1:16 PM: but i still get this error : HTTP Status 404 - Servlet action is not available type Status report message Servlet action is not available description The requested resource (Servlet action is not available) is not available. Apache Tomcat/5.0.25 First, please try to remember not to reply to a message in a thread and change the subject (it will screw up how a lot of e-mail clients sort threaded e-mails). In reference to the problem you need to look in your log file to see what is causing the problem. The ActionServlet will not get set up if a bunch of other things could fail... problem parsing some xml files, etc. The logs should give you a clue where the problem is. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Servlet action is not available.
u should kick him!! thats terrible i dont know how we can live with this... On Tue, 05 Oct 2004 13:46:20 -0400, Rick Reumann wrote WOLips wrote the following on 10/5/2004 1:16 PM: but i still get this error : HTTP Status 404 - Servlet action is not available type Status report message Servlet action is not available description The requested resource (Servlet action is not available) is not available. Apache Tomcat/5.0.25 First, please try to remember not to reply to a message in a thread and change the subject (it will screw up how a lot of e-mail clients sort threaded e-mails). In reference to the problem you need to look in your log file to see what is causing the problem. The ActionServlet will not get set up if a bunch of other things could fail... problem parsing some xml files, etc. The logs should give you a clue where the problem is. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Ricardo Andrés Quintero R. Ubiquando Ltda. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: multiple submit buttons on a form
struts lover wrote: Hello Everyone, I have this problem. I have several submit buttons on a form and I am using a modified version of LookupDispatchAction class. Is there any way for the buttons to have the same name instead of having separate names as required by LookupDispatchAction. I also want internationalization to be taken care of. Any help would be appreciated. Thanks. I assume, Struts Lover, you see that you just use the lovely Struts bean:message key='SUBMIT'/ for the values in order to Internationalize the solution with the solutions I sent you to. Michael McGrady - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Servlet action is not available.
Ricardo Andres Quintero wrote the following on 10/5/2004 12:47 PM: u should kick him!! thats terrible i dont know how we can live with this... I must be missing the joke:)... live with 'what' ? -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: textbox format date i18n date handling
I guess this got kicked back for some reason. Please see below: Multiple related questions: 1) I have a java.util.Date field that needs to be displayed in a textbox. In bean:write there are formatting methods to have the date display using a MM/dd/ for example. however I don't see the same for html:text. I'm sure there's a way I'm not seeing... I tried putting the bean:write in between the html:text tags hoping it would render the formatted date but I couldn't write html:text with no property item and using an empty space didn't work. I was thinking about using ConvertUtils String and Date conversion methods to only show the format that I wanted in this case but these are static methods and I can say for certain that there will be a case where I would want the Date formatted with the time portion as well. My code doesn't have control yet when Struts populates the properties. [David Suarez] BTW, I have been working on specifying a StringConverter of my own but it doesn't seem to be ever used though I have identical code for a DateConverter that works. Any known issues with registering a different StringConverter within Struts? 2) We have an i18n app where the date should be displayed/set as used locally. The ConvertUtils method again would restrict to one date format so what I am thinking for i18n is to populate it into a hidden field (US Format always) and use javascript to do the formatting for the user view and to update the hidden field again so struts only needs to worry about one date format on submit. Seems like a lot of work though, I would think other's have run into this as well. What's the better solution that I'm not seeing? Thanks for your assistance. Regards...djsuarez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: textbox format date i18n date handling
1) I have a java.util.Date field that needs to be displayed in a textbox. IMHO the way to do this is to have a read/write property in your bean that delivers and accepts a string. Both can use SimpleDateFormat class to convert between the string and the underling Date class. -- Tim Slattery [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: textbox format date i18n date handling
Hi, Tim. This is right. But also make sure the locale dependent date parsing is done in the action class then, since - I'm not sure whether the validator package can cover localized dateformats - only the controller classes know about the user's locale and therefore the dateformat that should be used Hiran - Hiran Chaudhuri SAG Systemhaus GmbH Elsenheimer Straße 11 80867 München Phone +49-89-54 74 21 34 Fax +49-89-54 74 21 99 -Original Message- From: Slattery, Tim - BLS [mailto:[EMAIL PROTECTED] Sent: Dienstag, 5. Oktober 2004 19:02 To: 'Struts Users Mailing List' Subject: RE: textbox format date i18n date handling 1) I have a java.util.Date field that needs to be displayed in a textbox. IMHO the way to do this is to have a read/write property in your bean that delivers and accepts a string. Both can use SimpleDateFormat class to convert between the string and the underling Date class. -- Tim Slattery [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 submit buttons on a form
Michael McGrady wrote the following on 10/5/2004 1:40 PM: He cannot use a basic DispatchAction, Rick, since he wants to use multiple buttons. He needs multiple buttons with the same value. Since the value of the name parameter in the HTML is completely decoupled from all of my solutions, he is free to do that with all the solutions. Well, you shouldn't say Can't since I do it all the time with javascript. A simple onClick=yourForm.dispatch.value='whatever' does the trick for me on any of my buttons. (Granted yours is nice and clean since it avoids the need for the hidden dispatch param and javascript.) -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Servlet action is not available.
- Original Message - From: Rick Reumann [EMAIL PROTECTED] To: struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, October 05, 2004 7:46 PM Subject: Re: Servlet action is not available. WOLips wrote the following on 10/5/2004 1:16 PM: but i still get this error : HTTP Status 404 - Servlet action is not available type Status report message Servlet action is not available description The requested resource (Servlet action is not available) is not available. Apache Tomcat/5.0.25 First, please try to remember not to reply to a message in a thread and change the subject (it will screw up how a lot of e-mail clients sort threaded e-mails). i do this for months, how can you recognize this? In reference to the problem you need to look in your log file to see what is causing the problem. The ActionServlet will not get set up if a bunch of other things could fail... problem parsing some xml files, etc. The logs should give you a clue where the problem is. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation in Struts for Required fields
Somehow we lost the list on a couple of posts. OK, so, these are the things I assume you have checked so far: 1) you have an html:select tag with property = reportType, and the default option's value is 2) your ActionForm extends one of the proper types (such as ValidatorForm) and has the proper getters and setters for the reportType field 3) in struts-config.xml, you have configured the action (the same one that your form will submit to) with validate = true, and you have named the proper ActionForm to associate with the action (one of your form-bean declarations) 4) the field name in validation.xml matches the field name of your select (reportType), and the form name in validation.xml matches the same form name that you are associating with the action in struts-config.xml (the name of the form configured in the action matches one of your form-bean declarations) What else am I leaving out? Erik Priya Jotwani wrote: Yes I have set the validate= true in and the field names are same too :( -Original Message- From: Erik Weber [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 05, 2004 11:32 PM To: Priya Jotwani Subject: Re: Validation in Struts for Required fields Does the property attribute to html:select have the same value you have specified as the field name in validation.xml (reportType, productLine)? Do you have the validate attribute set to true in struts-config.xml for the relevant action configuration? Erik Priya Jotwani wrote: Hi Erik, I am using html:select tag like below in my JSP html:option value=Select a Product Line/html:option Thanks, Priya -Original Message- From: Erik Weber [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 05, 2004 11:04 PM To: Struts Users Mailing List Subject: Re: Validation in Struts for Required fields In your JSP, where are your selects? Are you using html:select tags to produce them? Erik Priya Jotwani wrote: Hi , I have a JSP Page where I have two dropdowns displaying default values. Before submitting that page, the user should select something from these two dropdowns and if he doesn't selects, there should be an error message displayed on the top saying This field is required. This is what I am doing but it doesn't gives me an error message and am able to proceed to the next page. Any idea as to what could be possibly wrong/missing ? In my validator.xml , I have form name=ClientReportingForm !-- Struts validation -- field property=reportType depends=required arg0 key=prompt.reportType/ /field field property=productLine depends=required arg0 key=prompt.productLine/ /field /form In my ApplicationResources.properties I have prompt.reportType value= Report Type/ prompt.productLinevalue= Product Line/ And in my JSP Page I have logic:messagesPresent message=error bean:message key=errors.header / ul font color=redb html:messages id=error libean:write name=error filter=false //li /html:messages /b /font /ul bean:message key=errors.footer / /logic:messagesPresent Thanks, Priya - 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 submit buttons on a form
Rick Reumann wrote: Michael McGrady wrote the following on 10/5/2004 1:40 PM: He cannot use a basic DispatchAction, Rick, since he wants to use multiple buttons. He needs multiple buttons with the same value. Since the value of the name parameter in the HTML is completely decoupled from all of my solutions, he is free to do that with all the solutions. Well, you shouldn't say Can't since I do it all the time with javascript. A simple onClick=yourForm.dispatch.value='whatever' does the trick for me on any of my buttons. (Granted yours is nice and clean since it avoids the need for the hidden dispatch param and javascript.) Rick, /mea culpa, mea maxima culpa/. I knew that too. Sorry! I am going to put that solution up on my page too within the next few days. I too often forget about the JavaScript thing when I am thinking about solutions. My first engineering job involved never talking about JavaScript. It was DEATH! LOL Michael McGrady
Internationalize Submit Button
Hi, I would like build a Struts-form like this: ... html:form action=/search table width=100% trtd bean:message key=search.for /html:text property=text titleKey=search.for.title / /td/tr trtd html:submit value=Search / /td/tr /table /html:form I have the following entries in properties file: search.for=Search for: search.for.title=Search for book title Question: Is is possible to setup the submit button like: valueKey=search.submit (analogous title/titleKey) to have i18n facility? Thanks Zoltan __ Mit WEB.DE FreePhone mit hoechster Qualitaet ab 0 Ct./Min. weltweit telefonieren! http://freephone.web.de/?mc=021201 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Servlet action is not available.
WOLips wrote the following on 10/5/2004 2:20 PM: First, please try to remember not to reply to a message in a thread and change the subject (it will screw up how a lot of e-mail clients sort threaded e-mails). i do this for months, how can you recognize this? I believe it works on the fact that decent mail clients (like Thunderbird) will thread based on the message id, not the subject. View the source of a message and a reply-to the message. Look at the original messageID and then in the reply message you'll see an In-Reply-To ID. For example in this thread there was a message: Message-Id: [EMAIL PROTECTED] and viewing the source of a reply message you'll see: In-Reply-To: [EMAIL PROTECTED] This is useful since it will allow for someone to alter the subject line and keep the thread intact. This is normally what you want like for when a thread starts out one way and then slightly changes so someone changes the subject line but it still is part of the original thread. If you start a brand new subject though by replying to an email and just changing the subject line your message might not even get read because it might end up buried in a thread that no one cares about. And yes, you do see this happen all the time on this list. Usually I don't even bother to comment on it but occasionaly I do when I reply:) It helps everyone if people start a new subject with a new e-mail vs hi-jacking a reply message. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: textbox format date i18n date handling
Thanks for the quick responses! Is there anything more generic that can be done? Till now I have been setting the fields directly into the real bean classes so to do the below I would need to replicate the properties on the form and then move them over to the real bean classes afterwards (when I know the Locale). The custom DateConverter seems to be able to do this work behind-the-scenes for me in the little testing that I've done to set the date correctly in a deep been tree but I'd have to always use the same date format in this case because the locale can not be set in a per-request scope for beanutils. So the question is: Which is the more ideal of the two? Seems like there are two approaches: 1) Use one date format in the app and have the javascript handle presentation of dates for i18n? + Can do a property writes directly into Dates without having to later convert it from a String - javascript involved on the html view 2) Convert the Dates to Strings and then manually create proxies for each Date that would handle the localization + no javascript - Need to create redundant properties to allow the translation to occur for deep seated beans I guess for #2 I can create a postProcess(Locale) method to my base form and ensure it's always called in my base action so I don't have to ensure that it's in every individual action but I'd still need to write all the duplicate properties in my form. I'd appreciate your feedback. Any ideas on getting the Date to format correctly in a textbox using a formatKey like the bean:write tag has? Or do I need to manually write out the INPUT tag html and in the value section use the bean:write tag which does allow to format the date? Maybe that would be a nice enhancement to html:text to avoid having to do the manual write. For me, #1 seems like it may be less work right now (don't have to duplicate properties) but maybe there's a bigger flaw there that I haven't seen if I go forward with that approach. Thoughts? Unfortunately I need to pick a way by end of day today and go with it so I really do appreciate the fast responses! Thanks again!...djsuarez ~~~ Content-Type: text/plain; charset=iso-8859-1 Subject: textbox format date i18n date handling Date: Tue, 5 Oct 2004 20:07:54 +0200 From: [EMAIL PROTECTED] [EMAIL PROTECTED] Hi, Tim. This is right. But also make sure the locale dependent date parsing is done in the action class then, since - I'm not sure whether the validator package can cover localized dateformats - only the controller classes know about the user's locale and therefore the dateformat that should be used Hiran - Hiran Chaudhuri SAG Systemhaus GmbH Elsenheimer Straße 11 80867 München Phone +49-89-54 74 21 34 Fax +49-89-54 74 21 99 -Original Message- From: Slattery, Tim - BLS [mailto:[EMAIL PROTECTED] Sent: Dienstag, 5. Oktober 2004 19:02 To: 'Struts Users Mailing List' Subject: RE: textbox format date i18n date handling 1) I have a java.util.Date field that needs to be displayed in a textbox. IMHO the way to do this is to have a read/write property in your bean that delivers and accepts a string. Both can use SimpleDateFormat class to convert between the string and the underling Date class. -- Tim Slattery [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: textbox format date i18n date handling
I don't have time for a long response but have you considered the fmt:formatDate tag of JSTL? David Suarez [EMAIL PROTECTED] corps.org To [EMAIL PROTECTED] 10/05/2004 02:54 cc PM Subject RE: textbox format date i18n date Please respond to handling Struts Users Mailing List [EMAIL PROTECTED] he.org Thanks for the quick responses! Is there anything more generic that can be done? Till now I have been setting the fields directly into the real bean classes so to do the below I would need to replicate the properties on the form and then move them over to the real bean classes afterwards (when I know the Locale). The custom DateConverter seems to be able to do this work behind-the-scenes for me in the little testing that I've done to set the date correctly in a deep been tree but I'd have to always use the same date format in this case because the locale can not be set in a per-request scope for beanutils. So the question is: Which is the more ideal of the two? Seems like there are two approaches: 1) Use one date format in the app and have the javascript handle presentation of dates for i18n? + Can do a property writes directly into Dates without having to later convert it from a String - javascript involved on the html view 2) Convert the Dates to Strings and then manually create proxies for each Date that would handle the localization + no javascript - Need to create redundant properties to allow the translation to occur for deep seated beans I guess for #2 I can create a postProcess(Locale) method to my base form and ensure it's always called in my base action so I don't have to ensure that it's in every individual action but I'd still need to write all the duplicate properties in my form. I'd appreciate your feedback. Any ideas on getting the Date to format correctly in a textbox using a formatKey like the bean:write tag has? Or do I need to manually write out the INPUT tag html and in the value section use the bean:write tag which does allow to format the date? Maybe that would be a nice enhancement to html:text to avoid having to do the manual write. For me, #1 seems like it may be less work right now (don't have to duplicate properties) but maybe there's a bigger flaw there that I haven't seen if I go forward with that approach. Thoughts? Unfortunately I need to pick a way by end of day today and go with it so I really do appreciate the fast responses! Thanks again!...djsuarez ~~~ Content-Type: text/plain; charset=iso-8859-1 Subject: textbox format date i18n date handling Date: Tue, 5 Oct 2004 20:07:54 +0200 From: [EMAIL PROTECTED] [EMAIL PROTECTED] Hi, Tim. This is right. But also make sure the locale dependent date parsing is done in the action class then, since - I'm not sure whether the validator package can cover localized dateformats - only the controller classes know about the user's locale and therefore the dateformat that should be used Hiran - Hiran Chaudhuri SAG Systemhaus GmbH Elsenheimer Strae 11 80867 Mnchen Phone +49-89-54 74 21 34 Fax +49-89-54 74 21 99 -Original Message- From: Slattery, Tim - BLS [mailto:[EMAIL PROTECTED] Sent: Dienstag, 5. Oktober 2004 19:02 To: 'Struts Users Mailing List' Subject: RE: textbox format date i18n date handling 1) I have a java.util.Date field that needs to be displayed in a textbox. IMHO the way to do this is to have a read/write property in your bean that delivers and accepts a string. Both can use SimpleDateFormat class to convert between the string and the underling Date class. -- Tim Slattery [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]
Internationalize Submit Button
Nesting the tag works for submit. I was hoping this would work for html:text as well but it doesn't unfortunately. This is a sample of what it looks like for i18n submit: html:submit bean:message key=ui.login.submit / /html:submit Regards...djsuarez Date: Tue, 05 Oct 2004 10:53:56 +0200 From: Zoltan Vekony [EMAIL PROTECTED] Subject: Internationalize Submit Button Content-Type: text/plain; charset=iso-8859-1 Hi, I would like build a Struts-form like this: ... html:form action=/search table width=100% trtd bean:message key=search.for /html:text property=text titleKey=search.for.title / /td/tr trtd html:submit value=Search / /td/tr /table /html:form I have the following entries in properties file: search.for=Search for: search.for.title=Search for book title Question: Is is possible to setup the submit button like: valueKey=search.submit (analogous title/titleKey) to have i18n facility? Thanks Zoltan
Re: textbox format date i18n date handling
Hi David, If you need this functionality in several forms and several fields, you may want to evaluate using FormDef for this. http://formdef.dev.java.net Among the sample applications is locale.war which shows you a form that includes date and currency fields with formats that change depending on the locale you pick. I should also mention that there's an open issue related to locale, but the fix for that is underway. :) If it passes your evaluation, you'll just need to specify the format in your resource file and FormDef will take care of formatting/parsing between your real bean classes and form fields. Hubert On Tue, 5 Oct 2004 13:54:34 -0500, David Suarez [EMAIL PROTECTED] wrote: Thanks for the quick responses! Is there anything more generic that can be done? Till now I have been setting the fields directly into the real bean classes so to do the below I would need to replicate the properties on the form and then move them over to the real bean classes afterwards (when I know the Locale). The custom DateConverter seems to be able to do this work behind-the-scenes for me in the little testing that I've done to set the date correctly in a deep been tree but I'd have to always use the same date format in this case because the locale can not be set in a per-request scope for beanutils. So the question is: Which is the more ideal of the two? Seems like there are two approaches: 1) Use one date format in the app and have the javascript handle presentation of dates for i18n? + Can do a property writes directly into Dates without having to later convert it from a String - javascript involved on the html view 2) Convert the Dates to Strings and then manually create proxies for each Date that would handle the localization + no javascript - Need to create redundant properties to allow the translation to occur for deep seated beans I guess for #2 I can create a postProcess(Locale) method to my base form and ensure it's always called in my base action so I don't have to ensure that it's in every individual action but I'd still need to write all the duplicate properties in my form. I'd appreciate your feedback. Any ideas on getting the Date to format correctly in a textbox using a formatKey like the bean:write tag has? Or do I need to manually write out the INPUT tag html and in the value section use the bean:write tag which does allow to format the date? Maybe that would be a nice enhancement to html:text to avoid having to do the manual write. For me, #1 seems like it may be less work right now (don't have to duplicate properties) but maybe there's a bigger flaw there that I haven't seen if I go forward with that approach. Thoughts? Unfortunately I need to pick a way by end of day today and go with it so I really do appreciate the fast responses! Thanks again!...djsuarez ~~~ Content-Type: text/plain; charset=iso-8859-1 Subject: textbox format date i18n date handling Date: Tue, 5 Oct 2004 20:07:54 +0200 From: [EMAIL PROTECTED] [EMAIL PROTECTED] Hi, Tim. This is right. But also make sure the locale dependent date parsing is done in the action class then, since - I'm not sure whether the validator package can cover localized dateformats - only the controller classes know about the user's locale and therefore the dateformat that should be used Hiran - Hiran Chaudhuri SAG Systemhaus GmbH Elsenheimer Straße 11 80867 München Phone +49-89-54 74 21 34 Fax +49-89-54 74 21 99 -Original Message- From: Slattery, Tim - BLS [mailto:[EMAIL PROTECTED] Sent: Dienstag, 5. Oktober 2004 19:02 To: 'Struts Users Mailing List' Subject: RE: textbox format date i18n date handling 1) I have a java.util.Date field that needs to be displayed in a textbox. IMHO the way to do this is to have a read/write property in your bean that delivers and accepts a string. Both can use SimpleDateFormat class to convert between the string and the underling Date class. -- Tim Slattery [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Enhancement requests
How does one go about requesting an enhancement to Struts? For my particular problem today it seems like Struts could handle all the dirty work for me if it used a version of bean utils that could be registered per request. Struts could then set the Locale and then populate all of the fields. I guess this would be a bean utils enhancement as well. Is there one-point place that the above can be suggested? I think the benefit of this is that Struts can host business beans directly and get/set them fully requiring less developer intervention to handle relatively mundane formatting details. This would be less code to be written as well. Thanks!...djsuarez
Re: html:hidden tag
Yes it is. On Tue, 5 Oct 2004 10:47:17 +1000, Yakov Belov [EMAIL PROTECTED] wrote: I presume it is the struts tag for the standard html : input type=hidden ... - Original Message - From: Phani [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 05, 2004 10:36 AM Subject: html:hidden tag Anyone has any idea about this tag: html:hidden name=customForm property=mode/ Please let me know. Thanks. __ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Enhancement requests
http://issues.apache.org/bugzilla/ On Tue, 5 Oct 2004 14:21:50 -0500, David Suarez [EMAIL PROTECTED] wrote: How does one go about requesting an enhancement to Struts? For my particular problem today it seems like Struts could handle all the dirty work for me if it used a version of bean utils that could be registered per request. Struts could then set the Locale and then populate all of the fields. I guess this would be a bean utils enhancement as well. Is there one-point place that the above can be suggested? I think the benefit of this is that Struts can host business beans directly and get/set them fully requiring less developer intervention to handle relatively mundane formatting details. This would be less code to be written as well. Thanks!...djsuarez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Enhancement requests
At 2:23 PM -0500 10/5/04, Hubert Rabago wrote: http://issues.apache.org/bugzilla/ Actually, in general, I think it's better to have some discussion on the lists before filing bugs or enhancement requests, unless the issue is very clear. In this case, I'm not sure which dirty work David is suggesting that Struts handle. Is the issue with localized converters for things like dates? I'm not sure where else such an issue applies. What would probably make the most sense would be for David to handle all his dirty work using Struts, and extending it where necessary to achieve a solution, and then present the solution to the Struts community for review and commentary. I don't say this as in geez, David is so lazy, but more from the perspective that enhancement requests of this scope are always best discussed with more detail than he has yet provided, and often best using working code. If David doesn't understand Struts well enough to achieve this goal, then hopefully he can do some research and post some pointed questions to the Struts users list until he has an idea of how to do it. If it turns out that Struts isn't flexible enough to support him achieving this goal, then lets make simpler and more general changes to Struts which promote extension in general, and save extensions for rather specific use cases until they've been tested in a running application or two. I would start by pointing out that in general, the RequestProcessor is designed for extensibility, and for a local solution you could probably start by extending it. It is well understood that the single-inheritance limitations of RequestProcessor make this a difficult way to make a general solution available to the rest of the Struts community -- but the struts-chain RequestProcessor is available already for those who are interested in applying it and developing more generalized extensions to the Request Processing chain, and we do intend to steer Struts to using the chained request processor as the base implementation as one of the next major changes -- but you certainly don't have to wait, as you can already use it, and in fact, it needs more people to use it to flush out any bugs in the adaptation of the existing RequestProcessor functionality. I hope this helps, Joe On Tue, 5 Oct 2004 14:21:50 -0500, David Suarez [EMAIL PROTECTED] wrote: How does one go about requesting an enhancement to Struts? For my particular problem today it seems like Struts could handle all the dirty work for me if it used a version of bean utils that could be registered per request. Struts could then set the Locale and then populate all of the fields. I guess this would be a bean utils enhancement as well. Is there one-point place that the above can be suggested? I think the benefit of this is that Struts can host business beans directly and get/set them fully requiring less developer intervention to handle relatively mundane formatting details. This would be less code to be written as well. Thanks!...djsuarez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com In fact, when I die, if I don't hear 'A Love Supreme,' I'll turn back; I'll know I'm in the wrong place. - Carlos Santana
Application.Resources file visibility
All, I'm upgrading an existing struts application. The application extends the TilesRequestProcessor-RequestProcessor and overrides the processRoles() method. Part of the enhancements I am trying to build requires me to pull some values from the application resource file. I'm using the inherited getInternal() method to get my MessageResources object however I can't find any of my key-value pairs. Its as if there is no visibility to the ApplicationResources.properties file here. Maybe I'm missing something obvious, any help would be greatly appreciated. Here is my resources def. in my struts-config.xml file, also, I've verified that the file is in fact in the correct location (WEB-INF/classes/resources). message-resources parameter=resources.ApplicationResources/ Thanks in Advance, TR __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validator
David G. Friedman wrote: I haven't used the validator in a while but I have a 3 questions for you: 1. If, as you say, the Javascript tag isn't being enclosed in script../script tags, then you need to verify that your validation file is loaded AND that you have the correct form name in your html:javascript formName= /. I've had that problem before when the file either was not loaded (bad path on my part for the plug-in) OR when the formName=... didn't match anything in my validation.xml file. I recommend you make sure the file loaded properly and is in the correct path specified in your plugIn as you listed a matching formName in that .xml file. Well, first things first ;) [ValidatorPlugIn] Loading validation rules file from '/WEB-INF/validator-rules.xml' [ValidatorPlugIn] Loading validation rules file from '/WEB-INF/validation.xml' I guess this implies that it's been loaded right? Well the name of the form matches both javascript tag and validation. 2. Since your html:javascript tag names the form userForm, why isn't your action tag's onSubmit call this: onsubmit=return validateUserForm(this); Sorry, this is what I didn't understand. I thought that the name would be the name of the function declared on the validatior-rules.xml 3. What does your action mapping look like? I should look a bit like this (depending on how you customized it, of course): action path=/atualizaDadosUsuarioAction name=userForm type= validate=true input= forward name=success path= / /action I. The should be the class name of the Action subclass to invoke. II. The validate=true forces the server-side to user the userForm's validate() method provided by the super class ValidatorForm. This allows validation failure to go to the place specified in the input= attribute for your action in the struts-config.xml (or related Struts module) file. III. The should be a place to go (JSP, forward, html page, action) to go to when validation fails. Typically, this is some input form page which is often the page calling the /atualizaDadosUsuarioAction Struts action in the first place. Regards, David Well step 3 looks just like above. I'll try other stuff here. But thanks for the help David. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Array? ArrayList? or .....?
I am creating check boxes in a JSP. I am showing the HTML code to make it simple to illustrate my question. code: H2Check As Many As You Wish/H2 INPUT TYPE=checkbox NAME=emailAddress VALUE=[EMAIL PROTECTED]John Doe/INPUT INPUT TYPE=checkbox NAME=emailAddress VALUE=[EMAIL PROTECTED]Jane Doe/INPUT // followed by tens of thousands of INPUT TYPE=checkbox NAME=emailAddress ... tags I have to get all the e-mail addresses of those who are selected (if a client puts a check mark in the check box). Therefore, I cannot predict ahead of time how many e-mail addresses will be read by my web application (servlet) after the form is submitted. Yes, I am going to have String(s) - e-mail address(es). String [] emailBoxes = request.getParameterValues(emailAddress); My questions is: Because I may have tens of thousands of String(s) and the actual numbers of those String(s) cannot be predicted (we do not know how many will be selected by a certain client), should I still use an Array? What is proper to use in my case; ArrayList or something else? Is this Java statement still a proper one? String [] emailBoxes = getParameterValues(emailAddress); ___ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation in Struts for Required fields
To add to the list: 5. the validator-rules.xml and validation.xml must be in the AppName/WEB-INF directory. 6. Make sure that there is a proper version of the commons-validator.jar file. 7. there is font color=redhtml:errors//font in the .jsp to turn on the validation and to show warning messages in red 8. validation plug-in in the struts-config.xml; -Caroline --- Erik Weber [EMAIL PROTECTED] wrote: Somehow we lost the list on a couple of posts. OK, so, these are the things I assume you have checked so far: 1) you have an html:select tag with property = reportType, and the default option's value is 2) your ActionForm extends one of the proper types (such as ValidatorForm) and has the proper getters and setters for the reportType field 3) in struts-config.xml, you have configured the action (the same one that your form will submit to) with validate = true, and you have named the proper ActionForm to associate with the action (one of your form-bean declarations) 4) the field name in validation.xml matches the field name of your select (reportType), and the form name in validation.xml matches the same form name that you are associating with the action in struts-config.xml (the name of the form configured in the action matches one of your form-bean declarations) What else am I leaving out? Erik Priya Jotwani wrote: Yes I have set the validate= true in and the field names are same too :( -Original Message- From: Erik Weber [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 05, 2004 11:32 PM To: Priya Jotwani Subject: Re: Validation in Struts for Required fields Does the property attribute to html:select have the same value you have specified as the field name in validation.xml (reportType, productLine)? Do you have the validate attribute set to true in struts-config.xml for the relevant action configuration? Erik Priya Jotwani wrote: Hi Erik, I am using html:select tag like below in my JSP html:option value=Select a Product Line/html:option Thanks, Priya -Original Message- From: Erik Weber [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 05, 2004 11:04 PM To: Struts Users Mailing List Subject: Re: Validation in Struts for Required fields In your JSP, where are your selects? Are you using html:select tags to produce them? Erik Priya Jotwani wrote: Hi , I have a JSP Page where I have two dropdowns displaying default values. Before submitting that page, the user should select something from these two dropdowns and if he doesn't selects, there should be an error message displayed on the top saying This field is required. This is what I am doing but it doesn't gives me an error message and am able to proceed to the next page. Any idea as to what could be possibly wrong/missing ? In my validator.xml , I have form name=ClientReportingForm !-- Struts validation -- field property=reportType depends=required arg0 key=prompt.reportType/ /field field property=productLine depends=required arg0 key=prompt.productLine/ /field /form In my ApplicationResources.properties I have prompt.reportType value= Report Type/ prompt.productLinevalue= Product Line/ And in my JSP Page I have logic:messagesPresent message=error bean:message key=errors.header / ul === message truncated === ___ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Array? ArrayList? or .....?
From: Caroline Jen [EMAIL PROTECTED] I have to get all the e-mail addresses of those who are selected (if a client puts a check mark in the check box). Therefore, I cannot predict ahead of time how many e-mail addresses will be read by my web application (servlet) after the form is submitted. I'm confused... is this a Struts webapp? Why use getParameterValues() when the framework will populate your ActionForm for you? In this situation I have a List or Map of items (usually DTOs) to be selected from, use c:forEach to display them, and have a String[] in the ActionForm which Struts will populate with the user's choices. And... tens of thousands of choices?! That's a user-interface nightmare. There has to be a way to narrow down the selection before you present them with checkboxes, nobody is going to go through a list that large. -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Array? ArrayList? or .....?
http://struts.apache.org/faqs/newbie.html#multiple talks briefly about doing this. It doesn't discuss the issue of arrays vs. ArrayList, but the example is using arrays, so I assume that's the recommended approach. Also, and just an FYI, the HTML you've included is invalid. INPUT elements are not allowed to have text inside of them. Instead, put your INPUT element inside a LABEL: LABELINPUT TYPE=checkbox NAME=emailAddress VALUE=[EMAIL PROTECTED] /John Doe/LABEL See http://www.w3.org/TR/html401/interact/forms.html#edef-LABEL for more information on using the LABEL element. -- Jeff Caroline Jen wrote: I am creating check boxes in a JSP. I am showing the HTML code to make it simple to illustrate my question. code: H2Check As Many As You Wish/H2 INPUT TYPE=checkbox NAME=emailAddress VALUE=[EMAIL PROTECTED]John Doe/INPUT INPUT TYPE=checkbox NAME=emailAddress VALUE=[EMAIL PROTECTED]Jane Doe/INPUT // followed by tens of thousands of INPUT TYPE=checkbox NAME=emailAddress ... tags I have to get all the e-mail addresses of those who are selected (if a client puts a check mark in the check box). Therefore, I cannot predict ahead of time how many e-mail addresses will be read by my web application (servlet) after the form is submitted. Yes, I am going to have String(s) - e-mail address(es). String [] emailBoxes = request.getParameterValues(emailAddress); My questions is: Because I may have tens of thousands of String(s) and the actual numbers of those String(s) cannot be predicted (we do not know how many will be selected by a certain client), should I still use an Array? What is proper to use in my case; ArrayList or something else? Is this Java statement still a proper one? String [] emailBoxes = getParameterValues(emailAddress); ___ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
menu doesnot working
hi folks, i have got a problem in struts, i have used putlist/putlist for a simple tree menu design and defined the tiles:importAttribute / but the output doesnot come instead it throws the expection like [ServletException in:/Rendering/sampleNavigation.jsp] Cannot find bean sampleNavigation in any scope' could you pls gimme a solution for this. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Internationalizing a Struts project
Hi there. I'm working on i18n of a Struts based project. All references I find about this topic deal with using messages depending on the user's locale. Has anyone ever experienced problems with national special characters (such as currency symbols for sterling or euro? Hiran - Hiran Chaudhuri SAG Systemhaus GmbH Elsenheimer Straße 11 80867 München Phone +49-89-54 74 21 34 Fax +49-89-54 74 21 99 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
global forwards in module config files
Hello, I am just in the course of moving from 1.0.x to 1.2 and the new version should make heavy use of the modules that came with 1.1. Now here is my problem: I want to store a global forward in any module's config file named moduleHome where module would be replaced with the actual module name. In the main app, I want to have an action loadModule.do that should be told where to forward to via a parameter. While this works well, as long as the global forwards are all in the main config file, it fails as soon as I put them in the individual module-config-files. Is this a known feature, or am I just doing something wrong? This is how it works: - struts-config.xml -- struts-config ... global-forwards forward name=home path=/index.jsp redirect=false/ forward name=loginform path=/login.jsp redirect=false/ forward name=error500 path=/error/err500.jsp redirect=false/ forward name=trylogin path=/loginAction.do redirect=false/ forward name=indexHome contextRelative=true path=/index/index.do redirect=true/ more /global-forwards ... /struts-config - end - this is how it does NOT work: - struts-config.xml -- struts-config ... global-forwards forward name=home path=/index.jsp redirect=false/ forward name=loginform path=/login.jsp redirect=false/ forward name=error500 path=/error/err500.jsp redirect=false/ forward name=trylogin path=/loginAction.do redirect=false/ /global-forwards ... /struts-config - index-config.xml -- struts-config ... global-forwards forward name=indexHome contextRelative=true path=index.do redirect=true/ /global-forwards ... /struts-config - end - many thanks, Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
FormFile Casting problem
Hi, I did read in File using StrutsForm bean and put that into the HashMap. Now, when I try to get it out of the hashMap with like, 1. FormFile file = (FormFile)uploadForm.get(uploadedFile) 2. HashMap map = new HashMap(2); 3. map.put(uploadedFile, file); 4. FormFile file = (FormFile)hashMap.get(uploadedFile); Now, it works fine in window environment, but once I did move the code to Linux side, it throws ClassCastException. your comments would be appreciated. thanks in advance. John
validating inputs using struts
Hi, I'm using jsp/jstl in my pages, and i'd like to validate the inputs using the struts validator. I have configured the application.properties file, the struts-config.xml, created a form bean (testForm.java) that extends the validatorForm and a form action (testAction.java)and even configured the validator.xml but i dont' know how to display the ActionErrors in my page (test.jsp) without using struts tag :html:errors/ only using jstl. I have tried to retrieve the content of the ActionErrors in the testAction but i intializea string to test then add the content of the ActionErrors, then set the errors variable in my jsp file test.jsp, but when the inputs are correct the errors variable in my jsp file is set to its initiale value however when the inputs are wrong, the erros variable is empty. Any idea pls Thx _ Powerful Parental Controls Let your child discover the best the Internet has to offer. http://join.msn.com/?pgmarket=en-capage=byoa/premxAPID=1994DI=1034SU=http://hotmail.com/encaHL=Market_MSNIS_Taglines Start enjoying all the benefits of MSN® Premium right now and get the first two months FREE*. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Search engine friendly URLs
I was talking bollocks (now i've tried it) c:set var=link value=${fn:replace(link,'?','/')} / c:set var=link value=${fn:replace(link,'','/')} / works.. Ideally in a tag file like this,, /WEB-INF/tags/cleanLink.tag %@ tag isELIgnored=false % %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c % %@ taglib uri=http://java.sun.com/jsp/jstl/fmt; prefix=fmt % %@ taglib uri=http://java.sun.com/jsp/jstl/functions; prefix=fn % %@ attribute name=link % c:set var=link value=${fn:replace(link,'?','/')} / c:set var=link value=${fn:replace(link,'','/')} / ${link} .. and use the tag like this. %@ taglib prefix=tags tagdir=/WEB-INF/tags % c:url var=mylink value=/action.do c:param name=one value=firstval / c:param name=two value=firstval / c:param name=three value=firstval / /c:url a href=tags:cleanLink link=${mylink} /click this/a You may need tomcat 5 to do it.. Mark On 5 Oct 2004, at 09:41, Mark Lowe wrote: There's a filter that does URL rewriting already, urlrewrite , mod_rewrite would be okay but who wants to run mod_jk - apache as his/her development environments. http://tuckey.org/urlrewrite/ The only problem then is generating the links. so rather than html:link page=/action.do .. you'd use something like.. c:url var=link value=/action.do c:param name=name value=somevalue / .. and so on /c:url this will render to /appname/action.do?name=somevalue so now lets say you've set a boolean called cleanURL, this means you can switch the functionality off if you want to deactivated urlrewrite during development. An init param in web.xml i suggest would be the best place, but for now lets set in the page. c:set var=cleanURL value=true /' c:if test=${cleanURL} c:forTokens var=badChar items=?, delims=, c:set var=cleanLink value=${fn:replace(link,badChar,'/'}'' / c:set var=link value=${cleanLink} / /c:forTokens /c:if a href=${link}Link/a Once you've set urlrewrite filter up you'll want something like this. rule from/action.do/*/*/from to type=redirect/action.do?$1=$2/to /rule HTH Mark On 2 Oct 2004, at 17:59, David G. Friedman wrote: You should be able to do with in 1.2.4 with WildCard mapping, see section 4.10 - Using Wildcards in Action Mappings. http://struts.apache.org/userGuide/building_controller.html Regards, David -Original Message- From: Ben [mailto:[EMAIL PROTECTED] Sent: Saturday, October 02, 2004 11:53 AM To: Struts; Tomcat Subject: Search engine friendly URLs Hi Is it possible to make the URLs on my site search engine friendly? I am using Tomcat and Struts. I would like to turn: http://localhost/site.do?section=bookssubsection=architecture into this: http://localhost/do/site/books/architecture Regards, Ben - 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]