No, you can forward to whatever path can be used to construct a
RequestDipatcher object, as shown in the ActionServlet.processForward()
method (which I pasted below). That includes .jsp paths.
Fr.

    /**
     * Process a forward requested by this mapping, if any.  Return
     * <code>true</code> if processing of this request should continue (i.e.
     * be processed by an Action class), or <code>false</code> if we have
     * already handled this request.
     *
     * @param mapping The ActionMapping we are processing
     * @param request The request we are processing
     * @param response The response we are processing
     *
     * @exception IOException if the included resource throws an exception
     * @exception ServletException if the included resource throws an
     *  exception
     */
    protected boolean processForward(ActionMapping mapping,
                                     HttpServletRequest request,
                                     HttpServletResponse response)
        throws IOException, ServletException {

        // Are we going to process this request?
        String forward = mapping.getForward();
        if (forward == null)
            return (true);
        
        //unwrap the multipart request if there is one
        if (request instanceof MultipartRequestWrapper) {
            request = ((MultipartRequestWrapper) request).getRequest();
        }
        // Construct a request dispatcher for the specified path
        RequestDispatcher rd =
            getServletContext().getRequestDispatcher(forward);
        if (rd == null) {
            response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                               internal.getMessage("requestDispatcher",
                                                   forward));
            return (false);
        }


-----Original Message-----
From: Gregor Rayman [mailto:[EMAIL PROTECTED]]
Sent: 17 July 2001 13:29
To: [EMAIL PROTECTED]
Subject: Re: URL mapping


Of course. But with this action-forward approach, you can forward only *.do
URLs.
Please correct me, if I am wrong.

--
gR


----- Original Message -----
From: "Rey Francois" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 17, 2001 12:25 PM
Subject: RE: URL mapping


> You could, but I would favor the use of the 'forward' attribute in the
> 'action' element in the struts-config.xml.
> Here is an extract of the documentation in the DTD:
>      forward         Context-relative path of the servlet or JSP resource
> that
>                      will process this request, instead of instantiating
and
>                      calling the Action class specified by "type".
Exactly
> one
>                      of "forward", "include", or "type" must be specified.
>
>
> Doing it this way makes it very easy to map to an action at a later stage
if
> the requirements have changed.
>
> Fr.
>
>
> -----Original Message-----
> From: Gregor Rayman [mailto:[EMAIL PROTECTED]]
> Sent: 17 July 2001 12:25
> To: [EMAIL PROTECTED]
> Subject: Re: URL mapping
>
>
> "Chris Callaghan" <[EMAIL PROTECTED]> asks:
>
>
> > Hey all,
> >
> > I want to be able to map a URL to certain JSPs which may or may not have
> > an action involved with them e.g
> > map /logon to logon.jsp which also has as action also called logon
> > also /tour to tour.jsp which has no associated action.
> >
> > How can I do this with struts?
> >
> > Cheers
> > Chris
>
> You can do it with your http server, not with struts.
>
> --
> gR
>
> ************************************************************************
> The information in this email is confidential and is intended solely
> for the addressee(s).
> Access to this email by anyone else is unauthorised. If you are not
> an intended recipient, you must not read, use or disseminate the
> information contained in the email.
> Any views expressed in this message are those of the individual
> sender, except where the sender specifically states them to be
> the views of Capco.
>
> http://www.capco.com
> ***********************************************************************
>

************************************************************************
The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***********************************************************************

Reply via email to