How to Implement Strut Tiles  Framework in JSF

Hi
I am new to JSF tried to implent struts tiles in jsf 1.2 but i am facing some problm.
is any one have ideas about how to implementing struts tiles framework in jsf??....
Cheers
Sekar M

Hope the below URLs should answer your question
[http://www.jroller.com/HazemBlog/entry/how_to_use_struts_tiles]
[http://www.ibm.com/developerworks/library/j-integrate/]
[http://www.laliluna.de/blog/2007/02/28/struts_tiles_jsf_myfaces_migration_or_integration.html]

Similar Messages

  • How to  we  use Tiles Framework  with ADF Faces  ?

    Hello Every body,
    Can anyone tell me whether We mix Tiles framework of Struts, and ADF Faces Framework?
    I 've found that we can mix JSF and Tiles, but can we use ADF Faces and Tiles together?
    Waiting for your answer!
    Thanking you ,
    Samba.

    Dear Experts,
    Please help me !
    As I could not get enough help from you masters,
    I set out to do on my own, hoping that at some time you would come to my rescue.
    I designed a simple jspx page SiteLayout.jspx whose code is given below:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:af="http://xmlns.oracle.com/adf/faces"
    xmlns:afh="http://xmlns.oracle.com/adf/faces/html"
    xmlns:c="http://java.sun.com/jstl/core"
    xmlns:tiles="http://jakarta.apache.org/struts/tags-tiles">
    <jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
    doctype-system="http://www.w3.org/TR/html4/loose.dtd"
    doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>SiteLayout</title>
    </head>
    <body>
    <h:form binding="#{backing_SiteLayout.form1}" id="form1">
    <af:table id="PageLayout" width="100%" >
    <!-- <tiles:getAsString name="title" /> -->
    <f:subview id="siteview">
    <tiles:insert definition="siteLayoutDef">
    <af:table id="headertable" width="100%">
    <tr>
    <td width="100%" colspan="2">
    <f:subview id="header">
    <tiles:insert attribute="header"/>
    </f:subview>
    </td>
    </tr>
    <tr>
    <td width="100%" colspan="2">
    <f:subview id="topview">
    <tiles:insert attribute="topmenu"/>
    </f:subview>
    </td>
    </tr>
    <tr>
    <td width="100%" colspan="2">
    <f:subview id="navigationview">
    <tiles:insert attribute="navigationbar"/>
    </f:subview>
    </td>
    </tr>
    <tr>
    <td width="30%">
    <f:subview id="leftview">
    <tiles:insert attribute="leftmenu"/>
    </f:subview>
    </td>
    <td width="70%">
    <f:subview id="contentview">
    </f:subview>
    <tiles:insert attribute="content"/>
    </td>
    </tr>
    <tr>
    <td width="100%" colspan="2">
    <f:subview id="footerview">
    <tiles:insert attribute="footer"/>
    </f:subview>
    </td>
    </tr>
    </af:table>
    </tiles:insert>
    </f:subview>
    </af:table>
    </h:form></body>
    </html>
    </af:document>
    </f:view>
    <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_SiteLayout-->
    </jsp:root>
    My SiteLayout.jspx defines the layout of the pages on my Web application.
    My Home page is this:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:afc="http://xmlns.oracle.com/adf/faces/webcache"
    xmlns:af="http://xmlns.oracle.com/adf/faces"
    xmlns:afh="http://xmlns.oracle.com/adf/faces/html"
    xmlns:afi="http://xmlns.oracle.com/adf/industrial/faces"
    xmlns:graph="/webapp/graph.tld"
    xmlns:c="http://java.sun.com/jstl/core"
    xmlns:tiles="http://jakarta.apache.org/struts/tags-tiles">
    <jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
    doctype-system="http://www.w3.org/TR/html4/loose.dtd"
    doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>Home</title>
    </head>
    <body>
    <!-- <tiles:getAsString name="title" ignore="true" /> -->
    <h:form binding="#{backing_Home.form1}" id="form1">
    <tiles:insert definition="siteLayoutDef" flush="false">
    <tiles:put name="header" value="/Header.jspx" />
    <tiles:put name="footer" value="/Footer.jspx" />
    <tiles:put name="leftmenu" value="/LeftMenu.jspx" />
    <tiles:put name="content" value="/Content.jspx" />
    <tiles:put name="header" value="/TopMenu.jspx" />
    <tiles:put name="footer" value="/NavigationBar.jspx" />
    </tiles:insert>
    </h:form>
    </body>
    </html>
    </af:document>
    </f:view>
    <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_Home-->
    </jsp:root>
    My <tiles-defs> page is this:
    <?xml version="1.0" encoding="UTF-8" ?>
    <!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="tiles-defs"/>
    <definition name="siteLayoutDef" path="/SiteLayout.jspx">
    <!--<put name="title" value="SiteBean.getQuoteofDay()" /> -->
    <put name="header" value="/header.jspx" />
    <put name="footer" value="/footer.jspx" />
    <put name="content" value=""/>
    <put name="topmenu" value="/TopMenu.jspx"/>
    <put name= "leftmenu" value="/LeftMenu.jspx"/>
    <put name="navigationbar" value="/NavigationBar.jspx"/>
    </definition>
    </tiles-definitions>
    My Web.xml is this:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee">
    <description>Empty web.xml file for Web Application</description>
    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
    </context-param>
    <!-- Tiles ViewHandler config file -->      
    <context-param>      
    <description>Tiles configuration      
    definition files and a listener need to be defined.      
    the listener will initialize JspTilesViewHandlerImpl with tiles definitions.      
    </description>
    <param-name>tiles-definitions</param-name>      
    <param-value>/WEB-INF/tiles-defs.xml</param-value>      
    </context-param>
    <context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>/WEB-INF/faces-config.xml, /WEB-INF/tiles-defs.xml</param-value>
    </context-param>
    <context-param>
    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
    <param-value>.jspx</param-value>
    </context-param>
    <context-param>
    <param-name>oracle.adf.view.faces.ALTERNATE_VIEW_HANDLER</param-name>
    <param-value>
    org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl
    </param-value>
    </context-param>
    <filter>
    <filter-name>adfFaces</filter-name>
    <filter-class>oracle.adf.view.faces.webapp.AdfFacesFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>adfFaces</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>resources</servlet-name>
    <servlet-class>oracle.adf.view.faces.webapp.ResourceServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>resources</servlet-name>
    <url-pattern>/adf/*</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>35</session-timeout>
    </session-config>
    <servlet>
    <servlet-name>Tiles Servlet</servlet-name>
    <servlet-class>
    org.apache.struts.tiles.TilesServlet
    </servlet-class>
    <init-param>
    <param-name>definitions-config</param-name>
    <param-value>/WEB-INF/tiles-defs.xml</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
    </servlet>
    <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    </web-app>
    The Error I'm getting is :
    IllegalStateException :No ADFRenderingContext;
    What happened?
    Where did I go wrong?
    could you please help me?
    Thanking you in advance,
    Waiting for your response,
    Samba.
    Message was edited by:
    saasira
    Message was edited by:
    saasira
    Message was edited by:
    saasira

  • How to implement method level authorisation in JSF

    Hi all,
    I am new to JSF 2. I have been able to implement authorization on my web pages, but I also want to implement it at the bean level. Does JSF 2 provide an in-built functionality to implement role-based authorization on bean methods? Or, I need to use some security frameworks (i.e. ACEGI)?
    Thanks in advance,
    Neeraj

    I am curious: can you explain WHY you want method level security? It seems woefully overkill and paranoid to me - server level security should be enough to keep out rogue code.
    Anyway for that level of security, the security measures built into the JVM should be used.
    [Java Security documentation|http://java.sun.com/javase/technologies/security/]
    You can also look into a security API like Spring security - be warned though, it has a steep learning curve.

  • How to implement a "plugin system" in JSF?

    Hi!
    I would like to make a system with can be extended using JAR (or WAR?) plugins...I know how to do using Swing but I'm new in JSF and I have a lot of doubts, I'm trying to find something on the net, I know I can force the navigation to go to a specific page (I can put the entry page of every plugin in a database) but can I mix 2 war and connect one to another (like for example with an entry page from the first one to the second one)?
    if not what can I do? Am I have to rethink the thing?
    thanks a lot!!
    Demetrio Filocamo

    Swing is a desktop tecnology.
    JSF is a Web tecnology.
    If the 2 Wars are deployed as two different web sites, then you can do navigation bettween them, like you do on Html.

  • How to implement isTokenValid in JSF ?

    Hi guys,
    How to implement a same function in JSF for the org.apache.struts.action.Action.isTokenValid in struts ? Please help, Thanks !
    cheers,
    Mark

    Put your question in a Struts forum.

  • How to integrate Struts & JSF ?

    Hi all,
    How to build an application using Struts 'framework' and JSF ? (Example please)

    A good place to start is the Struts-Faces integration library:
    http://cvs.apache.org/builds/jakarta-struts/nightly/struts-faces/
    It supports the use of JSF components in a Struts-based application. If you already have a Struts application then this library would be useful.
    Justyna

  • JSF event handling - JSF/struts/tiles

    Has somebody had any luck integrating these technologies
    and having events for JSF work?
    Gisella

    I just came back from the Thanksgiving holiday.
    I followed the IBM tutorial and got the stuff to
    work. But I have JSF events that work fine when
    they were used in a framework with JSF only. Once I put
    Struts and Tiles, the events were not caught all the time;
    only some times. I traced the code and maybe
    because of Tiles, the Render Response Phase from JSF did not take place.
    "Ordinary Guy", when you said that you had an action listener hooked to a command button, I assume you refer
    to a JSF action listener. Right?
    Gisella

  • How to implement paging in struts

    is any body tell me how to implement paging in struts. because it works on action not on page URI.

    u will get so many TLDs' for this. just go googe

  • How to implement Post redirect Get Pattern in JSF

    Hi All,
    Will Post-Redirect-Get pattern solves the duplicate form submission in JSF 1.1 ? . Kindly provide valuable suggestion or implementation detail on PRG.
    Regards,
    Dev

    Continuation of this thread:How to prevent dupilcate form submission in JSF 1.x
    No, the PRG pattern will only make it less likely to happen. The user is still free to navigate back in the browser history to where the POST happened and then perform it again.

  • How to implement command pattern into BC4J framework?

    How to implement command pattern into BC4J framework, Is BC4J just only suport AIDU(insert,update,delete,query) function? Could it support execute function like salary caculation in HR system or posting in GL(general ledger) system? May I create a java object named salaryCalc which use view objects to get the salary by employee and then write it to database?
    Thanks.

    BC4J makes it easy to support the command pattern, right out of the box.
    You can write a custom method on your application module class, then visit the application module wizard and see the "Client Methods" tab to select which custom methods should be exposed for invocation as task-specific commands by clients.
    BC4J is not only for Insert,Update,Delete style applications. It is a complete application framework that automates most of the typical things you need to do while building J2EE applications. You can have a read of my Simplifying J2EE and EJB Development Using BC4J whitepaper to read up on an overview of all the basic J2EE design patterns that the framework implements for you.
    Let us know if you have more specific questions on how to put the framework into practice.

  • How to implement Edit Shared Settings (EDIT_DEFAULTS) mode in Struts jsr

    Could anybody tell me How to implement Edit Shared Settings (EDIT_DEFAULTS) mode in Struts JSr168 portlet?

    Could anybody tell me How to implement Edit Shared Settings (EDIT_DEFAULTS) mode in Struts JSr168 portlet?

  • How to link the resource bundle in JSF implemented in  eclipse?

    Kindly help me out

    This is how I called the resource bundle in JSF
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
    <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
    <f:view>
    <f:loadBundle basename="constantsUIProp" var="prop"/>
    <h:form>
    <h:inputText maxlength="#{prop.AREA_CODE_MAX}"></h:inputText>
    </h:form>
    </f:view>
    </body>
    </html>
    when i tend to build, it shows an error like+ Resource bundle cannot be found on the classpath+
    I have saved the resource bundle in WebContent/Web-Inf/classes/constantsUIProp

  • Can anyone tell me how to use Tiles framework in an existing JSP page

    I want to seperate my portal area using tiles. I'm looking for example on how I go about that.

    This book doesn't have information on how to use tiles in legacy JSP page. Let me rephase the question again:
    How do I place Tiles tags to an existing JSP page to seperate the areas in a page?

  • Tiles 2 and JSF integration in tomcat 5.5.25

    hi all,
    "Tiles 2" is a new project extracted from Struts and is now integrated with various frameworks...
    I'm wondering if anyone here succeed to run Tiles 2 with JSF on tomcat 5.5.25.
    I'd downloaded a test from maven: (The test application is not working in my environment... i'll be happy to hear about any success from one of you...
    http://repo1.maven.org/maven2/org/apache/tiles/tiles-test/2.0.5/
    File name: tiles-test-2.0.5.war
    This test application should work on java 5.0.
    I will be glad to here some advice,
    thanks
    Edited by: buz_word on Nov 19, 2007 6:50 PM

    Are you sure that a new session is being created in step 6? Tomcat can be configured to persist sessions between restarts. Maybe check getCreationTime() on the session?
    --Jon                                                                                                                                                                                                                                                                                                                                                               

  • Strut tile definition and bc4j

    Hi ,
    I am working on a BC4j Struts based project.I was on my way to implement tile definition thru a xml file and implementing do action forwards,for ex welcome.do,viewreport.do.For doing this I had to change the controller entry in struts-config.xml from
    <controller debug="3" locale="true" processorClass="oracle.jbo.html.struts11.BC4JRequestProcessor" contentType="text/html;charset=windows-1252"/>
    to
    <controller processorClass="org.apache.struts.tiles.TilesRequestProcessor" contentType="text/html;charset=windows-1252"/
    after I did this the actions I had implemented myself with to work with tile defs,they are working fine ,but there were some other actions(as I started with a wizard created bc4j strut app) which are bc4j related have stopped working because BC4JRequestProcessor was no more
    defined as the request processor....
    How to solve this?How to make both strut actions and bc4j actions work inside a project...can 2 request processors be used at the same time...
    can anybody help??

    check this weblog entry by Steve Muench
    http://radio.weblogs.com/0118231/2003/09/14.html
    success
    -Jan

Maybe you are looking for