struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jin Bal" <jin...@hotmail.com>
Subject Re: frame page src=?
Date Fri, 15 Feb 2002 16:13:26 GMT
If you're calling jsp's directly then you just call them as you would any
other static resource such as a link or image.  If you're jsp's are undert
WEB-INF then on some containers they;re hidden from direct view (I think!!
not sure).  In our apps we never call a jsp directly we always call actions
which forward to jsps.  If call to the jsp requires no processing and you
think that creating an individual action for each "static" (so to speak) jsp
is extraneous then you could create a generic StaticPageAction that takes a
context relative path to a jsp/html page.

 The code for the action consists of nothing more than reading the request
parameter and creating a new ActionForward Object and returning that.

I.E.
        String page = request.getParameter("page");
        ActionForward fwd = new ActionForward(/"+"index.html");
        if(page !=null ) {
            fwd = new ActionForward("/"+page);
        }

        return fwd;

where page = /jsps/some.jsp

BEWARE: You could us this approach to serve ALL static content even images
etc.  But remember anything called through an action is served by the
JSP/servlet engine and may place unecessary stress and load on the container
that could otherwise be handled by Apache (all static content).  It is wise
therefore to use comon sense when using this approach.  We only use this
approach if we want to maintain session (we use our own session management)
through a SecureStaticPageAction that performs a security/session check
before forwarding to the static resource/page.

HTH
Jin
----- Original Message -----
From: "Henry Lu" <zhlu@umich.edu>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
Sent: Friday, February 15, 2002 3:17 PM
Subject: Re: frame page src=?


> Thanks for your suggestion. For something.do, it works now. But how bout a
> jsp page. How do we specify a jsp page like:
>
> src="/so/so/somejsp.jsp"
>
> It seems to me that the above setting doesn't work. Any working code for
> jsp page specification?
>
>
> --------------------------------------------------------------------------
-
> Henry Lu
> MCIT                                            phone: (734) 936-2063
> University of Michigan Medical Center           fax:   (734) 763-4372
>
> On Fri, 15 Feb 2002, Jin Bal wrote:
>
> > What kind of errors do you receive?.  Can you call  "something.do" from
the
> > url bar? are you using extension mapping or path mapping?
> >
> > We use extension mapping (xxx.do).  We call the url for the action in
the
> > frame src= in the same way you would call an image or something i.e.
> > /home.do or something
> > ----- Original Message -----
> > From: "Henry Lu" <zhlu@umich.edu>
> > To: "Jin Bal" <jinbal@hotmail.com>
> > Cc: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
> > Sent: Friday, February 15, 2002 2:15 PM
> > Subject: Re: frame page src=?
> >
> >
> > > No it doesn't work either. Could you show me a working examples?
> > >
> > >
> >
> --------------------------------------------------------------------------
> > -
> > > Henry Lu
> > > MCIT                                            phone: (734) 936-2063
> > > University of Michigan Medical Center           fax:   (734) 763-4372
> > >
> > > On Fri, 15 Feb 2002, Jin Bal wrote:
> > >
> > > > how about
> > > > src=something.do
> > > > ----- Original Message -----
> > > > From: "Henry Lu" <zhlu@umich.edu>
> > > > To: <struts-user@jakarta.apache.org>
> > > > Sent: Friday, February 15, 2002 1:34 PM
> > > > Subject: frame page src=?
> > > >
> > > >
> > > > > How to specify src path in the frame tag under struts?
> > > > >
> > > > > I did the following and it didn't work
> > > > >
> > > > > src="/WEB-INF/jsp/login/blank.jsp"
> > > > > neither
> > > > > src="/do/someting"
> > > > > neither
> > > > > src="/jsp/login/blank.jsp"
> > > > >
> > > > > Could you show me an example?
> > > > >
> > > > >
> > > >
> >
> --------------------------------------------------------------------------
> > > > -
> > > > > Henry Lu
> > > > > MCIT                                            phone: (734)
936-2063
> > > > > University of Michigan Medical Center           fax:   (734)
763-4372
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > > <mailto:struts-user-unsubscribe@jakarta.apache.org>
> > > > > For additional commands, e-mail:
> > > > <mailto:struts-user-help@jakarta.apache.org>
> > > > >
> > > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > <mailto:struts-user-unsubscribe@jakarta.apache.org>
> > > > For additional commands, e-mail:
> > <mailto:struts-user-help@jakarta.apache.org>
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <mailto:struts-user-unsubscribe@jakarta.apache.org>
> > > For additional commands, e-mail:
> > <mailto:struts-user-help@jakarta.apache.org>
> > >
> > >
> >
> > --
> > To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>
>
>

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


Mime
View raw message