JSF 1.2 and Tiles integration

I have a web application using JSF 1.1 and Tiles that I am trying to upgrade to run using JSF 1.2.
It is working as far as working out that it should use the tile, but then it all seems to fall over when trying to render.
Does anyone know if it is possible to use Tiles with JSF 1.2?
Steven

Hi,
I took the Shales TileViewHandler and replaced the renderView method with the one below. This is a copy of the method from the Sun RI except that it passes the tile (ComponentDefinition) along to the subsequent methods.
Then when it gets down to executePageToBuildView the requestURI is obtained from the tile (tile.getPath()) rather than from the UIViewRoot (viewToExecute.getViewId()).
   public void renderView(FacesContext facesContext, UIViewRoot viewToRender)
                                        throws IOException, FacesException {
      String viewId = viewToRender.getViewId();
      String tileName = getTileName(viewId);
      ComponentDefinition tile = getTile(tileName);
      if (log.isDebugEnabled()) {
         String message = null;
         try {
             message = bundle.getString("tiles.renderingView");
         } catch (MissingResourceException e) {
             message = "Rendering view {0}, looking for tile {1}";
         synchronized(format) {
            format.applyPattern(message);
            message = format.format(new Object[] { viewId, tileName });
         log.debug(message);
      if (tile != null) {
         if (log.isDebugEnabled()) {
            String message = null;
            try {
                message = bundle.getString("tiles.dispatchingToTile");
            } catch (MissingResourceException e) {
                message = "Dispatching to tile {0}";
            synchronized(format) {
               format.applyPattern(message);
               message = format.format(new Object[] { tileName });
            log.debug(message);
         dispatchToTile(facesContext, viewToRender, tile);
      else {
         if (log.isDebugEnabled()) {
            String message = null;
            try {
                message = bundle.getString("tiles.dispatchingToViewHandler");
            } catch (MissingResourceException e) {
                message = "Dispatching {0} to the default view handler";
            synchronized(format) {
               format.applyPattern(message);
               message = format.format(new Object[] { viewId });
            log.debug(message);
         defaultViewHandler.renderView(facesContext, viewToRender);
   private void dispatchToTile(FacesContext facesContext, UIViewRoot viewToRender, ComponentDefinition tile) throws java.io.IOException
       ExternalContext externalContext = facesContext.getExternalContext();
       Object request = externalContext.getRequest();
      Object context = externalContext.getContext();
      TilesContext tilesContext = TilesContextFactory.getInstance(context, request);
      ComponentContext tileContext = ComponentContext.getContext(tilesContext);
      if (tileContext == null) {
         tileContext = new ComponentContext(tile.getAttributes());
         ComponentContext.setContext(tileContext, tilesContext);
      else
         tileContext.addMissing(tile.getAttributes());
      renderTile(facesContext, viewToRender, tile);
      // dispatch to the tile's layout
      //externalContext.dispatch(tile.getPath());
   private void renderTile(FacesContext context, UIViewRoot viewToRender, ComponentDefinition tile) throws IOException, FacesException
       // suppress rendering if "rendered" property on the component is
       // false
       if (!viewToRender.isRendered()) {
           return;
       ExternalContext extContext = context.getExternalContext();
       ServletRequest request = (ServletRequest) extContext.getRequest();
       ServletResponse response = (ServletResponse) extContext.getResponse();
       try {
           if (executePageToBuildView(context, viewToRender, tile)) {
               response.flushBuffer();
               //ApplicationAssociate.getInstance(extContext).responseRendered();
               return;
       } catch (IOException e) {
           throw new FacesException(e);
       // set up the ResponseWriter
       RenderKitFactory renderFactory = (RenderKitFactory)
       FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
       RenderKit renderKit =
               renderFactory.getRenderKit(context, viewToRender.getRenderKitId());       
       ResponseWriter oldWriter = context.getResponseWriter();
       initBuffSize(context);
       WriteBehindStringWriter strWriter =
             new WriteBehindStringWriter(context, bufSize);
       ResponseWriter newWriter;
       if (null != oldWriter) {
           newWriter = oldWriter.cloneWithWriter(strWriter);
       } else {
           newWriter = renderKit.createResponseWriter(strWriter, null,
                   request.getCharacterEncoding());           
       context.setResponseWriter(newWriter);
       newWriter.startDocument();
       doRenderView(context, viewToRender);
       newWriter.endDocument();
       // replace markers in the body content and write it to response.
       ResponseWriter responseWriter;
       if (null != oldWriter) {
           responseWriter = oldWriter.cloneWithWriter(response.getWriter());
       } else {
           responseWriter = newWriter.cloneWithWriter(response.getWriter());
       context.setResponseWriter(responseWriter);
       strWriter.flushToWriter(responseWriter);
       if (null != oldWriter) {
           context.setResponseWriter(oldWriter);
       // write any AFTER_VIEW_CONTENT to the response
       writeAfterViewContent(extContext, response);
   private boolean executePageToBuildView(FacesContext context, UIViewRoot viewToExecute, ComponentDefinition tile)
   throws IOException {
       if (null == context) {
           String message = MessageUtils.getExceptionMessageString
                   (MessageUtils.NULL_PARAMETERS_ERROR_MESSAGE_ID, "context");
           throw new NullPointerException(message);
       if (null == viewToExecute) {
           String message = MessageUtils.getExceptionMessageString
                   (MessageUtils.NULL_PARAMETERS_ERROR_MESSAGE_ID, "viewToExecute");
           throw new NullPointerException(message);
       String mapping = Util.getFacesMapping(context);
       String requestURI =
             updateRequestURI(viewToExecute.getViewId(), mapping);
       String requestURI =
           updateRequestURI(tile.getPath(), mapping);
       if (mapping.equals(requestURI)) {
           // The request was to the FacesServlet only - no path info
           // on some containers this causes a recursion in the
           // RequestDispatcher and the request appears to hang.
           // If this is detected, return status 404
           HttpServletResponse response = (HttpServletResponse)
                 context.getExternalContext().getResponse();
           response.sendError(HttpServletResponse.SC_NOT_FOUND);
           return true;
       ExternalContext extContext = context.getExternalContext();
       // update the JSTL locale attribute in request scope so that JSTL
       // picks up the locale from viewRoot. This attribute must be updated
       // before the JSTL setBundle tag is called because that is when the
       // new LocalizationContext object is created based on the locale.
       // PENDING: this only works for servlet based requests
       if (extContext.getRequest()
       instanceof ServletRequest) {
           Config.set((ServletRequest)
           extContext.getRequest(),
                      Config.FMT_LOCALE, context.getViewRoot().getLocale());
       // save the original response
       Object originalResponse = extContext.getResponse();
       // replace the response with our wrapper
       ViewHandlerResponseWrapper wrapped =
             new ViewHandlerResponseWrapper(
                   (HttpServletResponse)extContext.getResponse());
       extContext.setResponse(wrapped);
       // build the view by executing the page
       extContext.dispatch(requestURI);       
       // replace the original response
       extContext.setResponse(originalResponse);
       // Follow the JSTL 1.2 spec, section 7.4, 
       // on handling status codes on a forward
       if (wrapped.getStatus() < 200 || wrapped.getStatus() > 299) { 
           // flush the contents of the wrapper to the response
           // this is necessary as the user may be using a custom
           // error page - this content should be propagated
           wrapped.flushContentToWrappedResponse();
           return true;           
       // Put the AFTER_VIEW_CONTENT into request scope
       // temporarily
       if (wrapped.isBytes()) {
           extContext.getRequestMap().put(AFTER_VIEW_CONTENT,
                                          wrapped.getBytes());
       } else if (wrapped.isChars()) {
           extContext.getRequestMap().put(AFTER_VIEW_CONTENT,
                                          wrapped.getChars());
       return false;
   }You will also find you need to copy a few other methods from the Sun RI.
There were a couple of calls to ApplicationAssociate.responseRendered() which I just commented out as well (because they are not visible). They stop people changing the StateManager or ViewHandler after responses have been rendered. Probably not a problem since I will have replaced the ViewHandler anyway.
Steven

Similar Messages

  • JSF 2.0 and Tiles with Struts and Tomahawk libs.

    I have set up an example application that extends tiles. The issue I'm seeing is that although the tiles are all rendering, the ui: tags are not rendering as html, e.g. I see ui:html, ui:head, ui:form, etc.
    Has anyone else seen this, and how did you get around it?
    Thanks,
    w

    You could define an instance Y in the same scope as 'x' and then inject it into 'x' as a managed property. This is probably dead simple using annotations. It wouldn't be hard with the XML either, just verbose.
    If you really want it to be magical, you could create an implementation of javax.el.ELResolver that creates intermediate properties when you need them. Perhaps one already exists; perhaps the Stripes code has one.

  • Blank Page with JSF 1.1.01 RI and Tiles

    My web pages have been rendered without any problem using JSF 1.1 and Tiles with Weblogic 8.1 SP3. But it can't handle multiple forms within a page. So I upgraded JSF to version 1.1.01 RI. I only get blank pages since the upgrade.
    Does anybody have the same problem? Any help is appreciated.

    I have the same problem with Tomcat 5.5 and tried both 1.1.01 and 1.1.02. I used both JSF RI 1.0 and 1.1 with no problem on JSF with tiles, but because of the known bugs in 1.1 I had to use 1.1.01 or later which doesn't work nicely with tiles. Does anyone know how to fix this in Tomcat?

  • JSF 1.2 + Shale Tiles

    Hi,
    I'm developing webapp with JSF 1.2 and Tiles. I think that I made everythig corect but when I'm running tha app I get following error:
    java.lang.IllegalStateException: Component javax.faces.component.UIViewRoot@67ec28 not expected type. Expected: javax.faces.component.UICommand. Perhaps you're missing a tag?
         com.sun.faces.taglib.html_basic.CommandLinkTag.setProperties(CommandLinkTag.java:259)
         javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:604)
         javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1111)
         com.sun.faces.taglib.html_basic.CommandLinkTag.doStartTag(CommandLinkTag.java:364)
         org.apache.jsp.common.welcome_jsp._jspx_meth_h_005fcommandLink_005f0(welcome_jsp.java:124)
         org.apache.jsp.common.welcome_jsp._jspService(welcome_jsp.java:70)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:413)
         com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:410)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:112)
         org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java:176)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:108)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:243)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
    Can somebody help? Thx.

    This is my layout:
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <html>
         <head>
              <title>Music Store</title>
         </head>
    <f:view>
         <body>
              <table border="1" width="100%" cellspacing="5" height="100%">
                   <tr>
                        <td colspan="3" width="100%">
                        <f:subview id="header">
                             <tiles:insert attribute="header" flush="false"/>
                             </f:subview>
                        </td>
                   </tr>
                   <tr>
                        <td colspan="3" width="100%">
                        <f:subview id="menu">
                             <tiles:insert attribute="menu" flush="false"/>
                             </f:subview>
                        </td>
                   </tr>
                   <tr>
                        <td width="20%" valign="top" align="center">
                             <tiles:insert attribute="search" flush="false"/>
                        </td>
                        <td width="*" align="center" valign="top">
                        <f:subview id="body">
                             <tiles:insert attribute="body" flush="false"/>
                             </f:subview>
                        </td>
                        <td width="20%" valign="top" align="center">
                             <tiles:insert attribute="special" flush="false"/>
                        </td>
                   </tr>
                   <tr>     
                        <td colspan="3" width="100%">
                             <tiles:insert attribute="footer" flush="false"/>
                        </td>
                   </tr>
              </table>
         </body>
         </f:view>
    </html>
    This is tiles-defs:
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE tiles-definitions PUBLIC
    "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
    "http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
    <tiles-definitions>
         <definition name="layoutLanguage" path="/common/layout.jsp">
              <put name="header" value="" />
              <put name="menu" value="" />
              <put name="special" value="" />
              <put name="search" value="" />
              <put name="footer" value="" />
         </definition>
         <definition name="layout" path="/common/layout.jsp">
              <put name="header" value="" />
              <put name="menu" value="/common/menu.jsp" />
              <put name="special" value="" />
              <put name="search" value="" />
              <put name="footer" value="" />
         </definition>
         <definition name="/common/welcome.tiles" extends="layout">
              <put name="body" value="/common/welcome.jsp" />
         </definition>
              <definition name="/pages/createAccount.tiles" extends="layout">
              <put name="body" value="/pages/createAccount.jsp" />
         </definition>
    </tiles-definitions>
    This is 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>javax.faces.CONFIG_FILES</param-name>
              <param-value>/WEB-INF/faces-config.xml</param-value>
         </context-param>
         <!-- Tiles ViewHandler config file -->
         <context-param>
              <param-name>tiles-definitions</param-name>
              <param-value>/WEB-INF/tiles-defs.xml</param-value>
         </context-param>
         <servlet>
              <servlet-name>Faces Servlet</servlet-name>
              <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
              <load-on-startup>0</load-on-startup>
         </servlet>
         <servlet-mapping>
              <servlet-name>Faces Servlet</servlet-name>
              <url-pattern>*.faces</url-pattern>
         </servlet-mapping>
    </web-app>
    This is faces-config:
    <?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>
         <application>
              <view-handler>
                   org.apache.shale.tiles.TilesViewHandler
              </view-handler>
         </application>
         <navigation-rule>
              <from-view-id>*</from-view-id>
              <navigation-case>
                   <from-outcome>createAccount</from-outcome>
                   <to-view-id>/pages/createAccount.jsp</to-view-id>
              </navigation-case>
         </navigation-rule>
         <managed-bean>
              <managed-bean-name>LocaleBean</managed-bean-name>
              <managed-bean-class>
                   com.MusicStore.managedBeans.LocaleBean
              </managed-bean-class>
              <managed-bean-scope>request</managed-bean-scope>
         </managed-bean>
         <managed-bean>
              <managed-bean-name>CreateAccountBean</managed-bean-name>
              <managed-bean-class>
                   com.MusicStore.managedBeans.CreateAccountBean
              </managed-bean-class>
              <managed-bean-scope>request</managed-bean-scope>
         </managed-bean>
    </faces-config>
    When I include f:view or f:subview in welcome.jsp the page appears but withput tiles. Maybe my layout is wrog. I was using this kind of layout durng myfaces development.

  • Jsf and tiles

    hi all.
    i'm developing an application using jsf and tiles.
    i've some problem in the general layout page.
    how can I refer to images and files,if I don't know where the page will be used?
    with struts i've used <html:rewrite page=" ... " /> but it doesn't work with jsf.
    I only use the TilesServlet.
    any suggestion?
    i've also try to define the url like "/css/mycss.css" but in local dosn't work.
    thank a lot for any reply!

    hi all.
    i'm developing an application using jsf and tiles.
    i've some problem in the general layout page.
    how can I refer to images and files,if I don't know where the page will be used?
    with struts i've used <html:rewrite page=" ... " /> but it doesn't work with jsf.
    I only use the TilesServlet.
    any suggestion?
    i've also try to define the url like "/css/mycss.css" but in local dosn't work.
    thank a lot for any reply!

  • Using JSF and tiles

    Hi Friends,
    I'm trying to combine JSF and tiles as follows:
    Template file:
    <f:subview id="content">
    <tiles:insert attribute="content" flush="false"/>
    </f:subview>
    content file:
    <tiles:insert definition="userSpecific">
    <tiles:put name="content" type="string" >
    <h:outputText value="aaaa"/>
    </tiles:put>
    </tiles:insert>
    I get the following error when loading the content file:
    2007-06-20 10:14:10,578 [http-8080-Processor23] ERROR org.apache.myfaces.shared_impl.taglib.UIComponentTagUtils - Component javax.faces.component.UIViewRoot is no ValueHolder, cannot set value.
    I tried putting the template content in a verbatim tag and then it works
    but the content page is not displayed in correct place in the template...
    Thanks a lot in advance!

    Are you dead set on using tiles? I can see tiles including JSF but JSF including tiles? Not sure if that will work.
    My suggestion is to use Trinidad. It has the concept of Regions which is very "tiles" like and you will be far more successful.

  • Issue in using JSF and tiles

    Hai,
    I am using JSF and tiles in my application along with richfaces 3.2 jar but the suggestion box does not work when i use incorporate tiles to the jsp page,Please help me out.Here is my code
    Content Page
    <%@ taglib prefix= "f" uri="http://java.sun.com/jsf/core"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"  %>
    <%@ taglib uri="http://java.sun.com/jsf/core"   prefix="f"  %>
    <%@ taglib uri="http://java.sun.com/jsf/html"   prefix="h"  %>
    <%@ taglib uri="http://jakarta.apache.org/tiles"  prefix="tiles"  %>
         <f:view >
             <link href="<%=request.getContextPath()%>\styles\Form.css" rel="stylesheet" type="text/css"/>
             <link href="<%=request.getContextPath()%>\styles\Menu.css" rel="stylesheet" type="text/css"/>
             <link href="<%=request.getContextPath()%>\styles\Header.css" rel="stylesheet" type="text/css"/>
             <title><h:outputText value="Brand"/></title>
             <h:form id="testForm">
                 <tiles:insert definition="test_create" flush="false"/>
             </h:form>
         </f:view>JSP
    <%@ 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"%>
    <%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    </head>
    <f:subview id="come">
    <body>
    <h:form>
    <h:outputText value="Provider:" styleClass="SubTitle" />
    <h:inputText value="#{testMBean.property}" size="25" id="dpiSuggest" styleClass="SubTitle">
        <a4j:support event="onkeyup" />
    </h:inputText>   
    <rich:suggestionbox for="dpiSuggest" suggestionAction="#{testMBean.suggest}" height="180" width="180" var="suggest">
    <h:column>
    <h:outputText value="#{suggest.countryName}" />
    </h:column>
    <h:column>
    <h:outputText value="#{suggest.countryCode}" />
    </h:column>
    </rich:suggestionbox>
    </h:form>
    </body>
    </f:subview>
    </html>
    *tiles.xml*
    <tiles-definitions>
        <definition name="header-menu-content" path="/layout/basicLayout.jsp">
            <put name="gridClass"           value="headerMenuContent"/>  
            <put name="headerClass"         value="HeaderBgcolor"/>
            <put name="menuColumnClass"     value="MenuBorder"/>
            <put name="contentColumnClass"  value="BodyBgColor"/>
        </definition>
        <definition name="home" extends="header-menu-content">
            <put name="header"  value="/common/header.jsp"/>
            <put name="menu"    value="/common/menu.jsp"/>
            <!--<put name="buttonBar" value="/common/buttonBar.jsp"/>-->
            <put name="content" value="/common/home.jsp"/>     
        </definition>
        <definition name="error" extends="header-menu-content">
            <put name="header"  value="/common/header.jsp"/>
            <put name="menu"    value="/common/menu.jsp"/>
            <!--<put name="buttonBar" value="/common/buttonBar.jsp"/>-->
            <put name="content" value="/common/error.jsp"/>     
        </definition>
            <definition  name="test_create" extends="header-menu-content">
                 <put name="header" value="/common/header.jsp" />
                 <put name="menu" value="/common/menu.jsp" />
                 <!-- <put name="buttonBar" value="/common/buttonBar.jsp"/>-->
                 <put name="content" value="/test.jsp" />
             </definition>
        <tiles-definitions>
    *web.xml*
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" 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">
        <session-config>
            <session-timeout>
                30
            </session-timeout>
        </session-config>
        <welcome-file-list>
            <welcome-file>welcome.jsp</welcome-file>
            </welcome-file-list>
             <context-param>
        <param-name>com.sun.faces.verifyObjects</param-name>
        <param-value>false</param-value>
      </context-param>
      <context-param>
        <param-name>com.sun.faces.validateXml</param-name>
        <param-value>true</param-value>
      </context-param>
      <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>client</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>*.faces</url-pattern>
      </servlet-mapping>
    <context-param>
      <param-name>org.richfaces.SKIN</param-name>
      <param-value>blueSky</param-value>
      </context-param>
    <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>
            <servlet>
          <servlet-name>Tiles Servlet</servlet-name>
          <servlet-class>org.apache.tiles.servlets.TilesServlet</servlet-class>
          <init-param>
             <param-name>definitions-config</param-name>
             <param-value>/WEB-INF/tiles.xml</param-value>
          </init-param>
          <load-on-startup>2</load-on-startup>
       </servlet>
        </web-app>
    *facesconfig.xml*
    <?xml version="1.0" encoding="UTF-8"?>
    <faces-config version="1.2"
                  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-facesconfig_1_2.xsd">
        <navigation-rule>
                <navigation-case> <!-- Displayes the screen to add data -->
                <from-outcome>test</from-outcome>
                <to-view-id>/testContent.jsp</to-view-id>
                <redirect/>
            </navigation-case>
        </navigation-rule>
        <managed-bean>
            <managed-bean-name>testMBean</managed-bean-name>
            <managed-bean-class>testMBean</managed-bean-class>
            <managed-bean-scope>session</managed-bean-scope>
        </managed-bean>
      </faces-config>Edited by: SreeramIyer on May 29, 2008 4:50 AM

    Are you dead set on using tiles? I can see tiles including JSF but JSF including tiles? Not sure if that will work.
    My suggestion is to use Trinidad. It has the concept of Regions which is very "tiles" like and you will be far more successful.

  • Problem with jsf-tiles integration

    Hi , I'm trying to integrate jsf and tiles but I have some problems..
    I add
    <context-param>
         <param-name>tiles-definitions</param-name>
         <param-value>/WEB-INF/tiles.xml</param-value>
    </context-param>
    to web.xml and
    <view-handler>
    org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl
    </view-handler>
    in jsf-config.xml
    template file looks like:
    <f:view>
         <body>
         <table width="100%" border="1">
              <tr>
                   <td colspan="2">
                   <f:facet name="header">
                        <f:subview id="header">
                             <tiles:insert attribute="header" flush="false" />
                        </f:subview>
                   </f:facet>
                   </td>
              </tr>
    when I display the page I get all jsf code at beginning and the body without any jsf output bottom...
    I don't understand how I mistake
    Thanks for any help
    Luca

    Try to use <h:panelGrid> instead of the <table> tag.

  • Tiles integration with Jdeveloper11g

    Hi
    I am working on jdev11g and planning to integarte Tiles with it.
    I follow the steps given in Help document but unable to get success.
    To add a Tiles definitions file to a web application project:
    For a JSF application, Add Tiles Servlet definition to web.xml.
    when I add it it is unable to get TilesServlet class.
    Can u giude me or give some usefull liks from where i can get Step to Step info @ Tiles integration with jde11g
    Thanks for all Help.

    Jaydeep,
    Did you create a library (Tools -> Manage Libraries) containing the Tiles jar files and add that library to your project?
    John

  • JSF 1.2 + Shale Tiles Example needed

    Hello,
    I'm trying to develop application by using jsf 1.2 and Shale tiles. I have a problem with configuration. I was working before with Struts Tiles and MyFaces but it isn't the same.
    Can somebody provide my some exanle simle aplication of using Shale Tiles and JSF 1.2?
    Thx.

    To make templates in JSF we use Facelets here. I think Tiles = Strus , Facelets = JSF.
    Cya.

  • JSF 1.2  and Weblogic 10.3.6 compatibility issue

    Hi All,
    Our application have been developed in JSF 1.2 and spring DAO. We have deployed it on Weblogic 10.3.6 X86 server.
    We are facing an issue like on page load data are populated in the page. Say for example on page load company list getting populated and displayed in the drop down.
    If we do any operation like select a company code or submit the page all the data are flushed out from the pages. After that navigation of pages also doesnot work.
    We neither get any logs nor exception.
    And i am not getting this issue in my local weblogic server - 10.3.5
    We are struggling with this issue for more than 10 days now and its critical time for us to fix it ASAP.
    Thanks,
    Seetha

    Hi kalyan,
    We are not getting any logs. the control is going to javascript but the page get refreshed and all data are just vanishing.
    We have tried to add below entries in weblogic-application.xml
    <wls:prefer-application-packages>
    <wls:package-name>com.sun.facelets.*</wls:package-name>
    <wls:package-name>com.sun.faces.*</wls:package-name>
    <wls:package-name>javax.faces.*</wls:package-name>
    <wls:package-name>javax.servlet.*</wls:package-name>
    </wls:prefer-application-packages>
    No change.
    Tried this
    <wls:library-ref>
    <wls:library-name>jsf</wls:library-name>
    <wls:specification-version>1.2</wls:specification-version>
    <wls:implementation-version>1.2</wls:implementation-version>
    <wls:exact-match>false</wls:exact-match>
    </wls:library-ref>
    No Change.
    tried this
    <wls:prefer-application-resources>
    <wls:resource-name>APP-INF/lib</wls:resource-name>
    </wls:prefer-application-resources>
    No Change
    Anything we missing here. Why it is working in my local server and not in Integration server?
    Kindly help us.
    Thanks,
    Seetha

  • JSF 1.2 and SQJ injection

    Hi members;
    I am using JSF 1.2 with iBATIS as DAO layer, I wonder if the only way to avoid sql injection in my application is to write some code (either JavaScript or Java code) to reject all risky charaters before sending it to the DAO, is there another way at the JSF components .
    Regards

    Don't bother with JavaScript cause it can be override.
    If you're getting data from a backend database, you can use PreparedStatement (use with normal SQL statements) or CallableStatement (use with stored procedures) from Java's java.sql class. These methods can be easily integrated into your DAO class of your JSF project.
    And, if you're still paranoid after using the above methods, you can try to supplement the above methods with regex expressions to only accept white-list data i.e. data that can be executed in your database without causing you any harm.

  • Oracle Portal and Discoverer Integration

    Portal Version: 9.0.2.0.1
    RDBMS Versjion: 9.0.1.3
    OS/Vers. Where Portal is Installed:: Suse 7 SLES
    Error Number(s)::
    Oracle Portal and Discoverer Integration
    We're trying to integrate Discoverer with Portal unsuccessfully.
    We made many things in accordance with oracle's documentation until add discoverer portlets (worksheet and list of workbooks) in a test page.
    In view mode, the worksheet portlet shows the error:
    "The portlet has not been defined. The publisher must define the portlet by clicking on Edit Defaults for the portlet on the edit mode of this page. Please contact the publisher of this page."
    We think we have to edit properties before. Is this? Anyway edit worksheet portlet crashes between step 1 and 2. The error is: "The listener returned the following Message: 500 Internal Server Error".
    We have a public conection created in EM and a discoverer application which can be viewed using plus or viewer.
    Furthermore, it's not possible delete the added portlets neither the page that contain it. The error at delete is:
    Error: An unexpected error occurred: User-Defined Exception (WWC-44082)
    (WWC-00000)
    An unexpected error has occurred in portlet instances: User-Defined Exception (WWC-
    44846)
    An unexpected error occurred: User-Defined Exception (WWC-43000)
    The following error occurred during the call to Web provider:
    oracle.portal.provider.v2.PortletNotFoundException
    at oracle.portal.utils.v2.ContainerException.fillInStackTrace(Unknown Source)
    at java.lang.Throwable.<init>(Throwable.java:78)
    at java.lang.Exception.<init>(Exception.java:29)
    at oracle.portal.utils.v2.ContainerException.<init>(Unknown Source)
    at oracle.portal.provider.v2.PortletException.<init>(Unknown Source)
    at oracle.portal.provider.v2.PortletNotFoundException.<init>(Unknown Source)
    at oracle.disco.portlet.provider.DiscoPortletPersonalizationMgr.destroy
    (DiscoPortletPersonalizationMgr.java:65)
    at oracle.portal.provider.v2.DefaultPortletInstance.deregister(Unknown Source)
    at oracle.webdb.provider.v2.adapter.soapV1.ProviderAdapter.deregisterPortlet
    (Unknown Source)
    at java.lang.reflect.Method.invoke(Native Method)
    at oracle.webdb.provider.v2.utils.soap.SOAPProcessor.doMethodCall(Unknown Source)
    at oracle.webdb.provider.v2.utils.soap.SOAPProcessor.processInternal(Unknown Source)
    at oracle.webdb.provider.v2.utils.soap.SOAPProcessor.process(Unknown Source)
    at oracle.webdb.provider.v2.adapter.SOAPServlet.doSOAPCall(Unknown Source)
    at oracle.webdb.provider.v2.adapter.SOAPServlet.service(Unknown Source)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
    at com.evermind.server.http.ResourceFilterChain.doFilter
    (ResourceFilterChain.java:59)
    at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
    at com.evermind.server.http.ServletRequestDispatcher.invoke
    (ServletRequestDispatcher.java:523)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal
    (ServletRequestDispatcher.java:269)
    at com.evermind.server.http.HttpRequestHandler.processRequest
    (HttpRequestHandler.java:735)
    at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:151)
    at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)
    (WWC-43147)
    Edit properties for portlet List of Workbook works but in view mode we have the error in the portlet area:
    "Failed to refresh portlet. Please verify that the information used to create the
    portlet instance or customization is still valid. Otherwise, please contact your
    iAS administrator. oracle.discoiv.controller.FatalControllerException:
    DiscoNetworkException - Nested exception: org.omg.CORBA.OBJECT_NOT_EXIST: minor
    code: 0 completed: No null"
    Any ideas?
    Thanks

    Hi there,
    Have you applied any patches to 9ias since it was first installed? We had the same problem and had to apply a couple of patches to get the portlets working.
    1. Apply the 9.0.2.53.16 one-off patch for Oracle 9iAS Discoverer which takes Discoverer up to 9.0.2.53.16. This patch appears to be password protected and you need to get someone at Oracle support to give you a password.
    2. Apply the Discoverer Portlet Provider: 9.0.2.53.00c patch (patch no. 2595444) which gives you a new discportal.xsl file that actually works. It's this second step that solves your problem but you need to do step 1 before this. This is password protected as well.
    3. As you've upgraded Disco on the server to 9.0.2.53, you'll need to upgrade Disco Admin & Desktop within your 9iDS installation using patch no. 2555265. This is because Disco 9.0.2.53 uses an upgraded EUL that Disco Admin & Desktop need to be patched to use.
    This was the course of action Oracle support advised us about nine months ago. Of course they may have released a further patch to Disco that does 1 & 2 in one go, but we regularly carry out steps 1 and 2 on servers we use and we can use the Disco portlets successfully.
    Hope this helps
    Mark Rittman
    [email protected]

  • Unit testing and system integration testing for crystal report

    Hi gurus,
           I am creating crystal report by oracle procedure, will you please tell me how to do unit testing and system integration testing? appreciate very much.

    The focus of this forum is report design. The actual testing of reports would be subject to your own internal policies and procedures.
    Jason

  • Question regarding MM and FI integration

    Hi Experts
    I have a question regarding MM and FI integration
    Is the transaction Key in OMJJ is same as OBYC transaction key?
    If yes, then why canu2019t I see transaction Key BSX in Movement type 101?
    Thanks

    No, they are not the same.  The movement type transaction (OMJJ) links the account key and account modifier to a specific movement types.  Transaction code (OBYC) contains the account assignments for all material document postings, whether they are movement type dependent or not.  Account key BSX is not movement type dependent.  Instead, BSX is dependent on the valuation class of the material, so it won't show in OMJJ.
    thanks,

Maybe you are looking for