Using Tiles with JSF

Hi All,
I am trying to integrate Tiles with JSF using the MyFaces components. I followed the following steps to use the MyFaces components in my web application:
- Copied the jar files myfaces-jsf-api.jar, myfaces.jar, jstl.jar, jakarta-oro.jar, commons-codec-1.2.jar, commons-el.jar, commons-fileupload-1.0.jar, commons-logging.jar and commons-validator.jar to the WEB-INF/lib dir.
- Removed the jsf-api.jar
When I restart the my server I get the following error:
com.sun.faces.config.ConfigureListener Can't parse configuration file:wsjar:file://WebContent/WEB-INF/lib/myfaces.jar!/META-INF/faces-config.xml
com.sun.faces.config.ConfigureListener TRAS0014I: The following exception was logged java.net.SocketException: Operation timed out: connect:could be due to invalid address
Kindly help me out. I am using WSAD 5.1.2 for development.
Thanks in advance.
Regards,
Saket

Saket,
you have to remove all files from sun, if you want to use MyFAces instead of RI.
com.sun.faces.config.ConfigureListener is a ContextListener, that is defined in TLD files of the RI. And also remove jsf-impl.jar
here is a running MyFaces/Tiles example!
http://cvs.apache.org/dist/incubator/myfaces/builds/
HTH,
-Matthias

Similar Messages

  • Navigation problem when using tiles with JSF

    Hi all,
    I m using tiles with JSF. i have included all the libraries and jsp page is rendered properly. but when i use <h:commandLink> in the body part of the JSP , i cannot go to the specified link. when we use tiles, what changes need to be done in faces-config file?? i mean what navigation rule we need to specify ??

    Hello, I have the same problem; JSF+Tiles = No navigation.
    One basic question is should I reference the parent jsp or the included body jsp in the faces-config.xml file.
    For example: The login.jsp is a main tiles page that includes a menu.jsp, header.jsp & a loginBody.jsp.
    Hence the faces-config could have this rule;
    <navigation-rule>
    <from-view-id>/login.jsp</from-view-id>
    <navigation-case>
    <to-view-id>/catalog.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    (I've left the outcome tag out to simplify this post)
    Or, I could refer loginBody.jsp in the navigation rule;
    <navigation-rule>
    <from-view-id>/loginBody.jsp</from-view-id>
    <navigation-case>
    <to-view-id>/catalog.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    The loginBody.jsp has a commandbutton which a user clicks which starts the navigation.
    Neither seems to work unfortunately & I'm a stuck.
    Thanks

  • Using CAPTCHA with jsf

    Has anyone used CAPTCHA with jsf? Is there a free jar file for doing this?

    I am using JSF 1.2 with RichFaces.
    I want to implement SimpleCaptcha in the application.
    On my loginpage I am able to add a captcha image.
    Here is the exception that I get. This I get after when my jsp page(on which this image is) loads.
    StandardWrapperValve[StickyCaptcha]: PWC1406: Servlet.service() for servlet StickyCaptcha threw exception
    java.lang.IllegalStateException: PWC3999: Cannot create a session after the response has been committed
    at org.apache.coyote.tomcat5.CoyoteRequest.doGetSession(CoyoteRequest.java:2709)
    at org.apache.coyote.tomcat5.CoyoteRequest.getSession(CoyoteRequest.java:2482)
    at org.apache.coyote.tomcat5.CoyoteRequestFacade.getSession(CoyoteRequestFacade.java:871)
    at org.apache.coyote.tomcat5.CoyoteRequestFacade.getSession(CoyoteRequestFacade.java:882)
    at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:248)
    at nl.captcha.servlet.SimpleCaptchaServlet.doGet(Unknown Source)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    What could be the reason?

  • Hi i am using tiles and jsf?

    i am using tiles defnetion.
    i want to use the layout logic for my application.
    i created all the layouts how can i link the layouts
    to the main tiles defnition.
    and if i extend the main tiles def i am not able to get the page displayed.
    below is my code
    les-definitions>
    <definition name="mainLayout" path="/layout/mainLayout.jsp" >
    <put name="topLayout" value="topLayout" />
    <put name="leftLayout" value="leftLayout" />
    <put name="centerLayout" value="centerLayout" />
    <put name="body" value="" />
    <put name="subbody" value=""/>
    </definition>
    <definition name="topLayout" path="/layout/topLayout.jsp" >
    <put name="header" value="/pages/header.jsp" />
    <put name="menu" value="/pages/tabMenu.jsp" />
    </definition>
    <definition name="leftLayout" path="/layout/leftLayout.jsp">
    <put name="body" value="/templates/edit1003_body.jsp" />
    </definition>
    <definition name="centerLayout" path="/layout/centerLayout.jsp">
    <put name="subbody" value="/templates/mortage_body.jsp" />
    </definition>
    <definition name="edit1003.tiles" extends="mainLayout" >
    <put name="body" value="/templates/edit1003_body.jsp" />
    <put name="subbody" value="/templates/mortage_body.jsp" />
    </definition>
    <definition name="aboutus.tiles" extends="mainLayout" >
    <put name="body" value="/templates/aboutus_body.jsp" />
    <put name="subbody" value="/pages/address.html"/>
    </definition>
    <definition name="mortage.tiles" extends="edit1003.tiles" >
    <put name="subbody" value="/templates/mortage_body.jsp" />
    </definition>
    its not working
    please let me know whats the wrong?
    thansk in advance
    sreedevi.

    hi
    i got the navigation its works
    thansk
    but i have one more problem
    my jsf tags are not shown in the body tag they are shown outside the body tag.
    below is my code
    <form id="subbody:hi:_id27" name="subbody:hi:_id27" method="post" action="/actsys/mortage.jsf" enctype="application/x-www-form-urlencoded"><table border="0"><tbody><tr><td><span class="text">Applicants should complete this form as "Borrower" or "Co-Borrower", as applicable.Co-Borrower information must aslo be provided(and the appropriate box checked)</span></td></tr>
    <tr><td><table border="0"><tbody><tr><td><input type="checkbox" name="subbody:hi:_id27:_id32" value="true" />the income or assest of a person other than the "Borrower"(including the Borrower's spouse) will be used as a basis for loan qualification.</td><td><input type="checkbox" name="subbody:hi:_id27:_id35" value="true" />the income or assests of the Borrowers's spouse will not be used as a basis for loan qualification,but his or her liabilities must be considered because the borrower resides in a community property state,the security property is located in a community property state,or the Borrower is relying on other property located in a community state as a basis for repaymnet of the loan.</td></tr>
    </tbody></table></td></tr>
    <tr><td><table border="0" cellpadding="1" cellspacing="2"><tbody><tr><td><span class="text">Mortage applied for:</span></td><td><table id="subbody:hi:_id27:MortageApp"><tr>          <td><label><input type="checkbox" name="subbody:hi:_id27:MortageApp" value="va" onblur="validateCheck(this);" />&#160;VA</label></td>          <td><label><input type="checkbox" name="subbody:hi:_id27:MortageApp" value="conv" onblur="validateCheck(this);" />&#160;Conventional</label></td>          <td><label><input type="checkbox" name="subbody:hi:_id27:MortageApp" value="other" onblur="validateCheck(this);" />&#160;Others</label></td>          <td><label><input type="checkbox" name="subbody:hi:_id27:MortageApp" value="fha" onblur="validateCheck(this);" />&#160;FHA</label></td>          <td><label><input type="checkbox" name="subbody:hi:_id27:MortageApp" value="usda" onblur="validateCheck(this);" />&#160;USDA/RHS</label></td></tr></table></td><td><span class="text">Agency Case Number:</span></td><td><input id="subbody:hi:_id27:agencycasenumber" name="subbody:hi:_id27:agencycasenumber" type="text" value="" onfocus="validateagency('MortageApp');" onchange="checkNumber(this);" /></td><td><span class="text">Lender Case Number:</span></td><td><input id="subbody:hi:_id27:lendercasenumber" name="subbody:hi:_id27:lendercasenumber" type="text" value="" onchange="checkNumber(this);" /></td></tr>
    <tr><td><span class="text">Amount:</span></td><td><input id="subbody:hi:_id27:amount" name="subbody:hi:_id27:amount" type="text" value="" onchange="checkNumber(this);" /></td><td><span class="text">Interest Rate:</span></td><td><input id="subbody:hi:_id27:interestrate" name="subbody:hi:_id27:interestrate" type="text" value="" onchange="checkNumber(this);" /></td><td><span class="text">No. of Months:</span></td><td><input id="subbody:hi:_id27:Noofmonths" name="subbody:hi:_id27:Noofmonths" type="text" value="" onchange="checkNumber(this);" /></td></tr>
    <tr><td><span class="text">Authorization Type:</span></td><td><table id="subbody:hi:_id27:Authorization"><tr>          <td><label><input type="checkbox" name="subbody:hi:_id27:Authorization" value="fr" onblur="validateCheck(this);" />&#160;Fixed Rate</label></td>          <td><label><input type="checkbox" name="subbody:hi:_id27:Authorization" value="other" onblur="validateCheck(this);" />&#160;Other</label></td>          <td><label><input type="checkbox" name="subbody:hi:_id27:Authorization" value="gpm" onblur="validateCheck(this);" />&#160;GPM</label></td>          <td><label><input type="checkbox" name="subbody:hi:_id27:Authorization" value="arm" onblur="validateCheck(this);" />&#160;ARM</label></td></tr></table></td><td></td><td></td><td></td><td></td></tr>
    </tbody></table></td></tr>
    </tbody></table><input type="hidden" name="subbody:hi:_id27_SUBMIT" value="1" /></form>
    <
    <body>
    </body>
    i want the jsf code need to be inside the body tage
    if some one has any idea why its comming
    please let me know
    thansk in advance

  • Exception while using struts with jsf

    Hi
    Iam trying to integrate struts with jsf. when iam trying to load jsf page ...getting the following error
    Unable to initialize jsf interceptors probably due missing JSF implementation libraries
    Please help me to fix this .

    this is my web.xml
    <?xml version="1.0"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <display-name>appstruts2</display-name>
    <filter>
    <filter-name>struts2</filter-name>
    <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
    </web-app>

  • Best Practices of using AJAX with JSF : BluePrints or  Ajax4Jsf ?

    am a newbie to AJAX4JSF . I think it provides Rapid Application Development (RAD) just by using tags like a4j: without the need to develop complex JSF Custom Components as shown in BluePrints Catalog
    https://bpcatalog.dev.java.net/ajax/jsf-ajax/
    I understand the purpose of developing JSF Custom components as Reusable for using with AJAX. But its complex and requires lot of coding i.e. PhaseListeners and Managed Beans. There should be easy way to do this especially our project needs RAD tool like AJAX4JSF.
    Any suggestions will be highly appreciated
    Regards
    Bansi

    Bansi, you are trying to compare orange-to-apple. Blue print catalog is a historical retrospection about what people thought about AJAXifying JSF in the past. Currently, the playground has been moved to the jsf-extension project. Look for DynaFaces there.

  • Using JFreeChart with JSF

    Hello Suners,
    I'm developing a JSF web application that uses JFreeChart. I'm having a problem when i run the project i get this error :
    java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.AbstractMethodError: gnu.xml.dom.DomElement.getTextContent()Ljava/lang/String;
            at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:932)
            at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:912)
            at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:694)
            at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1947)
            at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1619)
            at com.sun.enterprise.web.WebApplication.start(WebApplication.java:90)
            at org.glassfish.internal.data.EngineRef.start(EngineRef.java:126)
            at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:241)
            at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:236)
            at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:339)
            at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)
            at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
            at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305)
            at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
            at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)
            at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
            at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
            at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224)
            at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365)
            at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204)
            at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
            at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)
            at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
            at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
            at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
            at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
            at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
            at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
            at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
            at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
            at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
            at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
            at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
            at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
            at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
            at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
            at java.lang.Thread.run(Thread.java:619)I've done alot of researches on the internet and i figured out that JFreeChart is using gnujaxp implementation and JSF is using the standard Java XML parsing. Does anyone know how to set gnujaxp implementation in the system? and if there is a better solution it will be great to share it.
    King Regards,

    Saket,
    you have to remove all files from sun, if you want to use MyFAces instead of RI.
    com.sun.faces.config.ConfigureListener is a ContextListener, that is defined in TLD files of the RI. And also remove jsf-impl.jar
    here is a running MyFaces/Tiles example!
    http://cvs.apache.org/dist/incubator/myfaces/builds/
    HTH,
    -Matthias

  • Can I use Ajax with jsf

    Hi All,
    Is JSF 1.1 supports AJAX or not???
    Please tell me..

    JSF RI 1.1 = Java Server Faces Reference Implementation 1.1.
    It is the Sun reference implementation of JSF. There are also 3rd party implementations of JSF available, like MyFaces, Tomahawk, IceFaces, ADF, etcetera.
    If you aren't limited to JSF RI version 1.1, I recommend you to use version 1.2. It provides more features and benefits.
    Here are some links:
    https://javaserverfaces.dev.java.net
    http://java.sun.com/javaee/javaserverfaces/1.2/docs/tlddocs/
    http://jsftutorials.net
    http://java.sun.com/javaee/5/docs/tutorial/doc/ (starting at chapter 9)
    http://jboss.org/projects/jbossAjax4jsf (most widely used AJAX library for JSF)

  • Using Toplink with JSF

    This kind of crosses the boundaries of 2 forms. And since I'm not getting much response over in JDev perhaps this forums residents could help shed some light on the problem:
    Updating Toplink objects with JSF

    Thanks for bringing the thread to my attention. Keeping an eye on all the forums is challenging and occasionally we miss TopLink specific questions in the other forums. I have posted a response looking for more information on the original thread.
    Doug

  • Never ending Probelms with JSF

    Hi,
    I was just wondering if JSF is all hype but has no real value in it.
    I have been using for about 3 months. I have faced problems with it at almost every stage.
    1. Validators / Converters are not mature ( Why there is no attempt to integrate mature stuff like Commons-Validator which is already available. I am sure that every one of us agrees that vadation is very important for all web applications. I am aware that it possible to implement custom validators with JSF. But I feel the most comonly used ones should be available off the shelf.
    2. Consider
    <h:inputText id="text2" value="Please enter your text" rendered="false"/>
    If the rendered attribute cannot take a runtime expression value ... what is good for or what is the prupose behind having such an attribute ..... !!!!. This is just one instance there are many situations like this.
    I need to be able to choose whether a text field is rendered or not based on boolean value that is available as request attribute.
    3. There are innumerable probelms when we Tiles with JSF components.. For example if we have html content interleaved between JSF component tags. ... The Layout inspite of having proper definitions does not get rendered properly....The implementation of JSF Panel Grid is too restritced...
    4. There are many people out there implementing JSF components but they are buggy / incomatible with other implementations.... take for example ourfaces , myfaces , JSF reference implementation and Oracle's ADF are NOT compatible with each other... so what is this all about...
    Does anybody here have an idea as to how much time it would take for JSF to become stable enough to be used for Production applications...
    Any comments / suggestions are welcome
    Thanks in advance,
    Ram Kishore.

    Hi,
    I was just wondering if JSF is all hype but has no
    real value in it.
    I have been using for about 3 months. I have faced
    problems with it at almost every stage.
    1. Validators / Converters are not mature ( Why there
    is no attempt to integrate mature stuff like
    Commons-Validator which is already available. I am
    sure that every one of us agrees that vadation is very
    important for all web applications. I am aware that it
    possible to implement custom validators with JSF. But
    I feel the most comonly used ones should be available
    off the shelf.More off-the-shelf validators would be good, I agree.
    2. Consider
    <h:inputText id="text2" value="Please enter your text"
    rendered="false"/>
    If the rendered attribute cannot take a runtime
    expression value ... what is good for or what is the
    prupose behind having such an attribute ..... !!!!.
    This is just one instance there are many situations
    like this."rendered" does support dynamic values; just use #{} EL expressions.
    I need to be able to choose whether a text field is
    rendered or not based on boolean value that is
    available as request attribute.
    3. There are innumerable probelms when we Tiles with
    JSF components.. For example if we have html content
    interleaved between JSF component tags. ... The Layout
    inspite of having proper definitions does not get
    rendered properly....The implementation of JSF Panel
    Grid is too restritced...I think you're describing two separate problems here:
    (1) Needing <f:verbatim> is annoying. We (the EG) know; we're working on it.
    (2) More panel renderers would be good; you can look to component libraries (ADF Faces as one) for additional layouts.
    4. There are many people out there implementing JSF
    components but they are buggy / incomatible with other
    implementations.... take for example ourfaces ,
    myfaces , JSF reference implementation and Oracle's
    ADF are NOT compatible with each other... so what is
    this all about...OK, hold up here. There's some lump of claims here, and I don't know what you're specifically saying. It sounds as though you're saying component developers are writing buggy code, and therefore don't work with every implementation. With regards to Oracle's ADF Faces, we of course work with the JSF RI. We're close to working with MyFaces, but there's some issues remaining in MyFaces (perhaps already resolved) that block this. These aren't ADF Faces bugs. Expecting MyFaces to be perfectly compatible when it is not yet certified or described as production level is infeasible.
    (I can't speak for ourfaces.)
    -- Adam Winer (JSF EG, and ADF Faces)
    Does anybody here have an idea as to how much time it
    would take for JSF to become stable enough to be used
    for Production applications...
    Any comments / suggestions are welcome
    Thanks in advance,
    Ram Kishore.

  • Jdeveloper 11.1.1.5.0 with jsf 2

    jdeveloper 11.1.1.5.0 support jsf 1.2
    i need to use jsf 2 to try the following tutorial http://weblogs.java.net/blog/driscoll/archive/2008/11/a_simple_ajax_j.html
    I have many problem when I tried it using jdeveloper with jsf 1.2
    so can I use jsf 2 with this version of jdeveloper of is there any tutorial to use jsf and ajax using my version of jdeveloper

    Belal,
    If you want to use JSF 2 with JDeveloper, you will need JDeveloper 11.1.2.
    If you want to deploy a JSF 2 application, you would need to use WebLogic Server 10.3.5 + the appropriate patches.
    There is no version of the full middleware stack (i.e. SOA, Forms, Reports, etc) that supports JSF 2 yet.
    John

  • Oscache with JSF?

    Hi guys,
    Anyone use oscache with JSF before? Let say I got a 'datatable' which get a list from a bean with applicationScope, should I use oscache to cache it?
    regards,
    kmthien

    your application scoped bean is alreay your cache.
    unless you have special caching needs that you feel oscache can solve and it will save you some code than you can probably use oscache instead of you application scope bean.
    personally, i have chosen application scoped beans to serve as my cache for application wide data that is read mostly or read only. using an extra caching mechanism would just make my application harder.

  • Problems with JSF&Tiles (displaying twice one inserted page in tiles)

    I'm using Tiles framework withih Dynamic Web Project in Websphere (WSAD 5.1.1), the project is based on JSF.
    - included tiles.jar in WEB-INF/lib directory
    - in web.xml defined servlet action as: <servlet>
              <servlet-name>action</servlet-name>
              <display-name>TilesServlet</display-name>
              <servlet-class>org.apache.struts.tiles.TilesServlet</servlet-class>
              <init-param>
                   <param-name>definitions-parser-validate</param-name>
                   <param-value>false</param-value>
              </init-param>
              <load-on-startup>2</load-on-startup>
         </servlet> - also to Faces Servlet set value "load on startup" on 1
    - added struts-tiles.tld to WEB-INF folder
    - then I created index.jsp: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
    <HEAD>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
    <%@ page
    language="java"
    contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"
    %>
    <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <META name="GENERATOR" content="IBM WebSphere Studio">
    <META http-equiv="Content-Style-Type" content="text/css">
    <LINK href="theme/Master.css" rel="stylesheet"
         type="text/css">
    <TITLE>index.jsp</TITLE>
    <%-- jsf:codeBehind language="java" location="/JavaSource/codebehind/index.java" --%><%-- /jsf:codeBehind --%>
    </HEAD>
    <f:use_faces>
         <BODY>
         <TABLE border="1">
              <TBODY>
                   <TR>
                        <TD>
                             <tiles:insert page="/menu.jsp" flush="false"/>
                        </TD>
                        <TD>
                             <tiles:insert page="/content.jsp" flush="false"/>
                        </TD>
                   </TR>
              </TBODY>
         </TABLE>
         </BODY>
    </f:use_faces>
    </HTML> - menu.jsp and content.jsp inserted in index.jsp are not the same, and here is code for menu.jsp: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <%@taglib uri="http://www.ibm.com/jsf/html_extended" prefix="hx"%>
    <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <HTML>
    <HEAD>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%@ page
    language="java"
    contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"
    %>
    <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <META name="GENERATOR" content="IBM WebSphere Studio">
    <META http-equiv="Content-Style-Type" content="text/css">
    <LINK href="theme/Master.css" rel="stylesheet"
         type="text/css">
    <TITLE>menu.jsp</TITLE>
    <SCRIPT type="text/JavaScript" language="JavaScript"
         src=".ibmjsfres/hxclient.js"></SCRIPT>
    <LINK rel="stylesheet" type="text/css"
         href=".ibmjsfres/css/stylesheet.css" title="Style">
    <%-- jsf:codeBehind language="java" location="/JavaSource/codebehind/menu.java" --%><%-- /jsf:codeBehind --%>
    </HEAD>
    <f:use_faces>
         <BODY><hx:script_collector>
         <h:form formName="form1" id="form1"><P><hx:panel_actionbar
                        id="actionbar1"><hx:panel_actionbar nestedTitleText="Sub-Panel Label" id="actionbar2"><hx:command_buttonex label="Command Label" id="button1" action="go_page01"></hx:command_buttonex><hx:command_buttonex label="Command Label" id="button2"></hx:command_buttonex></hx:panel_actionbar><hx:panel_actionbar nestedTitleText="Sub-Panel Label" id="actionbar3"><hx:command_buttonex label="Command Label" id="button3"></hx:command_buttonex><hx:command_buttonex label="Command Label" id="button4"></hx:command_buttonex></hx:panel_actionbar></hx:panel_actionbar></P></h:form>
         </hx:script_collector></BODY>
    </f:use_faces>
    </HTML>The problem is when I run application on server and go to index.jsp the resulting page is containing two times menu.jsp, instead once menu.jsp and once content.jsp.
    Also when you click on buttons in "second" menu.jsp it's like it was clicked on the "first and the original one". When you click navigation rules do apply.
    Can anyone help on this?
    Message was edited by:
    DeYo

    I haven't solved problem yet but so far I realised this:
    - the problem is that both menu.jsp and content.jsp have forms, with tags: <h:form formName="form1" id="form1">.
    I've tried renaming form and id, but it didn't worked, alo tried changing scope of managed beans for the two inserted jsp pages - still nothing.
    - also if the content.jsp is not containing form but other JSF components like Image or Hyperlink, that components are not being shown/rendered.

  • Tiles works with jsf but....

    Hi guys,
    i've a jsf application and i've tried to improve its layout with Tiles of Struts and everythings work,infact each page has its layout fixed.
    I've used one header,one footer,one left menu(for quickly navigation and language selection and personal content of each page.
    My question is:
    if i navigate throught my application it's ok,when i use quickly navigation on left menu it's ok.
    The problem is when i click on buttons that performs not only navigation,but also java logic,i've this exception (but the operation requested,as insert in database,delete etc...are done!!!!)
    GRAVE: Servlet.service() for servlet Faces Servlet threw exception
    java.lang.NullPointerException
         at giu.NavigationManager.handleNavigation(NavigationManager.java:23)
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:89)
         at javax.faces.component.UICommand.broadcast(UICommand.java:312)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)
         at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at giu.AuthorizationFilter.doFilter(AuthorizationFilter.java:61)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)i've used this NavigationManager
    package giu;
    import javax.faces.application.NavigationHandler;
    import javax.faces.context.FacesContext;
    public class NavigationManager extends NavigationHandler {
         final String menuId ="@mainMenu";
         NavigationHandler _base;
         public NavigationManager (NavigationHandler base) {
              super();
              _base = base;
         public void handleNavigation(FacesContext fc, String actionMethod, String action) {
              int atPosition = action.indexOf(menuId);
              if (atPosition < 0) {
                   _base.handleNavigation(fc, actionMethod, action);
              } else {
                   String viewId = fc.getViewRoot().getViewId();
                   fc.getViewRoot().setViewId(menuId);
                   String newAction = action.substring(0, atPosition);
                   _base.handleNavigation(fc, actionMethod, newAction);
    }that comes from a jsf-tiles example downloaded from core Java server faces book..i'vent understood too well this navigation,can someone help me to understand it and solve my exception??
    Thanks very much....(i use exadel studio pro 4,jsf 1.1.0.1,servlet 2.3 and tiles from struts 1.1)

    giubat: I've stuggled with getting Tiles to work correctly with JSF.
    If your not to far into your project, I strongly recommend Facelets, it is very simple to include other JSF files and the syntax is XML formatted which allows Exadel Studio 4.0 to check your pages.
    You'll need to change you actual page extension to .xhtml, which Exadel Studio handles nicely...
    Tiles is just a waste of time when combined with JSF...

  • Latest version of Tiles appears not compatible with JSF 2

    I have been doing java server faces for about a month now. In general, i very much like what I see. However, I found significant problems with Tiles. I have now spend about 8 hours trying to debug it. The book by David Geary and Cay Horstman have a whole section on tiles. However, the latest download of Tiles has changed significantly since the authors wrote the section. I have debugged and debugged to now I get the following in NetBeans:
    SEVERE: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
    java.lang.VerifyError: (class: com/sun/webui/jsf/renderkit/html/AccordionTabDesignTimeRenderer, method: encodeBegin signature: (Ljavax/faces/context/FacesContext;Ljavax/faces/component/UIComponent;)V) Incompatible argument to function
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    at java.lang.Class.getConstructor0(Class.java:2699)
    at java.lang.Class.newInstance0(Class.java:326)
    at java.lang.Class.newInstance(Class.java:308)
    at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:1028)
    at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:1100)
    My only conclusion is that the latest version of tiles is not compatible with JSF 2.
    Is anyone able to get the latest version of Tiles to work with JSF 2?

    JSF + Tiles is not going anywhere. Most of the JSF components render at runtime whereas Tiles only works at compile-time. Tiles was designed to work with JSP not JSF, even though some people tried to use it for a while until they realize the big limitation.
    Go and try JSF + Facelets. It'll solve many of your problems.
    Tam Tran.
    WebMX developer
    The best australian web site development and content management
    http://webmx.com.au
    Edited by: jtomtran on Nov 18, 2007 7:44 PM

Maybe you are looking for