It's my understanding that the inaccessiblity of files placed in
WEB-INF is part of the servlet specification.

Thus, this is true if you're using Spring, JSF, Struts, WebWorks,
Click, WebObjects, or anything else.

What it does is makes it illegal to directly request any resource with
a URL that contains /WEB-INF/ in the path.

So, if you want to use

http://localhost/mywebapp/index.jsp
http://localhost/mywebapp/xxx.jsp

then your default *.jsp-processing servlet needs to either have a
method in the code to fetch the hidden page, or you need to move your
jsp files out of WEB-INF.

Note that I'm no expert in this area, so some of this information is
possibly incorrect.

On 1/13/06, wch zll <[EMAIL PROTECTED]> wrote:
> Hi,
>
> In Spring it says put jsp files in WEB-INF can protect
> your files from direct access, but Spring has its own
> lib, so in spring.xml file has
> <bean
> id="viewResolver"class="org.springframework.web.servlet.view.InternalResourceViewResolver
> ">
>     <property name="viewClass">
> <value>org.springframework.web.servlet.view.JstlView</value>
>     </property>
>     <property
> name="prefix"><value>/WEB-INF/jsp/</value></property>
>     <property
> name="suffix"><value>.jsp</value></property>
> </bean>
>
> So here it has "prefix" and "suffix", so the yyy.jsp
> inside WEB-INF/jsp/ can still be access while
> http://localhost/mywebapp/yyy.jsp
>
> So i am just wondering in myFaces, is there any
> configuration also this kind of functionality.
>
>
>
> Thanks!
>
>
>
> --- Jeffrey Porter
> <[EMAIL PROTECTED]> wrote:
>
> >
> > In you're first email you said want to access..
> > > http://localhost/mywebapp/yyy.jsp,
> >
> > In your second message, you said you want it to be
> > protected.
> >
> > So if you want yyy.jsp to be protected, then why are
> > you trying to get
> > direct access to it?
> >
> > I presume was you would want to use yyy.jsp as an
> > include later on,
> > rather than direct access to it. For example...
> >
> > <%@ include file="/WEB-INF/jsp/include.jsp" %>
> >
> >
> > I could be completely wrong about this. I've not
> > used the spring frame
> > work.
> >
> > JP
> >
> >
> >
> > -----Original Message-----
> > From: wch zll [mailto:[EMAIL PROTECTED]
> > Sent: 13 January 2006 13:03
> > To: MyFaces Discussion
> > Subject: RE: abt how to locate jsp file and the
> > syntax of
> > myfaces-config.xml
> >
> > Hi,
> > To have yyy.jsp inside WEB-INF/jsp so that people
> > won't get direct access via
> > http://localhost/mywebapp/WEB-INF/jsp/yyy.jsp. It's
> > something called proteced that was recommonded by
> > SpringFramework. Their samples are all in this kind
> > of
> > folder structure. But Spring has its syntax as
> > <bean id="viewResolver"
> >
> class="org.springframework.web.servlet.view.InternalResourceViewResolver
> > ">
> >         <property name="viewClass">
> >
> >
> <value>org.springframework.web.servlet.view.JstlView</value>
> >         </property>
> >         <property
> >
> name="prefix"><value>/WEB-INF/jsp/</value></property>
> >         <property
> > name="suffix"><value>.jsp</value></property>
> >     </bean>
> > to resovle this. But i can't find any statement abt
> > how resovle this using myFaces.
> >
> >
> >
> > Best Regards!
> >
> >
> >
> >
> > --- Jeffrey Porter
> > <[EMAIL PROTECTED]> wrote:
> >
> > > Why do you have the yyy.jsp under WEB-INF ?
> > >
> > >
> > >
> > >
> > > -----Original Message-----
> > > From: wch zll [mailto:[EMAIL PROTECTED]
> > > Sent: 13 January 2006 12:50
> > > To: myfaces
> > > Subject: abt how to locate jsp file and the syntax
> > > of myfaces-config.xml
> > >
> > > Hi,
> > >
> > > I have a standard web application, it's arranged
> > in
> > > very normal way. The structure of folders like:
> > >
> > > mywebapp
> > > index.jsp
> > > xxx.jsp
> > > --css
> > >   --some css files
> > > --jscript
> > >   --some js files
> > > --images
> > >   --some images
> > > --WEB-INF
> > >   --web.xml
> > >   --myfaces-config.xml
> > >   --classes
> > >     --com
> > >       --work
> > >         --ecs
> > >           --some java files
> > >   --jsp
> > >     --yyy.jsp
> > >
> > > the problem now is how I can launch the page by
> > > http://localhost/mywebapp/index.jsp
> > > http://localhost/mywebapp/xxx.jsp
> > >
> > > but i can't launch
> > > http://localhost/mywebapp/yyy.jsp,
> > > error is page not found. I know this error would
> > > occur
> > > since yyy.jsp is in WEB-INF/jsp/,
> > > but if I want launch this yyy.jsp, then how should
> > I
> > > configure web.xml or myfaces-config.xml? So can
> > set
> > > the path.
> > >
> > >
> > > Best Regards!
> > >
> > > chaohe
> > >
> > >
> > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam
> > > protection around
> > > http://mail.yahoo.com
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> > protection around
> > http://mail.yahoo.com
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>

Reply via email to