Re: validator and dispatch action

2004-03-31 Thread Adam Hardy
It depends on why you wanted to use dispatch action in the first place. Yet another technique is to have multiple actions using the same action class, but with a seperate "parameter='whatever'" attribute, where 'whatever' is 'update', 'delete' etc. In fact you can put most common code in a base

Re: validator and dispatch action

2004-03-31 Thread Mike Foody
Agreed about it being mostly syntactical sugar. On the other hand I think defining multiple mappings for the same Action is extremely useful. It allows you to group your functionality and easily access shared functionality, but also provide alternative validation and forwards without having w

Re: validator and dispatch action

2004-03-31 Thread Paul Barry
You could do this same thing in Strust 1.1, except that you would need the method parameter. In struts 1.1, the links would be: /createSubscription.do?method=create /editSubscription.do?method=edit ... And with MappingDispatchAction they would be /createSubscription.do /editSubscription.do ...

Re: validator and dispatch action

2004-03-31 Thread Mike Foody
Sorry about that link. Frames are a killer ... http://jakarta.apache.org/struts/api/org/apache/struts/actions/MappingDispatchAction.html Mike Foody wrote: If you're not opposed to using 1.2 the MappingDispatchAction will allow you to easily set up multiple action mappings, each capable of hav

Re: validator and dispatch action

2004-03-31 Thread Mike Foody
If you're not opposed to using 1.2 the MappingDispatchAction will allow you to easily set up multiple action mappings, each capable of having their own ActionForm, validation, etc and then actually handle these all with a multiple methods in a single Action class. http://jakarta.apache.org/st

RE: validator and dispatch action

2004-03-31 Thread Marco Mistroni
Adam Hardy [mailto:[EMAIL PROTECTED] Sent: 31 March 2004 17:13 To: Struts Users Mailing List Subject: Re: validator and dispatch action I mean, try changing it in the code in your action when you want to validate, & change it back afterwards to its previous value when done. Is that what you

Re: validator and dispatch action

2004-03-31 Thread Paul Barry
1:29 AM To: Struts Users Mailing List Subject: Re: validator and dispatch action I get this exception: javax.servlet.ServletException: Configuration is frozen Adam Hardy wrote: I mean, try changing it in the code in your action when you want to validate, & change it back afterwards to its

Re: validator and dispatch action

2004-03-31 Thread Adam Hardy
...if it is true sandeep -Original Message- From: Paul Barry [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 31, 2004 11:29 AM To: Struts Users Mailing List Subject: Re: validator and dispatch action I get this exception: javax.servlet.ServletException: Configuration is frozen Adam Hardy wrot

Re: validator and dispatch action

2004-03-31 Thread Adam Hardy
29 AM To: Struts Users Mailing List Subject: Re: validator and dispatch action I get this exception: javax.servlet.ServletException: Configuration is frozen Adam Hardy wrote: I mean, try changing it in the code in your action when you want to validate, & change it back afterwards to its prev

RE: validator and dispatch action

2004-03-31 Thread Takhar, Sandeep
[mailto:[EMAIL PROTECTED] Sent: Wednesday, March 31, 2004 11:29 AM To: Struts Users Mailing List Subject: Re: validator and dispatch action I get this exception: javax.servlet.ServletException: Configuration is frozen Adam Hardy wrote: > I mean, try changing it in the code in your action when you

Re: validator and dispatch action

2004-03-31 Thread Paul Barry
I get this exception: javax.servlet.ServletException: Configuration is frozen Adam Hardy wrote: I mean, try changing it in the code in your action when you want to validate, & change it back afterwards to its previous value when done. Is that what you tried? String oldName = mapping.getName()

Re: validator and dispatch action

2004-03-31 Thread Paul Barry
Ah, I got you now. No, I didn't try that, I will give it a try. Adam Hardy wrote: I mean, try changing it in the code in your action when you want to validate, & change it back afterwards to its previous value when done. Is that what you tried? String oldName = mapping.getName(); mapping.setN

Re: validator and dispatch action

2004-03-31 Thread Adam Hardy
I mean, try changing it in the code in your action when you want to validate, & change it back afterwards to its previous value when done. Is that what you tried? String oldName = mapping.getName(); mapping.setName("widget-edit"); form.validate(mapping, request); mapping.setName(oldName); On 0

Re: validator and dispatch action

2004-03-31 Thread Paul Barry
The name of the action-mapping has to correspond to the name of the form-bean. Adam Hardy wrote: If I really wanted to stick with your set-up, I see a way it might be possible, although I have not done this myself. Try changing the 'name' attribute of the mapping to the validation that you de

Re: validator and dispatch action

2004-03-31 Thread Adam Hardy
If I really wanted to stick with your set-up, I see a way it might be possible, although I have not done this myself. Try changing the 'name' attribute of the mapping to the validation that you defined in the validation.xml, e.g. 'widget-update' or 'widget-edit' and then call the validate() met

validator and dispatch action

2004-03-31 Thread Paul Barry
Hello Everyone, I am using the validator and dispatch actions and I am wonder what the best way to do this is. Consider that I have the following method in a dispatch action: add- populates collections for drop-down lists, forwards to jsp page create - needs to do validation and store in d