[richfaces-issues] [JBoss JIRA] Commented: (RF-1271) javax.servlet.ServletException: Prefix for attributes in portlet session scope not found when runnning portajAjaxSample on https

Alexander Smirnov (JIRA) jira-events at lists.jboss.org
Tue Feb 5 14:59:15 EST 2008


    [ http://jira.jboss.com/jira/browse/RF-1271?page=comments#action_12398336 ] 
            
Alexander Smirnov commented on RF-1271:
---------------------------------------

Most recent version of the portltt bridge included into RichFaces 3.1.4.GA. It's deployed into Jboss Maven repository at http://repository.jboss.org/maven2/org/richfaces/extensions/portletbridge/ .
There is two projects, portletbridge-api ( JSR-301 classes and interfaces ), and portletbridge-impl , implementation classes.
Short description writed by Wesley Hales: 
The JSR-301 compliant RichFaces portlet bridge brings the entire RichFaces library to your JBoss Portal environment. Not only does the bridge give you access to all the RichFaces components, it also provides you powerful AJAX processing capabilities. There are only minimal changes that must be made to an existing JSR-301 portlet, or you can download the demo project to use as a template for setting up a new JSF+RichFaces portlet.

View demo at http://livedemo.exadel.com/portal.

1. Define portlet.xml settings. These are the exact same setting for any JSR-301 portlet.

  <portlet>
    <portlet-name>ajaxPortlet</portlet-name>
    <portlet-class>
      javax.portlet.faces.GenericFacesPortlet
    </portlet-class>

     <init-param>
        <name>javax.portlet.faces.defaultViewId.view</name>
        <value>/welcome.xhtml</value>
      </init-param>
<!-- optional definition for a portlet Edit mode -->
        <init-param>
         <name>javax.portlet.faces.defaultViewId.edit</name>
        <value>/jsf/edit.xhtml</value>
       </init-param>
<!-- optional definition for a portlet Help mode -->
       <init-param>
         <name>javax.portlet.faces.defaultViewId.help</name>
         <value>/jsf/help.xhtml</value>
       </init-param>

    <expiration-cache>-0</expiration-cache>
    <portlet-info>
       <title>Ajax Portlet</title>
    </portlet-info>
    <supports>
      <mime-type>text/html</mime-type>
      <portlet-mode>VIEW</portlet-mode>
      <portlet-mode>EDIT</portlet-mode>
      <portlet-mode>HELP</portlet-mode>
    </supports>
  </portlet>
</portlet-app>

2. Define faces-config.xml settings:

<faces-config>
   <application>
      <view-handler>
         org.ajax4jsf.portlet.application.PortletViewHandler
      </view-handler>
      <state-manager>
         org.ajax4jsf.portlet.application.PortalStateManager
      </state-manager>
   </application>
   <factory>
      <faces-context-factory>
         org.ajax4jsf.portlet.context.FacesContextFactoryImpl
      </faces-context-factory>
   </factory>
...
</faces-config>

3.Define web.xml settings:

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
         version="2.4">
   ...
<!-- This is optional parameters for a facelets based application -->
   <context-param>
      <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
      <param-value>org.ajax4jsf.portlet.application.FaceletPortletViewHandler</param-value>
   </context-param>
   <context-param>
        <param-name>javax.portlet.faces.renderPolicy</param-name>
        <param-value>
            ALWAYS_DELEGATE
        </param-value>
   </context-param>
<!-- These parameters prevent loading separate style/javascript for each Richfaces components
 It must be used together with a portal-wide configuration, see below -->
   <context-param>
      <param-name>org.richfaces.LoadStyleStrategy</param-name>
      <param-value>NONE</param-value>
   </context-param>
   <context-param>
      <param-name>org.richfaces.LoadScriptStrategy</param-name>
      <param-value>NONE</param-value>
   </context-param>
   <context-param>
      <param-name>org.ajax4jsf.RESOURCE_URI_PREFIX</param-name>
      <param-value>rfRes</param-value>
   </context-param>

   <filter>
      <display-name>Ajax4jsf Filter</display-name>
      <filter-name>ajax4jsf</filter-name>
      <filter-class>org.ajax4jsf.Filter</filter-class>
   </filter>

   <filter-mapping>
      <filter-name>ajax4jsf</filter-name>
      <servlet-name>FacesServlet</servlet-name>
      <dispatcher>FORWARD</dispatcher>
      <dispatcher>REQUEST</dispatcher>
      <dispatcher>INCLUDE</dispatcher>
   </filter-mapping>
   ...
   <servlet-mapping>
      <servlet-name>FacesServlet</servlet-name>
      <url-pattern>/faces/*</url-pattern>
   </servlet-mapping>
   ...
</web-app>

4. To avoid scripts loading more than once from different portlet windows you can define additional scripts in jboss-portlet.xml. *Note the "rfRes" URI prefix that is mapped in the web.xml. For more information on RichFaces web.xml parameters see the documentation.

    <portlet>
         <portlet-name>ajaxPortlet</portlet-name>
        <header-content>
           <script src="/faces/rfRes/org/ajax4jsf/framework.pack.js" type="text/javascript" ></script>
           <script src="/faces/rfRes/org/richfaces/ui.pack.js" type="text/javascript" ></script>
           <link rel="stylesheet" type="text/css" href="/faces/rfRes/org/richfaces/skin.xcss" />
    </header-content>
    </portlet>
5. Richfaces JSR-301 bridge can be used with a any compatible implementation ( for example, MyFaces implementation ). Simple put optional parameter into web.xml :
...........
   <context-param>
      <param-name>javax.portlet.faces.BridgeImplClass</param-name>
      <param-value>org.ajax4jsf.portlet.AjaxPortletBridge</param-value>
   </context-param>
..............
To download the demo source, use subversion to checkout:
http://anonsvn.jboss.org/repos/portletswap/portlets/src/framework/RichFacesPortlet/

> javax.servlet.ServletException: Prefix for attributes in portlet session scope not found when runnning portajAjaxSample on https 
> ---------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: RF-1271
>                 URL: http://jira.jboss.com/jira/browse/RF-1271
>             Project: RichFaces
>          Issue Type: Bug
>    Affects Versions: 3.2.0
>         Environment: jboss portal 2.6.2 bundled with jboss 4.2
> Jdk 1.6.0_03
>            Reporter: Bharat Kandanoor
>         Assigned To: Aleksej Yanul
>             Fix For: 3.2.0, 3.1.3
>
>
> I tried deploying portalajaxsample from 
> http://snapshots.jboss.org/maven2/org/richfaces/samples/portalAjaxSample/3.2.0-SNAPSHOT/portalAjaxSample-3.2.0-20071030.110357-4.war .
> downloaded new jboss portal 2.6.2 bundled with jboss 4.2AS. 
> configured SSL based on the jboss wiki for 4.2.
> Started the server and i tried running the ajaxsample on https, it shows up with the form objects, but when you click "ajax switch to repeater page" we get this error 
> "javax.servlet.ServletException: Prefix for attributes in portlet session scope not found when runnning portajAjaxSample on https"..
> It was first  happening in my application, i thought it was something wrong in mmy source, but tried sample and it did the same thing.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the richfaces-issues mailing list