myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Freedman <michael.freed...@oracle.com>
Subject Re: MyFaces JSF-Portlet Bridge and Facelets
Date Thu, 17 Jun 2010 17:01:47 GMT
So I tried running the (new) facelets example that is part of the bridge 
project using MyFaces 1.2.2 on Jetty/Pluto and all worked as expected.  
I was verifying the portlet 1.0 bridge version NOT the portlet 2.0 
bridge version -- but the examples are the same.  Did you get a chance 
to try the example?  How does it differ from what you have done?
    -Mike-

On 6/15/2010 3:24 AM, Rossen Stoyanchev wrote:
>
> For some reason I'm not getting the messages from the user list. I've 
> pasted the response below for reference...
>
> I am referencing the following Maven dependencies:
>
> org.apache.myfaces.portlet-bridge, portlet-bridge-api, 2.0.2-alpha-2
> org.apache.myfaces.portlet-bridge, portlet-bridge-impl, 2.0.2-alpha-2
>
> I will try the code in trunk as well. I'm pretty sure I'm not using 
> anything related to MyFaces 1.1.
>
> Rossen
>
> --------------
>
> Re: MyFaces JSF-Portlet Bridge and Facelets
> Michael Freedman
> Thu, 10 Jun 2010 08:06:17 -0700
>
> What bridge are you using? It sounds like the myfaces bridge that was 
> included in MyFaces 1.1. The information referenced in the cited 
> posting concerning the provided portletFaceletViewHandler concerns the 
> JSR 301/329 bridges (Portlet 1.0 Bridge for JavaServer Faces 1.2 and 
> Portlet 2.0 Bridge for JavaServer Faces 1.2) whose RIs are developed 
> in as a MyFaces subproject 
> (http://myfaces.apache.org/portlet-bridge/index.html). This is a 
> completely different bridge and is designed to only run on JSF 1.2. If 
> you combine this bridge with a JSF 1.2 impl and the facelets jars + 
> the cited PortletFaceletViewHandler things should work. In fact if you 
> grab/build the code out of SVN there is now a facelets example that is 
> part of the project.
>
> FYI ... JSR 301/this bridge as per spec no longer returns null for 
> getRequestServletPath but rather the computed servlet path based on 
> the target view and the known FacesServlet mapping.
>   -Mike-
>
> --------------
>
> Rossen Stoyanchev wrote:
>> Hi,
>>
>> I've read the following thread:
>> http://www.mail-archive.com/users@myfaces.apache.org/msg55211.html
>>
>> I tried using the provided implementation of 
>> PortletFaceletViewHandler along with com.sun.facelets 1.1.14 without 
>> success. After some though investigation I don't see how this 
>> implementation could work.
>>
>> This is the stack trace:
>>
>> Caused by: java.lang.NullPointerException
>>    at 
>> org.apache.myfaces.application.DefaultViewHandlerSupport.calculateFacesServletMapping(DefaultViewHandlerSupport.java:156)

>>
>>    at 
>> org.apache.myfaces.application.DefaultViewHandlerSupport.getFacesServletMapping(DefaultViewHandlerSupport.java:116)

>>
>>    at 
>> org.apache.myfaces.application.DefaultViewHandlerSupport.calculateViewId(DefaultViewHandlerSupport.java:48)

>>
>>    at 
>> org.apache.myfaces.application.jsp.JspViewHandlerImpl.restoreView(JspViewHandlerImpl.java:504)

>>
>>    at 
>> com.sun.facelets.FaceletViewHandler.restoreView(FaceletViewHandler.java:316) 
>>
>>    at 
>> com.sun.facelets.FaceletViewHandler.restoreView(FaceletViewHandler.java:316) 
>>
>>
>> The provided PortletFaceletViewHandler implementation does not have a 
>> restoreView() method, hence it is delegated to its parent, the 
>> FaceletViewHandler. The NullPointerException eventually occurs when 
>> trying to determine the FacesServletMappings. What is null is the 
>> servletPath returned by the following method in myfaces 
>> PortletExternalContextImpl:
>>
>> public String getRequestServletPath()
>> {
>>    return null; // must return null
>> }
>>
>> I don't see how this could possibly work.
>>
>> Furthermore, compare the suggested implementation to the 
>> PortletViewHandler available in the myfaces portlet-bridge, which has 
>> portlet-specific implementations of restoreView, createView, and others.
>>
>> I'm either missing something or the original question about support 
>> for Facelets in MyFaces' portlet-bridge still stands.
>>
>> Thanks,
>> Rossen
>>
>>
>

Mime
View raw message