RE: STRUTS and EJB
Title: RE: STRUTS and EJB If a value object is used within the ActionForm for holding the form data, how should the html elements be named so that the data elements in the value object is automatically populated. Or should the data elements also reside in the ActionForm as separate fields, for which the setters and getters would go and get the information from the value object ? Anand Narayan -Original Message-From: Derek Longmuir [mailto:[EMAIL PROTECTED]]Sent: Thursday, August 23, 2001 1:46 PMTo: '[EMAIL PROTECTED]'Subject: RE: STRUTS and EJB Why not make a Value object for passing the information around, and have the form hold an instance of the value object? Derek. -Original Message- From: Juha Paananen [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 23, 2001 1:47 PM To: [EMAIL PROTECTED] Subject: RE: STRUTS and EJB I also agree on that stuff that has references to STRUTS should not be transmitted to the EJB level. The problem here is simply that I would not want to make another, exactly similar (except "extends ActionForm"), class for transporting the information to the EJB. Of course, I can do that, but I don't like the idea. My question is, is this inheritance of ActionForm really necessary in Struts design? > -Original Message- > From: Ted Husted [mailto:[EMAIL PROTECTED]] > Sent: 23. elokuuta 2001 20:29 > To: [EMAIL PROTECTED] > Subject: Re: STRUTS and EJB > > > I agree with Gregor. The ActionForm beans are best left as ActionForm > beans, and used only as an extension of the html:form tags. Once the > data is validated, it should be transferred to persistent > stoarge, or to > another bean that is not bound to the HTTP layer (and could be re-used > in other environments). This bean can then use the right data-type for > the job, and perform other business tasks that have nothing to do with > gathering input from HTTP. > > On the way back, a good way to repopulate an ActionForm bean, or other > string-based helper, is to have your data access objects return a Map, > and then use it with the standard BeanUtils.populate() method. Struts > does the same thing with the HTTP request, which is basically a Map. > > -- Ted Husted, Husted dot Com, Fairport NY USA. > -- Custom Software ~ Technical Services. > -- Tel +1 716 737-3463 > -- http://www.husted.com/about/struts/ > > Gregor Rayman wrote: > > > > "Juha Paananen" <[EMAIL PROTECTED]> wrote: > > > > > I want to fill in a form JavaBean using a struts form, and after > > > validating it in my Action class, store it into the db > using a session > > > EJB component. The proble here is that I have to extend > ActionForm class > > > to make the bean work with Struts. > > > > You can use containment instead of inheritance. You should > avoid using > > Struts ActionForm on the business logic level. > > > > -- > > gR > ___ Juniper Bank "Rated #1 in Customer Confidence" Gomez Inc., Summer 2001 Internet Credit Card Scorecard www.juniper.com ___ This e-mail and any files transmitted with it may contain confidential and/or proprietary information. It is intended solely for the use of the individual or entity who is the intended recipient. Unauthorized use of this information is prohibited. If you have received this in error, please contact the sender by replying to this message and delete this material from any system it may be on.
Using multiple ActionServlet's
Is anyone using multiple action servlets for one application. For example, if we have a main Action Servlet which delegates to other Action Servlets, each of which accomplish substantial amount of functionality. Any suggestions on the Pros and Cons of this architecture? Thanks Anand Narayan ___ Juniper Bank "Rated #1 in Customer Confidence" Gomez Inc., Summer 2001 Internet Credit Card Scorecard www.juniper.com ___ This e-mail and any files transmitted with it may contain confidential and/or proprietary information. It is intended solely for the use of the individual or entity who is the intended recipient. Unauthorized use of this information is prohibited. If you have received this in error, please contact the sender by replying to this message and delete this material from any system it may be on.
RE: Error messages
How were you able to access the "Collection" object containing the error messages from your extension? Anand Narayan (302) 255-8027 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, August 17, 2001 4:57 PM To: [EMAIL PROTECTED] Subject: Re: Error messages Had to do similar stuff in the prototype I'm working on. We have error icons that the users want displayed beside input fields that had validation failures. So, the direction I leaned towards was a conditional tag if a specific error is present. I could not find a tag provided with Struts that let me do that, so I wrote one. There may have been a way to do it with existing Struts logic tags. example: The tag code is similar to Struts ErrorTag. It would have been best to inherit my tag class straight from Strut's error tag, but it didn't look like it was factored in such a way as to make that possible (I believe the code that looked for errors and assembled them into a collection was mixed in the same method with the code that outputs the error text). This is not a good final solution obviously, but it seems like some kind of conditional error-presence-based-on-property tag is a good general approach for this kind of problem. Jim Weaver Software Developer - ThoughtWorks "Narayan, Anand" To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]> Subject: Error messages 08/17/2001 03:25 PM Please respond to struts-user Using ActionError and the html:ErrorTag I am able to display errors on the page & also format the error messages using errorheader and errorfooter. Is there any way ( Tag or otherwise ) to highlight the field ( field label & the field itself) that the error refers to? e.g Displaying the label and the textbox/checkbox in red. Thanks Anand Narayan (302) 255-8027 ___ Juniper Bank "Rated #1 in Customer Confidence" Gomez Inc., Summer 2001 Internet Credit Card Scorecard www.juniper.com ___ This e-mail and any files transmitted with it may contain confidential and/or proprietary information. It is intended solely for the use of the individual or entity who is the intended recipient. Unauthorized use of this information is prohibited. If you have received this in error, please contact the sender by replying to this message and delete this material from any system it may be on. ___ Juniper Bank "Rated #1 in Customer Confidence" Gomez Inc., Summer 2001 Internet Credit Card Scorecard www.juniper.com ___ This e-mail and any files transmitted with it may contain confidential and/or proprietary information. It is intended solely for the use of the individual or entity who is the intended recipient. Unauthorized use of this information is prohibited. If you have received this in error, please contact the sender by replying to this message and delete this material from any system it may be on.
Error messages
Using ActionError and the html:ErrorTag I am able to display errors on the page & also format the error messages using errorheader and errorfooter. Is there any way ( Tag or otherwise ) to highlight the field ( field label & the field itself) that the error refers to? e.g Displaying the label and the textbox/checkbox in red. Thanks Anand Narayan (302) 255-8027 ___ Juniper Bank "Rated #1 in Customer Confidence" Gomez Inc., Summer 2001 Internet Credit Card Scorecard www.juniper.com ___ This e-mail and any files transmitted with it may contain confidential and/or proprietary information. It is intended solely for the use of the individual or entity who is the intended recipient. Unauthorized use of this information is prohibited. If you have received this in error, please contact the sender by replying to this message and delete this material from any system it may be on.