RE: Newby - Looking for more idiot-proof documentation
You might this link very useful http://husted.com/about/scaffolding/strutByStrut.htm HTH Jeffy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 08, 2002 5:58 PM To: [EMAIL PROTECTED] Subject: Newby - Looking for more idiot-proof documentation Ok, so I am in love with what I see so far about struts. Bud god forbid, I can't even begin to imagine how to build anything with struts. I have scoured the documentation and find them to be lacking the tutorial-like quality that idiots like me require. Can anyone recommend any online references? I have done the tutorial in the HP trailmap. Can't seem to find anything else. Ordered a book, but it will not be here for a while as it is not yet published, I just learned. Arggghhh. Thanks in advance, - Cody The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Struts-config.xml
I hope someone can provide me a sample struts-config.xml snippet for my workflow stated as below: 1. A form is displayed to the user. The form has some fields with defaults values (i.e. current date etc) and blank fields 2. The form has the following actions permitted: SAVE (update/insert), DELETE and RESET 3. When the user SAVES, a form validate might restrict the save, a validation in the action class might restrict the save, database exception might restrict the save, or the save is successful. In all these cases, the user is displayed the same form with data entered by the user with a notification of the success or failure of the action at the top of the form. 4. When the user DELETES, on error the same form is displayed with the error on top. if successful, a blank form is displayed with a message on top informing the user that the delete was successful 5. When the user RESETS, a blank form is displayed with no messages on top of the form. Thanks -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts-config.xml
Thanks Ted, I checked the URL and I am doing something similar using JavaScript. I have a question.. My forwards is as below forward name=update path=/do/prospect/Store/ forward name=reset path=/do/prospect/Store/ forward name=delete path=/do/prospect/Store/ pls note all forwards are same I do the following for a delete action now if(action.equals(delete) success) form.reset(); return mapping.findForward(request.getParameter(forward)); another scenario if(action.equals(insert){ int success = data.insert(); //something similar if(Constants.SUCCESSFUL) errors.add(new ActionError(error.save.successful)); else if (Constants.DATBABASE_ERROR) errors.add(new ActionError(error.save.databaseerror)); else if (Constants.GENERAL_ERROR) errors.add(new ActionError(error.save.systemerror)); } return mapping.findForward(request.getParameter(forward)); Is there a better way? Thanks. for ref from http://jguru.com/faq/view.jsp?EID=543699 QUOTE A good trick here is to use a generic routing or relay action, so you don't have to hardcode some type of switch into the Action. It's just one line in the perform method: return mapping.findForward(request.getParameter(forward)); This can be used any number of times in a Struts application, just by changing the form bean and the local forwards in its mapping. action path=/prospect/Submit type=org.apache.scaffold.http.RelayAction name=prospectForm scope=request validate=false forward name=update path=/do/prospect/Store/ forward name=cancel path=/do/prospect/Current/ UNQUOTE -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED]] Sent: Sunday, January 06, 2002 10:52 AM To: Struts Users Mailing List Subject: Re: Struts-config.xml What you are really asking is how to have different buttons fire different actions. There are several approach to this. The JavaScript approach is described here: http://jguru.com/faq/view.jsp?EID=543699 There is also the new org.apache.struts.actions.LookupDispatchAction in the nightly build. Also in the contrib folder of the nightly build, there is a package called scaffold with another standard Action, org.apache.scaffold.http.FindForwardAction (my personal favorite). -- Ted Husted, Husted dot Com, Fairport NY USA. -- Building Java web applications with Struts. -- Tel +1 585 737-3463. -- Web http://www.husted.com/struts/ Rajan, Jeffy wrote: I hope someone can provide me a sample struts-config.xml snippet for my workflow stated as below: 1. A form is displayed to the user. The form has some fields with defaults values (i.e. current date etc) and blank fields 2. The form has the following actions permitted: SAVE (update/insert), DELETE and RESET 3. When the user SAVES, a form validate might restrict the save, a validation in the action class might restrict the save, database exception might restrict the save, or the save is successful. In all these cases, the user is displayed the same form with data entered by the user with a notification of the success or failure of the action at the top of the form. 4. When the user DELETES, on error the same form is displayed with the error on top. if successful, a blank form is displayed with a message on top informing the user that the delete was successful 5. When the user RESETS, a blank form is displayed with no messages on top of the form. Thanks -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Creating reports in PDF format
Both the options iText and FOP does not work so well for creating large PDF files. You will end up with getting an Out of memory error. These option are good if you want to create a few pages. If this is not the case you should look into the various third party tools available. -Original Message- From: Jin Bal [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 03, 2002 5:00 AM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: Creating reports in PDF format There's a fairly obscure but useful japanese package called keisuken that contains an excel reader/writer - Original Message - From: Ajay Chitre [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, December 27, 2001 7:20 PM Subject: RE: Creating reports in PDF format Thank you both - Fang Robert - for the info. I will look at both options - iText FOP. Looks like if I want to use FOP, I will have to create the report using XSL, right? How about Excel? In the past I have used a product called Bridge2Java from IBM to create a report in the Excel format. But as far as I know it only works on Windows based servers. My current web app is deployed on Unix box, so I don't think I can use Bridge2Java. I know this is probably going to sound stupid, but I have to ask - Is there a platform independent product that will allow me to create a report in Excel format? Once the report is created on the server I can let the user download it via browser. Has anybody done anything like this? Thanks again! -- Original Message -- Depends upon how complex the report will be. I have done some of this kind of transformation before. One API is iText, which you can find from http://www.lowagie.com/iText/. My experience with iText is that it has some bugs to deal with table if the table needs to span several pages. Other than that, it is pretty good. Also from Apache XML project, you can find FOP. FOP allows you to transform a XML-based document, normally *.fo file, into a PDF file. Hope it help. -Original Message- From: Ajay Chitre [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 27, 2001 11:25 AM To: [EMAIL PROTECTED] Subject: Creating reports in PDF format Hello, I have created a struts based web application which, among other things, allows users to create reports based on certain selection criteria. A new user requirement has come up which requires the reports to be displayed in PDF format (and Excel). Has anybody done anything similar in the past? I would greatly appreciate your help. I recall seeing emails regarding a simillar issue, but I can't find them in the mail archives! Please help. Thanks. Ajay Chitre Diligent Team, Inc. (Where Diligent People Work as a Team) http://www.DiligentTeam.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]