You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Michael Bowman <bo...@gmail.com> on 2007/05/01 15:09:37 UTC

Struts2 - JSF Plugin in portal environment

Hello,

I'm trying to get Struts2 working in a portlet environment... so far,
so good. However, we have one portlet that requires the use of some
3rd party jsf components. So I've been trying to get the jsf plugin to
work with the struts-portlet-default stuff. First thing I noticed, was
that the jsf-default definitions in the struts2-jsf-plugin-2.0.6.jar
extend struts-default. Since I needed one that extends
struts-portlet-default, I copied the package definition over to my own
struts-jsf.xml file and made the appropriate changes...

If anybody could help me out with this and let me know where I've gone
wrong, it would be greatly appreciated.

Thanks!
-Michael

struts-jsf.xml
--
<struts>
   <package name="portlet-jsf-default" extends="struts-portlet-default">

       <result-types>
           <result-type name="jsf"
class="org.apache.struts2.jsf.FacesResult" />
       </result-types>
       <interceptors>
           <interceptor
class="org.apache.struts2.jsf.FacesSetupInterceptor" name="jsfSetup"
/>
           <interceptor
class="org.apache.struts2.jsf.RestoreViewInterceptor"
name="jsfRestore" />
           <interceptor
class="org.apache.struts2.jsf.ApplyRequestValuesInterceptor"
name="jsfApply" />
           <interceptor
class="org.apache.struts2.jsf.ProcessValidationsInterceptor"
name="jsfValidate" />
           <interceptor
class="org.apache.struts2.jsf.UpdateModelValuesInterceptor"
name="jsfUpdate" />
           <interceptor
class="org.apache.struts2.jsf.InvokeApplicationInterceptor"
name="jsfInvoke" />

           <interceptor-stack name="jsfStack">
               <interceptor-ref name="jsfSetup">
                   <param
name="variableResolver">org.apache.struts2.jsf.StrutsVariableResolver</param>
                   <param
name="navigationHandler">org.apache.struts2.jsf.StrutsNavigationHandler</param>
               </interceptor-ref>
               <interceptor-ref name="jsfRestore" />
               <interceptor-ref name="jsfApply" />
               <interceptor-ref name="jsfValidate" />
               <interceptor-ref name="jsfUpdate" />
               <interceptor-ref name="jsfInvoke" />
           </interceptor-stack>
       </interceptors>

       <default-interceptor-ref name="jsfStack"/>

   </package>

 <package name="jsf" namespace="/advstruts/jsf" extends="portlet-jsf-default">
       <interceptors>
         <interceptor-stack name="jsfFullStack">
           <interceptor-ref name="portletDefaultStack" />
           <interceptor-ref name="jsfStack"/>
         </interceptor-stack>
       </interceptors>

       <default-interceptor-ref name="jsfFullStack"/>

   <action name="Jsf">
       <result name="success"
type="jsf">/WEB-INF/pages/hello-simple.jsp</result>
   </action>

   <!-- action name="JsfSubmit">
       <result name="success"
type="jsf">/WEB-INF/pages/hello-form-submit.jsp</result>
   </action -->

 </package>
</struts>
--

StackTrace:
--
12:07:40,089 DEBUG [Jsr168Dispatcher:300] Entering render
12:07:40,105 DEBUG [PortletRequestMap:53] Dumping request parameters:
12:07:40,105 DEBUG [PortletRequestMap:58] struts.portlet.mode = view
12:07:40,120 DEBUG [PortletRequestMap:58] struts.portlet.action =
/advstruts/jsf/Jsf
12:07:40,120 DEBUG [PortletSessionMap:56] Dumping session info:
12:07:40,120 DEBUG [PortletSessionMap:61]
com.liferay.util.servlet.SessionMessages = {}
12:07:40,120 DEBUG [PortletSessionMap:61]
com.liferay.util.servlet.SessionErrors = {}
12:07:40,120 DEBUG [Jsr168Dispatcher:399] serviceAction
12:07:40,120 DEBUG [Jsr168Dispatcher:407] Creating action proxy for
name = Jsf, namespace = /advstruts/jsf
12:07:40,136 DEBUG [FileUploadInterceptor:204] Bypassing /advstruts/jsf/ Jsf
12:07:40,198 DEBUG [AnnotationValidationInterceptor:134] Validating
/advstruts/jsf/Jsf with method execute.
12:07:40,276 ERROR [Jsr168Dispatcher:439] Could not execute action
java.lang.NullPointerException
       at com.sun.faces.portlet.FacesContextFactoryImpl.getFacesContext(FacesContextFactoryImpl.java:53)
       at org.apache.struts2.jsf.FacesSetupInterceptor.intercept(FacesSetupInterceptor.java:221)
       at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219)
       at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:218)
       at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
       at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:216)
       at org.apache.struts2.portlet.interceptor.PortletPreferencesInterceptor.intercept(PortletPreferencesInterceptor.java:102)
       at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219)
       at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:218)
       at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
       at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:216)
--



-- 
http://mbowman.net

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