views:

41

answers:

3

Hy guys,

I installed jboss-seam on weblogic 10.3 (with many problem :( ) but now it's work, my application is deployed.

But now, I have a new problem, my JSF isn't interpreted and the JSF code appears in HTML.

Here is my web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
 <listener>
   <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
 </listener>
  <listener>
    <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
  </listener>


   <!-- RichFaces -->

   <context-param>
      <param-name>org.richfaces.SKIN</param-name>
      <param-value>glassX</param-value>
   </context-param>

   <!-- Suppress spurious stylesheets -->

   <context-param>
      <param-name>org.richfaces.CONTROL_SKINNING</param-name>
      <param-value>disable</param-value>
   </context-param>

   <context-param>
      <param-name>org.richfaces.CONTROL_SKINNING_CLASSES</param-name>
      <param-value>disable</param-value>
   </context-param>

   <!-- Change load strategy to DEFAULT to disable sending scripts/styles as packs -->

   <context-param>
      <param-name>org.richfaces.LoadStyleStrategy</param-name>
      <param-value>ALL</param-value>
   </context-param>

   <context-param>
      <param-name>org.richfaces.LoadScriptStrategy</param-name>
      <param-value>ALL</param-value>
   </context-param>


  <filter>
    <filter-name>Seam Filter</filter-name>
    <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>Seam Filter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  <servlet>
    <servlet-name>Seam Resource Servlet</servlet-name>
    <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
  </servlet>


   <!-- Facelets development mode (disable in production) -->

   <context-param>
      <param-name>facelets.DEVELOPMENT</param-name>
      <param-value>@debug@</param-value>
   </context-param>

   <!-- JSF -->

   <context-param>
      <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
      <param-value>.seam</param-value>
   </context-param>

   <servlet>
      <servlet-name>Faces Servlet</servlet-name>
      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
   </servlet>

   <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.seam</url-pattern>
   </servlet-mapping>



  <servlet-mapping>
    <servlet-name>Seam Resource Servlet</servlet-name>
    <url-pattern>/seam/resource/*</url-pattern>
  </servlet-mapping>
  <ejb-local-ref>
    <ejb-ref-name>jboss-seam-jee5/AuthenticatorAction/local</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local>org.jboss.seam.example.booking.Authenticator</local>
  </ejb-local-ref>
  <ejb-local-ref>
    <ejb-ref-name>jboss-seam-jee5/BookingListAction/local</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local>org.jboss.seam.example.booking.BookingList</local>
  </ejb-local-ref>
  <ejb-local-ref>
    <ejb-ref-name>jboss-seam-jee5/RegisterAction/local</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local>org.jboss.seam.example.booking.Register</local>
  </ejb-local-ref>
  <ejb-local-ref>
    <ejb-ref-name>jboss-seam-jee5/ChangePasswordAction/local</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local>org.jboss.seam.example.booking.ChangePassword</local>
  </ejb-local-ref>
  <ejb-local-ref>
    <ejb-ref-name>jboss-seam-jee5/HotelBookingAction/local</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local>org.jboss.seam.example.booking.HotelBooking</local>
  </ejb-local-ref>
  <ejb-local-ref>
    <ejb-ref-name>jboss-seam-jee5/HotelSearchingAction/local</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local>org.jboss.seam.example.booking.HotelSearching</local>
  </ejb-local-ref>
  <ejb-local-ref>
    <ejb-ref-name>jboss-seam-jee5/EjbSynchronizations/local</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local>org.jboss.seam.transaction.LocalEjbSynchronizations</local>
  </ejb-local-ref>
  <session-config>
    <session-timeout>10</session-timeout>
  </session-config>
  <context-param>
    <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
    <param-value>resources.application</param-value>
  </context-param>
</web-app>

My FacesServlet is load in startup but JSF doesn't work.

Someone can help me ?

Thanks.

+2  A: 

If the XHTML page is not been parsed by the FacesServlet, then it simply means that the request URL did not match the url-pattern of the FacesServlet. You have set its url-pattern to *.seam So, to open the JSF page, you should not invoke it by http://example.com/page.xhtml, but by http://example.com/page.seam.

By the way, the javax.faces.DEFAULT_SUFFIX sets the actual file extension of template files where JSF should look for and parse. You've set it to .seam as well, but this should really be .xhtml.

BalusC
I tried to set the suffix to .xhtml but nothing change.
Kiva
`.seam` is correct
Shervin
The `javax.faces.DEFAULT_SUFFIX` should be set to the **actual** file extension of the template files. This is *usually* `.xhtml`. But if you're really using template files with `.seam` extension, then let it so. I then only question why you're then able to view the XHTML files "plain vanilla". You should have gotten a 404 page not found. You really need to supply more information: 1) what are the **actual** file extensions? 2) what extension did you use in the request URL (in the browser's address bar)?
BalusC
A: 

I dont know if this will help, but here is our web.xml

<?xml version="1.0" ?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">

<!-- Ajax4jsf -->

<context-param>
    <param-name>org.richfaces.SKIN</param-name>
    <param-value>blueSky</param-value>
</context-param>

<!--
    This config will enforce the container to compress all the richfaces
    resources including images, stylesheets, javascript to be compressed
    before sending to client. It will make significant reduced load time.
-->
<context-param>
    <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
    <param-value>true</param-value>
</context-param>

<!-- Seam -->

<listener>
    <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
</listener>

<filter>
    <filter-name>Seam Filter</filter-name>
    <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
</filter>

<filter>
    <filter-name>UTF8 Filter</filter-name>
    <filter-class>foo.bar.filter.UTF8Filter</filter-class>
</filter>

<filter-mapping>
  <filter-name>UTF8 Filter</filter-name>
  <url-pattern>*.seam</url-pattern>
</filter-mapping>


<filter-mapping>
    <filter-name>Seam Filter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>


<servlet>
    <servlet-name>Seam Resource Servlet</servlet-name>
    <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
</servlet>

<servlet-mapping>
    <servlet-name>Seam Resource Servlet</servlet-name>
    <url-pattern>/seam/resource/*</url-pattern>
</servlet-mapping>

<!-- Facelets development mode (disable in production) -->

<context-param>
    <param-name>facelets.DEVELOPMENT</param-name>
    <param-value>true</param-value>
</context-param>

<context-param>
    <param-name>facelets.SKIP_COMMENTS</param-name>
    <param-value>true</param-value>
</context-param>

<!-- JSF -->

<context-param>
    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
    <param-value>.xhtml</param-value>
</context-param>

<context-param>
    <param-name>facelets.LIBRARIES</param-name>
    <param-value>/WEB-INF/kf.taglib.xml</param-value>
</context-param>

<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.seam</url-pattern>
</servlet-mapping>

<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.csv</url-pattern>
</servlet-mapping>
<!-- Job executor servlet for jBPM Timers -->
<!-- TODO: Restrict access or better switch to ejb3 TimerService -->
<servlet>
    <description>
        This servlet has the purpose of executing pending jobs.
    </description>
    <servlet-name>JobExecutorServlet</servlet-name>
    <servlet-class>org.jbpm.job.executor.JobExecutorServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>JobExecutorServlet</servlet-name>
    <url-pattern>/jobs</url-pattern>
</servlet-mapping>

<servlet>
    <servlet-name>Document Store Servlet</servlet-name>
    <servlet-class>org.jboss.seam.document.DocumentStoreServlet</servlet-class>
</servlet>

<servlet-mapping>
    <servlet-name>Document Store Servlet</servlet-name>
    <url-pattern>*.pdf</url-pattern>
</servlet-mapping>

<security-constraint>
    <display-name>Restrict raw XHTML Documents</display-name>
    <web-resource-collection>
        <web-resource-name>XHTML</web-resource-name>
        <url-pattern>*.xhtml</url-pattern>
    </web-resource-collection>
    <auth-constraint />
</security-constraint>

<session-config>
    <session-timeout>60</session-timeout>
</session-config>

Shervin
One thing is strange. In the monitoring servlet, I see "Invocation Total Count" of my FacesServlet increase every time a page load. But the jsf is not interpreted. It's very strange...
Kiva
A: 

I had this in my web.xml:

<filter>
        <display-name>RichFaces Filter</display-name>
        <filter-name>richfaces</filter-name>
        <filter-class>org.ajax4jsf.Filter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>richfaces</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>

And now, it's working.

Kiva