[ 
https://issues.jboss.org/browse/SEAMFACES-222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12690230#comment-12690230
 ] 

Neil Griffin commented on SEAMFACES-222:
----------------------------------------

I think the only file that has a ClassCastException type of problem would be 
FacesServletContextBeanManagerProvider.java

Specifically, these lines of code:
{code}ServletContext servletContext = (ServletContext) 
facesContext.getExternalContext().getContext();
...
beanManager = (BeanManager) servletContext.getAttribute(key);
{code}
In order to avoid a compile-time dependency on PortletContext, I recommend 
doing this instead:
{code}beanManager = (BeanManager) 
facesContext.getExternalContext().getApplicationMap().get(key);{code}
This is because Section 6.1.3.2 of JSR 329 spec requires the portlet bridge to 
have ExternalContext.getApplicationMap().get(String) to be a wrapper around 
PortletContext.getAttribute(String). Additionally, I just checked the Liferay 
and Pluto PortletContextImpl classes and PortletContext.getAttribute(String) 
simply wraps ServletContext.getAttribute(String). According to the JavaDocs for 
PortletContext, "The portlet context leverages most of its functionality from 
the servlet context of the portlet application." So it's probably safe to 
assume that all portlet containers do the same thing.

                
> Support Portlet deployments
> ---------------------------
>
>                 Key: SEAMFACES-222
>                 URL: https://issues.jboss.org/browse/SEAMFACES-222
>             Project: Seam Faces
>          Issue Type: Feature Request
>          Components: CDI Integration
>    Affects Versions: 3.1.0.Beta4
>            Reporter: Ken Finnigan
>            Assignee: Ken Finnigan
>
> Currently Faces assumes that a ServletContext will always be available to 
> retrieve a BeanManager, amongst other things.  Support needs to be added for 
> retrieving the BeanManager from a PortalContext when running inside a Portal 
> environment.
> https://github.com/seam/faces/blob/develop/impl/src/main/java/org/jboss/seam/faces/beanManager/FacesServletContextBeanManagerProvider.java
>  and 
> https://github.com/seam/faces/blob/develop/impl/src/main/java/org/jboss/seam/faces/beanManager/BeanManagerServletContextListener.java
>  definitely need Portal equivalents, and additional code could require 
> updates but need to search for ServletContext to confirm.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
seam-issues mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/seam-issues

Reply via email to