7 Replies Latest reply on Mar 19, 2007 1:03 AM by michaelmuo

    A newbie question

    michaelmuo

      I experience a very strange problem with richfaces (v3.0.0).
      So, under a WEB-INF/lib directory I placed next files:
      ajax4jsf-1.1.0.jar
      commons-collections-3.0.jar
      commons-fileupload-1.0.jar
      commons-beanutils-1.6.1.jar
      commons-digester-1.5.jar
      commons-logging.jar
      commons-codec-1.2.jar
      commons-el.jar
      commons-validator.jar
      jakarta-oro.jar
      jstl.jar
      oscache-2.3.jar
      richfaces-3.0.0.jar
      myfaces-all.jar

      A JSP/JSF file is pretty primitive:
      <%@ page language="java" pageEncoding="ISO-8859-1"%>
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      <%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich"%>

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">


      My page

      <meta http-equiv="pragma" content="no-cache">
      <meta http-equiv="cache-control" content="no-cache">
      <meta http-equiv="expires" content="0">



      <f:view>
      This is my JSF JSP page.

      <rich:panel>
      <f:facet name="header">
      <h:outputText value="Header" />
      </f:facet>
      Content
      </rich:panel>
      </f:view>



      The problem that panel codtent popupated in a wrong place, over the panel header, ie like

      This is my JSF JSP page.
      Content
      +------------------+
      | Header |
      +------------------+
      | |
      +------------------+


      Where is my code incorrect?
      Thank you

        • 1. Re: A newbie question

          Yes. This works exactly like expected. You cannot use the plain text inside the JSF components. Only JSF 1.2 or facelets eliminate this restriction

          So, you can have:

          <rich:panel>
           <f:facet name="header">
           <h:outputText value="Header" />
           </f:facet>
           <f:verbatim>
           Content
           </f:verbatim>
          </rich:panel>


          or
          <rich:panel>
           <f:facet name="header">
           <h:outputText value="Header" />
           </f:facet>
           <h:outputText value="Content" />
          </rich:panel>


          • 2. Re: A newbie question
            michaelmuo

            Thank you, but the problem still unresolved.
            I rewrited a jsp file as


            This is my JSF JSP page.
            <f:view>
            <rich:panel>
            <f:facet name="header">
            <h:outputText value="Header" />
            </f:facet>
            <f:verbatim>
            Content
            </f:verbatim>
            </rich:panel>
            </f:view>


            and have nothing in the content part, just

            This is my JSF JSP page.
            Header

            • 3. Re: A newbie question

              How about this one?

              <f:view>
               <rich:panel>
               <f:facet name="header">
               <h:outputText value="Header" />
               </f:facet>
               <h:panelGroup>
               <f:verbatim>
               Content
               </f:verbatim>
               </h:panelGroup>
               </rich:panel>
              </f:view>


              • 4. Re: A newbie question
                michaelmuo

                Just a box with "Header" :(
                Do I need something more than mentioned jars in a ../lib directory?

                Just FYI, in the /WEB-INF I have the next tld's:
                c-1_0-rt.tld
                fmt-1_0.tld
                fn.tld
                permittedTaglibs.tld
                sql-1_0-rt.tld
                sql.tld
                x-1_0-rt.tld
                x.tld
                c-1_0.tld
                c.tld
                fmt-1_0-rt.tld
                fmt.tld
                scriptfree.tld
                sql-1_0.tld
                x-1_0.tld

                • 5. Re: A newbie question

                  Ok. I am not sure you need all this stuff if you are going to work with JSF

                  • 6. Re: A newbie question
                    michaelmuo

                    I installed a local Tomcat server instead of Joss and ran my app. The end result is the same.

                    Here is my web.xml:

                    <?xml version="1.0" encoding="UTF-8"?>
                    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4"
                    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
                    <context-param>
                    <param-name>org.ajax4jsf.SKIN</param-name>
                    <param-value>blueSky</param-value>
                    </context-param>

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

                    <filter-mapping>
                    <filter-name>ajax4jsf</filter-name>
                    <servlet-name>Faces Servlet</servlet-name>
                    REQUEST
                    FORWARD
                    INCLUDE
                    </filter-mapping>


                    <context-param>
                    <param-name>javax.faces.CONFIG_FILES</param-name>
                    <param-value>/WEB-INF/faces-config.xml</param-value>
                    </context-param>

                    <listener-class>
                    org.apache.myfaces.webapp.StartupServletContextListener
                    </listener-class>


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

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

                    <filter-name>MyFacesExtensionsFilter</filter-name>
                    <filter-class>
                    org.apache.myfaces.component.html.util.ExtensionsFilter
                    </filter-class>
                    <init-param>
                    <param-name>maxFileSize</param-name>
                    <param-value>20m</param-value>
                    </init-param>

                    <filter-mapping>
                    <filter-name>MyFacesExtensionsFilter</filter-name>
                    <url-pattern>/faces/*</url-pattern>
                    </filter-mapping>


                    <context-param>
                    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                    <param-value>client</param-value>


                    </context-param>

                    <context-param>
                    <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
                    <param-value>true</param-value>


                    </context-param>

                    <context-param>
                    <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
                    <param-value>false</param-value>
                    </context-param>

                    <context-param>
                    <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
                    <param-value>true</param-value>


                    </context-param>

                    <context-param>
                    <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
                    <param-value>true</param-value>


                    </context-param>

                    </web-app>



                    The whole app dir structure is:

                    ...\test\index.jsp
                    ...\test\META-INF
                    ...\test\WEB-INF
                    ...\test\META-INF\MANIFEST.MF
                    ...\test\WEB-INF\classes
                    ...\test\WEB-INF\faces-config.xml
                    ...\test\WEB-INF\lib
                    ...\test\WEB-INF\web.xml
                    ...\test\WEB-INF\lib\ajax4jsf-1.1.0.jar
                    ...\test\WEB-INF\lib\commons-beanutils-1.6.1.jar
                    ...\test\WEB-INF\lib\commons-codec-1.2.jar
                    ...\test\WEB-INF\lib\commons-collections-3.0.jar
                    ...\test\WEB-INF\lib\commons-digester-1.5.jar
                    ...\test\WEB-INF\lib\commons-el.jar
                    ...\test\WEB-INF\lib\commons-fileupload-1.0.jar
                    ...\test\WEB-INF\lib\commons-logging.jar
                    ...\test\WEB-INF\lib\commons-validator.jar
                    ...\test\WEB-INF\lib\jakarta-oro.jar
                    ...\test\WEB-INF\lib\jstl.jar
                    ...\test\WEB-INF\lib\myfaces-all.jar
                    ...\test\WEB-INF\lib\oscache-2.3.jar
                    ...\test\WEB-INF\lib\richfaces-3.0.0.jar

                    • 7. Re: A newbie question
                      michaelmuo

                      Resolved. Thank you.