You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mikkel Bruun <mi...@valtech.dk> on 2001/05/15 13:09:46 UTC

Hidding .jsp files

Hi Guys,

Is it possible to make some sort of virtual path, enabling one to hide the
actual .jsp pages???

Example,

i want to avoid a link like /logon/logonform.jsp
replacing it with perhaps /logon (which in turn will point to
/logon/logonform.jsp)

I tried looking at the globalforwards, but i find the documentation quite
lacking (there's an error in the code, btw)...but is this how its done???

Another solution would be to make "empty" action classes that just returns
the succes mapping, but that would be going over the top imho...


Can anybody give an answer???

thanks
Mikkel Bruun



Re: Hidding .jsp files

Posted by William Jaynes <wj...@mediaone.net>.
If I have alot of jsp pages this method would mean alot of entries in
the web.xml file. Isn't there another way?

----- Original Message -----
From: "Scott Walter" <tx...@yahoo.com>
To: <st...@jakarta.apache.org>
Sent: Tuesday, May 15, 2001 8:59 AM
Subject: Re: Hidding .jsp files


> Look into the web.xml file.  Since a JSP page is a
> servlet, you can setup a <servlet> tag for the JSP
> page (instead of specifiying servlet-class, use
> jsp-file).  You will then create a <servlet-mapping>
> to specify the url to listen on.
>
> scott.
> --- Mikkel Bruun <mi...@valtech.dk> wrote:
> > Hi Guys,
> >
> > Is it possible to make some sort of virtual path,
> > enabling one to hide the
> > actual .jsp pages???
> >
> > Example,
> >
> > i want to avoid a link like /logon/logonform.jsp
> > replacing it with perhaps /logon (which in turn will
> > point to
> > /logon/logonform.jsp)
> >
> > I tried looking at the globalforwards, but i find
> > the documentation quite
> > lacking (there's an error in the code, btw)...but is
> > this how its done???
> >
> > Another solution would be to make "empty" action
> > classes that just returns
> > the succes mapping, but that would be going over the
> > top imho...
> >
> >
> > Can anybody give an answer???
> >
> > thanks
> > Mikkel Bruun
> >
> >
>
>
> =====
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Scott
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/


Re: Hidding .jsp files

Posted by Scott Walter <tx...@yahoo.com>.
Look into the web.xml file.  Since a JSP page is a
servlet, you can setup a <servlet> tag for the JSP
page (instead of specifiying servlet-class, use
jsp-file).  You will then create a <servlet-mapping>
to specify the url to listen on.

scott.
--- Mikkel Bruun <mi...@valtech.dk> wrote:
> Hi Guys,
> 
> Is it possible to make some sort of virtual path,
> enabling one to hide the
> actual .jsp pages???
> 
> Example,
> 
> i want to avoid a link like /logon/logonform.jsp
> replacing it with perhaps /logon (which in turn will
> point to
> /logon/logonform.jsp)
> 
> I tried looking at the globalforwards, but i find
> the documentation quite
> lacking (there's an error in the code, btw)...but is
> this how its done???
> 
> Another solution would be to make "empty" action
> classes that just returns
> the succes mapping, but that would be going over the
> top imho...
> 
> 
> Can anybody give an answer???
> 
> thanks
> Mikkel Bruun
> 
> 


=====
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Scott

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

Re: Hidding .jsp files

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Tue, 15 May 2001, Mikkel Bruun wrote:

> Hi Guys,
> 
> Is it possible to make some sort of virtual path, enabling one to hide the
> actual .jsp pages???
> 
> Example,
> 
> i want to avoid a link like /logon/logonform.jsp
> replacing it with perhaps /logon (which in turn will point to
> /logon/logonform.jsp)
> 
> I tried looking at the globalforwards, but i find the documentation quite
> lacking (there's an error in the code, btw)...but is this how its done???
> 
> Another solution would be to make "empty" action classes that just returns
> the succes mapping, but that would be going over the top imho...
> 
> 
> Can anybody give an answer???
> 
> thanks
> Mikkel Bruun
> 
> 
> 

One thing to keep in mind is that, in a typical Struts application, the
names of the JSP pages are obscured anyway -- because the form submits go
to the controller servlet.  For example, walk your way through the Struts
example application, and note how many of the locations actually shown
have "*.do" extensions on them ...

As a more radical way to hide things (but more for the purpose of
discouraging users from setting bookmarks in the middle of an
application), I've also resorted on occasion to more radical approaches:

* Open the application in a window that doesn't have a location bar

* Create a frameset with only one frame in it (so the location bar
  never changes at all).

Craig McClanahan