[jboss-user] [JBoss Portal] - Re: deploy jsp-jsf

giuseppe.sassone do-not-reply at jboss.com
Thu Feb 7 12:32:26 EST 2008


sorry and thanks for replay,
I open the application under JBoss Portal like portlet correctly. The first page call me a string in a textfield, I click the button and it go at success.jsp correctly. Then I click "try again" (code on jsp success.jsp= try again ) and not return on register.jsp instead if I try application not a like a portlet but directory on the AS (http://localhost:8080/JSFDynamic) the navigation throws the pages is correct.

I have this directory structure:
register.jsp
WEB-INF
     ->result/success.jsp
     ->result/bad-address.jsp
     ->result/bad-password.jsp

under WEB-INF there are my xml files:
FACES-CONFIG.XML
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE faces-config PUBLIC
  "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
  "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">

<faces-config>
  <managed-bean>
    <managed-bean-name>registrationBean</managed-bean-name>
    <managed-bean-class>coreservlets.RegistrationBean</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
  </managed-bean>
  <navigation-rule>
    <from-view-id>/register.jsp</from-view-id>
    <navigation-case>
      <from-outcome>bad-address</from-outcome>
      <to-view-id>/WEB-INF/results/bad-address.jsp</to-view-id>
    </navigation-case>
    <navigation-case>
      <from-outcome>bad-password</from-outcome>
      <to-view-id>/WEB-INF/results/bad-password.jsp</to-view-id>
    </navigation-case>
    <navigation-case>
      <from-outcome>success</from-outcome>
      <to-view-id>/WEB-INF/results/success.jsp</to-view-id>
    </navigation-case>
  </navigation-rule>
</faces-config>

JSFDYNAMIC-OBJECT.XML
<?xml version="1.0" encoding="UTF-8"?>

   
      <if-exists>overwrite</if-exists>
      <parent-ref>default.default</parent-ref>
      
         <window-name>JSFDynamicPortletWindow</window-name>
         <instance-ref>JSFDynamicPortletInstance</instance-ref>
         center
         1
      
   


PORTLET.XML
<?xml version="1.0" encoding="UTF-8"?>
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
             version="1.0">
   
      <portlet-name>JSFDynamicPortlet</portlet-name>
      <portlet-class>org.apache.myfaces.portlet.MyFacesGenericPortlet</portlet-class>
      <init-param>
         default-view
         /register.jsp
      </init-param>
      
         <mime-type>text/html</mime-type>
         <portlet-mode>VIEW</portlet-mode>
      
      <portlet-info>
         ESEMPIO DI JSF DINAMICO
      </portlet-info>
   
</portlet-app>

PORTLET-INSTANCE.XML
<?xml version="1.0" standalone="yes"?>

   
      
         <instance-id>JSFDynamicPortletInstance</instance-id>
         <portlet-ref>JSFDynamicPortlet</portlet-ref>
      
   


WEB.XML
<?xml version="1.0"?>    
<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">
  
  <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>server</param-value>
    </context-param>
    
    <context-param>
        <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
        <param-value>true</param-value>
    </context-param>
  <!-- Faces Servlet
       Marty Hall: changed .jsf back to standard of .faces -->
  
     <servlet-name>Faces Servlet</servlet-name>
     <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
     <load-on-startup>1</load-on-startup>
  
  <servlet-mapping>
     <servlet-name>Faces Servlet</servlet-name>
     <url-pattern>*.faces</url-pattern>
  </servlet-mapping>
  
  
    
  <!-- Added a filter that redirects all requests sent to blah.jsp to
       blah.faces instead. This assumes that there are no non-JSF
       JSP pages in the entire Web application. See code for other
       assumptions and restrictions. 
       From http://www.coreservlets.com/JSF-Tutorial/.-->
  <!-- Register the name "faces-redirect-filter" for FacesRedirectFilter. -->
  
    <filter-name>faces-redirect-filter</filter-name>
    <filter-class>coreservlets.FacesRedirectFilter</filter-class>
  
  <!-- Apply the faces redirect filter to all JSP pages. -->
  <filter-mapping>
    <filter-name>faces-redirect-filter</filter-name>
    <url-pattern>*.jsp</url-pattern>
  </filter-mapping>
  
  <!-- Welcome files -->
  <welcome-file-list>
     <welcome-file>index.jsp</welcome-file>
     <welcome-file>index.html</welcome-file>
  </welcome-file-list>

</web-app>

Must I change my configuration files to deploy this applicationa as a portlet ?

Thank you

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4127505#4127505

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4127505



More information about the jboss-user mailing list