You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2004/06/25 19:41:13 UTC

DO NOT REPLY [Bug 29809] New: - Wrapping HttpServletRequest

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29809>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29809

Wrapping HttpServletRequest

           Summary: Wrapping HttpServletRequest
           Product: Struts
           Version: Nightly Build
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Struts-Faces Library
        AssignedTo: dev@struts.apache.org
        ReportedBy: mailings@matthias-wessendorf.de


i, i tried the faces-struts-lib with RI.
It works.

But not with Open-Source-Implementation *MyFaces*.
i notices, that in struts-faces the servletPath is
a *.do (or that for struts).

But it must be an faces-mapping for servlet-Path
(*.faces e.g.)
the FacesRequestProcessor know if request is for
ActionSerclet or not.

If not, it delegates it to JSF-Impl.
Base of checking is a URI, that is configed 
in <forward name="success" path="/test.faces"/> (e.g.)

so i wrote a simple HttpServletRequestWrapper
which wrappes the uri as new ServletPath.
now everything is fine.

like this (in FacesRequesProcessor)
<code>
           FacesContextFactory fcf = (FacesContextFactory)
 
FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);

                HttpServletRequestWrapper wrapper = new
HttpServletRequestWrapper(request,uri);


            context = fcf.getFacesContext(servlet.getServletContext(),
wrapper,
                                          response, lifecycle); 
</code>
it is not an error in myfaces-impl. 
it is an bug in the RI.

please see the email of Ted Husted (on myfaces-list)
<ted>

On Wed, 23 Jun 2004 20:21:49 -0700,
myfaces-develop-request@lists.sourceforge.net wrote:
> the MyFaces implementation is correct in this aspect and I don't think

> we should clone the bugs of the RI just because struts relies on them.

> I hope spec-compliant does not mean we have to have the same bugs the
> RI has ;-)? By the way, if the RI is fixed, struts will not work there

> any longer, too.

The RI and Struts-Faces were created in tandem, so it's not surprising the same
assumptions crop up in each. But, no, specification-compliant does not mean that
we should rely on bugs in any implementation, including the RI. In fact, the
Struts tradition has been to expose bugs in implementations so that vendors are
compelled to fix them. 

If you develop any patches you would like applied, please bring them to my
attention. Once we can get 1.2.1 out-the-door (could be this week), we will be
setting up several subprojects, including Struts-Faces, that can be released
separately. 

> So the clean solution from my point of view is to fix the issue in
> struts. For example it would be possible to wrap the servlet request 
> before the FacesContext is created. The wrapper takes the uri of the 
> view to be displayed to simulate a valid jsf servlet path for the view

> manager. What do you think?
>
> Oliver

</ted>


and here is the simple wrapper-class:



Cheers,
Matthias

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org