You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Martin Smith <mf...@erols.com> on 2001/03/01 01:25:08 UTC

Re: Why should you call JSP pages directly?

Because it's simple?

Martin

Jens Rehpöhler wrote:

> Hi all,
>
> I'm watching this list quite a while and wondered why so
> many people try to call there JSP pages directly from the
> browser. In my understanding of the MVC pattern all requests
>
> to your web application must be handled from the controller
> servlet (ActionServlet). The only JSP page which could be
> called directly is the start page of your application, in
> most cases called index.jsp.
>
> By calling the JSP directly you don't seperate the view
> completly from the logic. One bad example is the
> struts-example application. Here, the user authentication is
>
> done in every JSP page by a tag called <app:checkLogon/>. In
>
> my opinion the user authentication is absolutly LOGIC and
> not VIEW. So it should be handled in the controller
> (ActionServlet).
>
> Other problems mentioned in this list are forms with
> predefined values, which can't be handled without an Action
> wich populates a bean. I think this isn't a "bug" but a
> feature. Here you are forced to use the MVC pattern.
>
> Maybe I'm a bit to restrictive in the use of the MVC
> pattern, so I'm very pleased to here why it is a good idea
> to call your JSP directly without a call to the
> ActionServlet.
>
> Jens