Re: Is struts-config too verbose?
Struts Console makes working with the config files alot easier. May alleviate some of your "frustations". http://www.jamesholmes.com/struts/ -james --- Mark <[EMAIL PROTECTED]> wrote: > Ah! Answer a question with a question, I like that > ;) > > I believe its just a matter of setting up additional > forwards. I'll play around a bit with it. > > Thanks for the tips, > > Mark > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Is struts-config too verbose?
Mark Wrote: The problem i see here is, this contact form will always be processed by the same action servlet, and forwarded to the same forward. What If I had several different scenarios that needed to edit/view the contact data, maybe even Different contact data such as User Contact, Customer Contact, etc. So that means that the "save" functionality might be different, and the next page, the "results" might be different. Jacob Writes: You might want to look at WSDL to handle business logic. Struts acts as a presentation controller, the things you are describing can be retained in your business logic layer. That's not to say that you can't chain Actions or even look at DispatchActions to complete your specified tasks. For me, when handling business logic like this, I go with extremely fine granularity (no dispatch actions, I think they are bad news and you can use abstraction and the template method pattern to essentially accomplish the same thing). "For every action, there is an equal reaction-- or a few of them in a chain using the visitor pattern" or something like that. Going back to your requirements of handling different types of Contacts: Let's say we have a ContactActionForm object. I'm assuming the Contact information will change for each type of Contact. Then create an ActionForm for each type that extends ContactActionForm. For each form, bind them to a name in your struts-config. Another possibility is to do a single "Concrete" or "Flat" ActionForm that has all possible attributes for every Contact. Then you can bind that single ActionForm type under multiple names. The reason you want to have multiple bindings, even though they are the same ActionForm is so you can leverage the Validator libraries which act on a bind name basis (same ActionForm, different rules for each bind). For your Actions, lets say you are wanting to save these Contacts. Again, just like you did for the ActionForm, create something that is extensible and leverage the template method pattern so you can outline a path of logic and have each Contact be handled differently. Again, bind each SaveAction to a different name. I think Struts is extremely flexible, just don't depend on it to handle your business logic, but only as a presentation/transport layer for your REAL business objects/services. -Jacob -Original Message- From: Mark [mailto:[EMAIL PROTECTED] Sent: Thursday, February 27, 2003 9:59 PM To: [EMAIL PROTECTED] Subject: Is struts-config too verbose? Looking at struts-config i see an inflexible application skeleton that makes it hard for me to do somethings, or maybe I dont know how the Struts way is...Can someone enlighten me please? I have a Contact form. I want to be able to reuse this contact form, which has standard information such as name, address, etc, in several places in my application. Looking at how action mappings work and all, the form's action field is constant.. Therefore, if i have this: in my jsp: THen inside my action class I have the code to process the form, and forward to the "success" forward. The problem i see here is, this contact form will always be processed by the same action servlet, and forwarded to the same forward. What If I had several different scenarios that needed to edit/view the contact data, maybe even Different contact data such as User Contact, Customer Contact, etc. So that means that the "save" functionality might be different, and the next page, the "results" might be different. Im befuddled how to handle this elegantly. I want to reuse my views. That should be simple shouldnt it? I think im missing something. Thanks in advance. Regards, Mark - 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: Is struts-config too verbose?
Ah! Answer a question with a question, I like that ;) I believe its just a matter of setting up additional forwards. I'll play around a bit with it. Thanks for the tips, Mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Is struts-config too verbose?
It seems to me that it is less verbose than a non-Struts alternative (and certainly not as verbose as the original email ;-) seriously though, action mappings don't really define the usage of a form, they define the usage of an Action class. The way you act on that data is what changes from action mapping to action mapping. You only define the form once. so I'm not sure what the complaint is For your "several different actions" question, take a look at DispatchAction and RelayAction, they should simplify your Actions for you somewhat. also, your html:form tag doesn't need to specify the name of the form either, it will find it via your action specification. > -Original Message- > From: Mark [mailto:[EMAIL PROTECTED] > Sent: Thursday, February 27, 2003 10:04 PM > To: [EMAIL PROTECTED] > Subject: Re: Is struts-config too verbose? > > > Well, I left out a piece > > What I had a problem with was the verbosity of struts-config.xml > > > For every instance of the form, i have to have a seperate, and > almost otherwise duplicate mapping. To me, this is redundant... > > *** REPLY SEPARATOR *** > > On 02/27/2003 at 9:59 PM Mark wrote: > > >Looking at struts-config i see an inflexible application > skeleton that makes it hard for me to do somethings, or maybe I > dont know how the Struts way is...Can someone enlighten me please? > > > >I have a Contact form. I want to be able to reuse this contact > form, which has standard information such as name, address, etc, > in several places in my application. > > > >Looking at how action mappings work and all, the form's action > field is constant.. Therefore, if i have this: > > > > > > > > > > > >in my jsp: > > > > > > > > > >THen inside my action class I have the code to process the form, > and forward to the "success" forward. > > > >The problem i see here is, this contact form will always be > processed by the same action servlet, and forwarded to the same > forward. What If I had several different scenarios that needed > to edit/view the contact data, maybe even Different contact data > such as User Contact, Customer Contact, etc. So that means that > the "save" functionality might be different, and the next page, > the "results" might be different. > > > >Im befuddled how to handle this elegantly. I want to reuse my > views. That should be simple shouldnt it? I think im missing something. > > > > > >Thanks in advance. > > > > > >Regards, > >Mark > > > > > > > >- > >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: Is struts-config too verbose?
How would you like it to work? David From: "Mark" <[EMAIL PROTECTED]> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: Re: Is struts-config too verbose? Date: Thu, 27 Feb 2003 22:04:11 -0600 Well, I left out a piece What I had a problem with was the verbosity of struts-config.xml For every instance of the form, i have to have a seperate, and almost otherwise duplicate mapping. To me, this is redundant... *** REPLY SEPARATOR *** On 02/27/2003 at 9:59 PM Mark wrote: >Looking at struts-config i see an inflexible application skeleton that makes it hard for me to do somethings, or maybe I dont know how the Struts way is...Can someone enlighten me please? > >I have a Contact form. I want to be able to reuse this contact form, which has standard information such as name, address, etc, in several places in my application. > >Looking at how action mappings work and all, the form's action field is constant.. Therefore, if i have this: > > > > > >in my jsp: > > > > >THen inside my action class I have the code to process the form, and forward to the "success" forward. > >The problem i see here is, this contact form will always be processed by the same action servlet, and forwarded to the same forward. What If I had several different scenarios that needed to edit/view the contact data, maybe even Different contact data such as User Contact, Customer Contact, etc. So that means that the "save" functionality might be different, and the next page, the "results" might be different. > >Im befuddled how to handle this elegantly. I want to reuse my views. That should be simple shouldnt it? I think im missing something. > > >Thanks in advance. > > >Regards, >Mark > > > >- >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] _ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is struts-config too verbose?
Hi Mark, What is your contact.Saved action mapping ? In forward don't give another action, simply give some jsp page. If we need pre processing before loading the page then only you give to another action for forward. Thanks & Regards, Ashok.D - Original Message - From: "Mark" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, February 28, 2003 9:29 AM Subject: Is struts-config too verbose? > Looking at struts-config i see an inflexible application skeleton that makes it hard for me to do somethings, or maybe I dont know how the Struts way is...Can someone enlighten me please? > > I have a Contact form. I want to be able to reuse this contact form, which has standard information such as name, address, etc, in several places in my application. > > Looking at how action mappings work and all, the form's action field is constant.. Therefore, if i have this: > > > > > > in my jsp: > > > > > THen inside my action class I have the code to process the form, and forward to the "success" forward. > > The problem i see here is, this contact form will always be processed by the same action servlet, and forwarded to the same forward. What If I had several different scenarios that needed to edit/view the contact data, maybe even Different contact data such as User Contact, Customer Contact, etc. So that means that the "save" functionality might be different, and the next page, the "results" might be different. > > Im befuddled how to handle this elegantly. I want to reuse my views. That should be simple shouldnt it? I think im missing something. > > > Thanks in advance. > > > Regards, > Mark > > > > - > 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: Is struts-config too verbose?
Well, I left out a piece What I had a problem with was the verbosity of struts-config.xml For every instance of the form, i have to have a seperate, and almost otherwise duplicate mapping. To me, this is redundant... *** REPLY SEPARATOR *** On 02/27/2003 at 9:59 PM Mark wrote: >Looking at struts-config i see an inflexible application skeleton that makes it hard >for me to do somethings, or maybe I dont know how the Struts way is...Can someone >enlighten me please? > >I have a Contact form. I want to be able to reuse this contact form, which has >standard information such as name, address, etc, in several places in my application. > >Looking at how action mappings work and all, the form's action field is constant.. >Therefore, if i have this: > > > > > >in my jsp: > > > > >THen inside my action class I have the code to process the form, and forward to the >"success" forward. > >The problem i see here is, this contact form will always be processed by the same >action servlet, and forwarded to the same forward. What If I had several different >scenarios that needed to edit/view the contact data, maybe even Different contact >data such as User Contact, Customer Contact, etc. So that means that the "save" >functionality might be different, and the next page, the "results" might be different. > >Im befuddled how to handle this elegantly. I want to reuse my views. That should be >simple shouldnt it? I think im missing something. > > >Thanks in advance. > > >Regards, >Mark > > > >- >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: Is struts-config too verbose?
There's no rule that says you can only use a form bean with one action. You can define many actions that use the same type of form bean. Also, you don't need to provide the name attribute for the tag because it generates one for you. David From: "Mark" <[EMAIL PROTECTED]> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: Is struts-config too verbose? Date: Thu, 27 Feb 2003 21:59:08 -0600 Looking at struts-config i see an inflexible application skeleton that makes it hard for me to do somethings, or maybe I dont know how the Struts way is...Can someone enlighten me please? I have a Contact form. I want to be able to reuse this contact form, which has standard information such as name, address, etc, in several places in my application. Looking at how action mappings work and all, the form's action field is constant.. Therefore, if i have this: in my jsp: THen inside my action class I have the code to process the form, and forward to the "success" forward. The problem i see here is, this contact form will always be processed by the same action servlet, and forwarded to the same forward. What If I had several different scenarios that needed to edit/view the contact data, maybe even Different contact data such as User Contact, Customer Contact, etc. So that means that the "save" functionality might be different, and the next page, the "results" might be different. Im befuddled how to handle this elegantly. I want to reuse my views. That should be simple shouldnt it? I think im missing something. Thanks in advance. Regards, Mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]