[ 
https://issues.apache.org/jira/browse/PORTLETBRIDGE-34?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12596816#action_12596816
 ] 

Michael Freedman commented on PORTLETBRIDGE-34:
-----------------------------------------------

My preference is to solve this generically in case we run across other Faces 
impls with differing savestate field markers.  What I propose is the Bridge 
read a web.xml init/config parameter called 
javax.portlet.faces.SAVESTATE_FIELD_MARKER.  This will allow an application to 
specify the specific field_marker for a given Faces impl.  The 
StringBuilderWriter in PortletViewHandlerImpl would be implemented as follows:  
It would define two static final constants -- one for the Faces RI marker and 
one for the MyFaces marker.  It would define a static String to hold the actual 
market in use (default to null).  In the write() method that references the 
saveStateFieldMarker we would put a check to see if the static variable holding 
the current marker is null -- if it is we would call a new private method that 
would determine the market in use.  It would be determined as follows:
     a) first get the web.xml config parameter 
javax.portlet.faces.SAVESTATE_FIELD_MARKER, if non-null then see if its the 
marker.  If its not ...
     b) try the Faces RI marker.  If its not ...
     c) try the MyFaces marker.
      Set the static variable to the found marker.
The rest of the write method would proceed as its currently implemented except 
it would use the static variable holding the current marker vs. the constant.

Sound okay?  Do you want to implement and submit a new patch for our review?

> Bridge does not work with Myfaces with state saving = client
> ------------------------------------------------------------
>
>                 Key: PORTLETBRIDGE-34
>                 URL: https://issues.apache.org/jira/browse/PORTLETBRIDGE-34
>             Project: MyFaces Portlet Bridge
>          Issue Type: Bug
>    Affects Versions: 1.0.0-alpha-2
>         Environment: windows xp, tomcat 6.0.16 and jetty, pluto
>            Reporter: Leonardo Uribe
>         Attachments: patchPortletBridgeMyfaces.patch
>
>
> The javax.faces.ViewState hidden field is not rendered!
> The problem is on PortletViewHandlerImpl.java. The field:
>     private static final String SAVESTATE_FIELD_MARKER = 
> "~com.sun.faces.saveStateFieldMarker~";
> Is the problem. If ri is present this is the value, if not myfaces state 
> field marker should be used
> I will attach a patch (the easiest solution that I could find), and if no 
> objections, I'll commit it.
> Reproduce the error is simple. Just use archetype for portlets and change the 
> param
> javax.faces.STATE_SAVING_METHOD
> to client

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to