You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by debussy007 <de...@gmail.com> on 2007/08/05 14:32:36 UTC

MVC2 question

Hello all,

I understand the benefit of having a controller for each possible user
action.
But what is the benfit of having the front controller dispatching the
request to the appropriate controllers ?
Why not calling the appropriate controller directly ?

Thank you for any help.
-- 
View this message in context: http://www.nabble.com/MVC2-question-tf4219667.html#a12004319
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Reg : Client side Validation on Indexed Collection

Posted by Laurie Harper <la...@holoweb.net>.
kukreja sanjeev wrote:
> Hi ,
>     I am trying to put validations on indexed collection.
>   Is there any way I can have that in validation-<action>.xml file.
>   It would be great if you can  pls.throw some light on it.

Which version of Struts are you using? Struts 1 lets you specify 
multiple validation files in the configuration, but wont automatically 
search for per-action validation files.

Struts 2 can find validation rules in various places automatically, 
including per-action files. See 'Defining Validation Rules' in the 
validation documentation [1] for details.

L.

[1] http://struts.apache.org/2.x/docs/validation.html

ObWhine: please don't post unrelated questions to an existing thread. Be 
sure to start a new thread (with an appropriate subject) by sending a 
fresh message to the list, rather than using Reply To.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: MVC2 question

Posted by Leon Rosenberg <ro...@googlemail.com>.
On 9/3/07, Alexandre Seabra <al...@gmail.com> wrote:
> Leon,
>
> Frist of all, I wanna say hi to the community. I just sign in the
> list, and hope we have a good time!

welcome aboard.

>
> I don't remember reading a book about MVC2, but informaly, with
> friends at work, this subject comes up some times. The MVC2 is not
> doesn 't depend on struts. Struts uses is implemented using its
> strategy. In youu message, topic 5, talk about the essetial part of
> MVC2. You don't need to map all servelts. You can map ALL requests to
> one same servelt and use a factory command pattern so take you request
> (same strategy that actions are created).
> The fact that there is only one controlled entrance to you program,
> tell if you have a MVC or MVC2.
> I hope I made myself clear.

Well. I've read another definition from sun:

The MVC2 architecture is actually a modified MVC implementation. The
major modification
is that the Model no longer fires events to its Views.

http://www.sun.com/software/sunone/docs/arch/chapter8.pdf

However its just another buzzword they tried to invent... (Especially
since they totally screwed the MVC1 definition).

Patterns are guidelines. There are thousands of ways to implement same
pattern for a special case. We really don't need to invent a new name
each time. Otherwise we'll have MVC150 by tomorrow.

regards
Leon

>
> Alexandre
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: MVC2 question

Posted by Alexandre Seabra <al...@gmail.com>.
Leon,

Frist of all, I wanna say hi to the community. I just sign in the
list, and hope we have a good time!

I don't remember reading a book about MVC2, but informaly, with
friends at work, this subject comes up some times. The MVC2 is not
doesn 't depend on struts. Struts uses is implemented using its
strategy. In youu message, topic 5, talk about the essetial part of
MVC2. You don't need to map all servelts. You can map ALL requests to
one same servelt and use a factory command pattern so take you request
(same strategy that actions are created).
The fact that there is only one controlled entrance to you program,
tell if you have a MVC or MVC2.
I hope I made myself clear.

Alexandre

On 9/3/07, Leon Rosenberg <ro...@googlemail.com> wrote:
> 1) there is no such thing as MVC2.
> You are probably mixing things up: Model2 for JSP Development and MVC Pattern.
>
> 2) If you are talking about struts 2, there is a major difference
> between a servlet and an action, since the action incorporates both,
> request data and logic, which servlet doesnt.
>
> 3) If you are talking about struts 1, you have to take in mind, that a
> servlet is much more heavyweighted as an action.
> You can't control the servlet's creation, what you can do with
> actions, since you (or the framework for you) are creating the action
> at the point they are needed.
> You can't control number of the instances of the servlet, its servlet
> containers decision.
>
> 4) if you stick with the servlet interface you have to manage request
> dispatching yourself in each servlet, again and again.
>
> 5) You have to map each servlet in the web.xml, blowing it for an app
> which has like 100 actions.
>
> 6) It's easier to create a class hierachy with actions as with
> servlets (still its possible with servlets too), sharing generic
> methods across actions.
>
> 7) it's easier to test it with mock objects.
>
> 8). It just looks better :-)
>
> Leon
>
> On 9/1/07, debussy007 <de...@gmail.com> wrote:
> >
> >
> > Instead of having one front servlet, have one servlet for one action.
> > Sounds more oriented object to me.
> >
> >
> > newton.dave wrote:
> > >
> > > --- debussy007 <de...@gmail.com> wrote:
> > >> what is the benfit of having the front controller
> > >> dispatching the request to the appropriate
> > > controllers?
> > >> Why not calling the appropriate controller directly?
> > >
> > > How would you do that?
> > >
> > > d.
> > >
> > >
> > >
> > >
> > > ____________________________________________________________________________________
> > > Shape Yahoo! in your own image.  Join our Network Research Panel today!
> > > http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > >
> > >
> >
> > --
> > View this message in context: http://www.nabble.com/MVC2-question-tf4219667.html#a12437988
> > Sent from the Struts - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Atenciosamente,
         Alexandre Seabra.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: MVC2 question

Posted by Leon Rosenberg <ro...@googlemail.com>.
1) there is no such thing as MVC2.
You are probably mixing things up: Model2 for JSP Development and MVC Pattern.

2) If you are talking about struts 2, there is a major difference
between a servlet and an action, since the action incorporates both,
request data and logic, which servlet doesnt.

3) If you are talking about struts 1, you have to take in mind, that a
servlet is much more heavyweighted as an action.
You can't control the servlet's creation, what you can do with
actions, since you (or the framework for you) are creating the action
at the point they are needed.
You can't control number of the instances of the servlet, its servlet
containers decision.

4) if you stick with the servlet interface you have to manage request
dispatching yourself in each servlet, again and again.

5) You have to map each servlet in the web.xml, blowing it for an app
which has like 100 actions.

6) It's easier to create a class hierachy with actions as with
servlets (still its possible with servlets too), sharing generic
methods across actions.

7) it's easier to test it with mock objects.

8). It just looks better :-)

Leon

On 9/1/07, debussy007 <de...@gmail.com> wrote:
>
>
> Instead of having one front servlet, have one servlet for one action.
> Sounds more oriented object to me.
>
>
> newton.dave wrote:
> >
> > --- debussy007 <de...@gmail.com> wrote:
> >> what is the benfit of having the front controller
> >> dispatching the request to the appropriate
> > controllers?
> >> Why not calling the appropriate controller directly?
> >
> > How would you do that?
> >
> > d.
> >
> >
> >
> >
> > ____________________________________________________________________________________
> > Shape Yahoo! in your own image.  Join our Network Research Panel today!
> > http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> >
>
> --
> View this message in context: http://www.nabble.com/MVC2-question-tf4219667.html#a12437988
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Reg : Client side Validation on Indexed Collection

Posted by kukreja sanjeev <sa...@yahoo.com>.
Hi ,
    I am trying to put validations on indexed collection.
  Is there any way I can have that in validation-<action>.xml file.
  It would be great if you can  pls.throw some light on it.
   
  Thanks in advance,
  Sanjeev
   

       
---------------------------------
Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.

Re: MVC2 question

Posted by debussy007 <de...@gmail.com>.

Instead of having one front servlet, have one servlet for one action.
Sounds more oriented object to me.


newton.dave wrote:
> 
> --- debussy007 <de...@gmail.com> wrote:
>> what is the benfit of having the front controller 
>> dispatching the request to the appropriate
> controllers?
>> Why not calling the appropriate controller directly?
> 
> How would you do that?
> 
> d.
> 
> 
> 
>      
> ____________________________________________________________________________________
> Shape Yahoo! in your own image.  Join our Network Research Panel today!  
> http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/MVC2-question-tf4219667.html#a12437988
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: MVC2 question

Posted by Dave Newton <ne...@yahoo.com>.
--- debussy007 <de...@gmail.com> wrote:
> what is the benfit of having the front controller 
> dispatching the request to the appropriate
controllers?
> Why not calling the appropriate controller directly?

How would you do that?

d.



      ____________________________________________________________________________________
Shape Yahoo! in your own image.  Join our Network Research Panel today!   http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org