On Mon, Mar 9, 2009 at 15:58, Gregor Schneider <rc4...@googlemail.com> wrote:
> Len,
>
> agreed to the most of what you said, however, I still do not see why
> JSPs have to go (or should go) into WEB-INF.

Just to hide them from the user, because in this case they're not
intended to be accessed directly by the user.

> On Mon, Mar 9, 2009 at 8:23 PM, Len Popp <len.p...@gmail.com> wrote:
>> What I mean is, clients *never* access a .jsp file by URL, e.g.
>> "http://www.example.com/app/foo.jsp";.
>
> This is definately wrong. When you call a jsp directly from within a
> Servlet-Container, the file gets compiled to a servlet and the output
> of the servlet is displayed.

You're missing my point. I'm talking about a different way to do
things. There is another way to use JSP files, that does not require
the client to access a URL that ends in ".jsp". Look at the
documentation for RequestDispatcher. The idea is, client requests are
handled by servlets, and servlets call JSP files to produce output.
Since the JSP files are only used by the servlets, they do not have
URLs associated with them, so I "hide" them under WEB-INF.

> I've googled for this issue, and what I find, is, that some frameworks
> recommend putting JSPs into WEB-INF/jsp.
> However, I also found the statement that not all Servlet-Containers
> are supporting it.
>
> Now I'm wondering ("Mr. Servlet-Spec" Chuck, you comment on that one):
>
> Is this directory-structure really part of the specs?

Yes, it is. (Oh, I see Chuck has already answered. :-) )

> I just found this recomendation in context with frameworks like Struts
> or Spring.
>
> I'm wondering:
>
> How does Tomcat find a JSP within WEB-INF/jsp? Do I have to specify it
> in the deployment-descriptor?

No, it's invoked by your servlet code via RequestDispatcher.
-- 
Len

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to