JSF Tiles and Struts ActionForward

Hi All
I would like to use Tiles with my JSF application.
In order to get the best from Tiles i would like to use definitions.
the problem that most of the power of Tiles and definitions is coming from the use of ActionForward.
Does any one now how i can implement ActionForward with struts definition name in the Navigation in JSF.
I understand that i need to hack the Navigation model and get the Tiles bean from the Tiles using the outcome value.
Then i know that i need some how to get the tree that generates and forward it to the JSF or somthing like this.
Does any one have an idea how to do it???
Thanks
Noam

hi,
in MyFaces there is an example using JSF and Tiles.
MyFaces provides a custom ViewHandler faciltity.
see http://sourceforge.net/projects/myfaces
hope that helps.
Regards,
Matthias

Similar Messages

  • Framesets and Struts

    I'm trying to design a help page for my web application. I considered using framesets and frames to design the page. When I try to open the frameset (help.htm) in my application, it doesn't load the frames. I'm assuming this is because the <frame src="..."> required a relative path. Correct?
    How can I work around this? I even tried this <html:frame page="..."> but to no avail.
    Any other suggestions most welcome too.
    Thanks.

    I would suggest you to try Tiles and struts. You can define the tiles (to have the same look as your current frames) and the struts pages/jsp's could go into any of the defined tiles.
    Frames would have issues in different browsers and I am positive most of them will be cleared with tiles. For more info and usage check out
    http://struts.apache.org/1.x/struts-tiles/index.html
    Best
    B

  • JSF Actions and ActionListeners with Tiles and forms

    I�m having a problem trying to use the Tiles functionality in Struts 1.1 with JSF and was wondering if anyone could help me.
    I have defined a very simple header, menu, content Tile that doesn�t involve nesting of tiles (ExampleTile_content1Level.jsp).
    I have 3 JSP pages, the first testHarness.jsp is NOT built using Tiles and is just used to load some test data into a session scoped bean using an actionListener and then forward to a Tile generated page (ExampleTile3.jsp) using a hard-coded action �applicationSummary� when a commandLink is pressed. This works fine for both the action and actionListener.
    ExampleTile3.jsp contains another commandLink that is meant to forward to another tile ExampleTile2.jsp. This also works until I try to add the <h:form> � </h:form> tag around the outside of the <h:panelGrid> tags in ExampleContent1.jsp when the action and actionListener then fail to fire and I get an �Error on Page� message in Explorer the detail of which says �Error �com_sun_rave_web_ui_appbase_renderer_CommandLinkRendererer� is null or not an object�.
    However I need a form so that I can bind UI controls to data from the bean stored in the session scope. This is only a problem when I use Tiles to define the pages. Does anyone know what I am doing wrong?
    Any help would be much appreciated.
    Tiles.xml
       <definition name="example3" path="/pages/exampleTile_content1Level.jsp" >
              <put name="headerClass" value="someStyle"/>
              <put name="menuClass" value="someStyle"/>
              <put name="contentClass" value="someStyle"/>
              <put name="header-title" value="/pages/exampleHeader.jsp" />
              <put name="menu" value="/pages/exampleMenu.jsp" />
              <put name="content" value="/pages/exampleContent1.jsp" />
       </definition>
       <definition name="example2" path="/pages/exampleTile_content1Level.jsp" >
              <put name="headerClass" value="someStyle"/>
              <put name="menuClass" value="someStyle"/>
              <put name="contentClass" value="someStyle"/>
              <put name="header" value="/pages/exampleHeader.jsp" />
              <put name="menu" value="/pages/exampleHeader.jsp" />
              <put name="content" value="/pages/exampleContent2.jsp" />
       </definition>ExampleTile3.jsp
    <f:view>
         <h:form>
              <tiles:insert definition="example3" flush="false" />
         </h:form>
    </f:view> ExampleTile2.jsp
    <f:view>
         <h:form>
              <tiles:insert definition="example2" flush="false" />
         </h:form>
    </f:view> Faces-config.xml
    <navigation-rule>
        <from-view-id>/pages/testHarness.jsp</from-view-id>
           <navigation-case>
                <from-outcome>applicationSummary</from-outcome>
                <to-view-id>/pages/exampleTile3.jsp</to-view-id>
              <redirect/>
           </navigation-case>
    </navigation-rule>
    <navigation-rule>
        <from-view-id>/pages/exampleTile3.jsp</from-view-id>
           <navigation-case>
                <from-outcome>nextPage</from-outcome>
                <to-view-id>/pages/exampleTile2.jsp</to-view-id>
                <redirect/>
           </navigation-case>
    </navigation-rule> ExampleTile_content1Level.jsp
    <tiles:importAttribute scope="request"/>
    <h:panelGrid columns="1" >
         <f:subview id="header-title">
              <tiles:insert name="header-title" flush="false" />
         </f:subview>
         <f:subview id="menu">
              <tiles:insert name="menu" flush="false" />
         </f:subview>
         <f:subview id="content">
              <tiles:insert name="content" flush="false" />
         </f:subview>
    </h:panelGrid> ExampleHeader.jsp / ExampleMenu.jsp
    <tiles:importAttribute scope="request"/>
    <h:panelGrid columns="1" columnClasses="someSyle">
         <h:outputFormat value="This is the {0}.">
              <f:param value="Header / Menu as appropriate "/>         
         </h:outputFormat>
    </h:panelGrid> ExampleContent1.jsp
    <tiles:importAttribute scope="request"/>
    <h:form>     <----- Fails with this tag included but works without it.
    <h:panelGrid columns="1" >
              <h:outputFormat value="This is the {0}.">
                   <f:param value="Content on the FIRST page"/>
              </h:outputFormat>
              <h:commandLink action="nextPage" immediate="false">
                   <h:outputText value="Click to go to next page"/>
              </h:commandLink>
    </h:panelGrid>
    </h:form> ExampleContent2.jsp
    <tiles:importAttribute scope="request"/>
    <h:panelGrid columns="1" >
         <h:outputFormat value="This is the {0}.">
              <f:param value="Content on the SECOND page"/>
         </h:outputFormat>
    </h:panelGrid>

    jezzica85 wrote:
    Hi everybody,
    I want to overload a method so it can take either 2 Actions, 2 ActionListeners, or one of each. The issue with this is that I'd have to make 4 overloaded signatures and almost identical methods, like this:
    method( action, action )
    method( action, listener )
    method( listener, action )
    method( listener, listener )
    Well, if you want to support that then you are just going to have to do suffer through it, the only shortcut I can recommend is that your method(action, listener) and method(listener, action) are the same so you only have to implement 1 and just use the other as a entry point to call the one you wish to contain the code.

  • JSF,Tiles, Sun App Server and NetBeans 5.5

    hi all,
    here is my environment :
    1.Server - Sun Application Server (Running On Suse Linux OS)
    2.IDE - NetBeans 5.5
    3.Project - JSF with Tiles
    here i found topic about tiles and jsf :
    http://forum.java.sun.com/thread.jspa?threadID=643536&messageID=3792238 but i think that Tiles is best alternative for JSF Layout Manager (It's my mind).
    is there anybody help me how to integrate tiles with jsf ?
    here is my example :
    1.web.xml :
        <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-def.xml</param-value>
            </init-param>
            <load-on-startup>2</load-on-startup>
        </servlet>2. tiles-def.xml :
    <tiles-definitions>
             <!--****************************************************************-->
         <!--                     Global Layout                       -->
         <!--****************************************************************-->
         <definition name="global.layout" path="/pages/Mylayout/layout.jsp">
              <put name="title" value="Magti Billing System" type="string"></put>
                    <put name="subtitle" value="Magti Billing System" type="string"></put>
                    <put name="header" value="/pages/Mylayout/header.jsp"></put>
              <put name="subheader" value="/pages/Mylayout/sub_header.jsp"></put>          
              <put name="footer" value="/pages/Mylayout/footer.jsp"></put>
                    <put name="body" value="/pages/Mylayout/body.jsp"></put>
                    <put name="left_menu" value="/pages/Mylayout/left_menu.jsp"></put>
         </definition>   
    </tiles-definitions>3.and then i have 5 blank jsp pages : body.jps, footer.jsp, header.jsp, layout.jsp, left_menu.jsp, sub_header.jsp.
    4. here is my layout.jsp code :
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="1.2"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:jsp="http://java.sun.com/JSP/Page"
              xmlns:webuijsf="http://www.sun.com/webui/webuijsf"
              xmlns:tiles="http://jakarta.apache.org/struts/tags-tiles"
    >
        <tiles:importAttribute scope="request"></tiles:importAttribute>
        <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
        <f:view>
            <webuijsf:page binding="#{pages$Mylayout$layout.page1}" id="page1">
                <webuijsf:html binding="#{pages$Mylayout$layout.html1}" id="html1">
                    <webuijsf:head binding="#{pages$Mylayout$layout.head1}" id="head1">
                        <webuijsf:link binding="#{pages$Mylayout$layout.link1}" id="link1" url="/resources/stylesheet.css"/>
                    </webuijsf:head>
                    <webuijsf:body binding="#{pages$Mylayout$layout.body1}" id="body1" style="-rave-layout: grid">
                        <webuijsf:form binding="#{pages$Mylayout$layout.form1}" id="form1">
                            <h:panelGrid columns="2" cellspacing="0" cellpadding="0"
                                         border="0" styleClass="maingrid" columnClasses="maingrid">
                                <f:facet name="header">
                                    <f:subview id="header">
                                        <h:panelGrid columns="1" cellpadding="0" cellspacing="0">
                                            <tiles:insert attribute="header" flush="false" />
                                            <tiles:insert attribute="subheader" flush="false" />
                                        </h:panelGrid>
                                    </f:subview>
                                </f:facet>
                                <f:subview id="left_menu">
                                    <tiles:insert attribute="left_menu" flush="false" />
                                </f:subview>
                                <f:subview id="body">
                                    <tiles:insert attribute="body" flush="false" />
                                </f:subview>
                                <!--
                                <f:facet name="footer">
                                    <f:subview id="footer">
                                        <tiles:insert attribute="footer" flush="false" />
                                    </f:subview>
                                </f:facet>
                                -->
                            </h:panelGrid>
                        </webuijsf:form>
                    </webuijsf:body>
                </webuijsf:html>
            </webuijsf:page>
        </f:view>
    </jsp:root>5. and at last i have index.jsp:
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="1.2"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:webuijsf="http://www.sun.com/webui/webuijsf"
    xmlns:tiles="http://jakarta.apache.org/struts/tags-tiles"
    >
        <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
        <f:view>
            <webuijsf:page binding="#{pages$main$index.page1}" id="page1">
                <webuijsf:html binding="#{pages$main$index.html1}" id="html1">
                    <webuijsf:head binding="#{pages$main$index.head1}" id="head1">
                        <webuijsf:link binding="#{pages$main$index.link1}" id="link1" url="/resources/stylesheet.css"/>
                    </webuijsf:head>
                    <webuijsf:body binding="#{pages$main$index.body1}" id="body1" style="-rave-layout: grid">
                        <webuijsf:form binding="#{pages$main$index.form1}" id="form1">
                            <tiles:insert definition="global.layout" flush="false"/>
                        </webuijsf:form>
                    </webuijsf:body>
                </webuijsf:html>
            </webuijsf:page>
        </f:view>
    </jsp:root>but i get an error like this :
    Can't leverage base class
    java.lang.IllegalStateException
            at com.sun.faces.taglib.jsf_core.ViewTag.getComponentType(ViewTag.java:259)
            at javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:219)
            at javax.faces.webapp.UIComponentClassicTagBase.createChild(UIComponentClassicTagBase.java:458)
            at javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:643)
            at javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1070)
            at com.sun.faces.taglib.jsf_core.ViewTag.doStartTag(ViewTag.java:180)
            at org.apache.jsp.pages.Mylayout.layout_jsp._jspx_meth_f_view_0(layout_jsp.java:140)
            at org.apache.jsp.pages.Mylayout.layout_jsp._jspService(layout_jsp.java:99)
            at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
            at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:353)
            at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:412)
            at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:318)Any Ideas Is Usefull. Thanks.
    Paata.

    Hi,
    I'm trying to use Tiles with NetBeans 6.0. I used a similar set up as the other writer did, except for the JSP:root part:
    <jsp:root version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:webuijsf="http://www.sun.com/webui/webuijsf"
    xmlns:tiles="http://jakarta.apache.org/struts/tags-tiles">
    It complies and deploys OK, except it renders a blank page. The source code of the page is below. It seems that the "tiles:insertDefinition" was not expanded. Would you share some lights on how you get it to work. By the way I did not use shale-tiles, do I need it?
    Thanks in advance.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:wairole="http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy#" xmlns:waistate="http://www.w3.org/2005/07/aaa">
    <head>
    <meta content="no-cache" http-equiv="Pragma" />
    <meta content="no-cache" http-equiv="Cache-Control" />
    <meta content="no-store" http-equiv="Cache-Control" />
    <meta content="max-age=0" http-equiv="Cache-Control" />
    <meta content="1" http-equiv="Expires" />
    <title></title>
    <link rel="stylesheet" type="text/css" href="/apogee-web-1.0-SNAPSHOT/theme/com/sun/webui/jsf/suntheme/css/css_master.css" />
    <script type="text/javascript">
    var djConfig = {
        "isDebug": false,
        "parseWidgets": false,
        "debugAtAllCosts": false
    </script>
    <script type="text/javascript" src="/apogee-web-1.0-SNAPSHOT/theme/META-INF/dojo/dojo.js"></script>
    <script type="text/javascript" src="/apogee-web-1.0-SNAPSHOT/theme/META-INF/json/json.js"></script>
    <script type="text/javascript" src="/apogee-web-1.0-SNAPSHOT/theme/META-INF/prototype/prototype.js"></script>
    <script type="text/javascript" src="/apogee-web-1.0-SNAPSHOT/theme/META-INF/com_sun_faces_ajax.js"></script>
    <script type="text/javascript">
    dojo.hostenv.setModulePrefix("webui.suntheme", "/apogee-web-1.0-SNAPSHOT/theme/com/sun/webui/jsf/suntheme/javascript");
    dojo.require('webui.suntheme.*');
    dojo.require('webui.suntheme.widget.*');
    dojo.require('webui.suntheme.widget.jsfx.*');
    </script>
    <link id="link1" rel="stylesheet" type="text/css" href="/apogee-web-1.0-SNAPSHOT/resources/stylesheet.css" />
    </head>
    <body id="body1" style="-rave-layout: grid" onload="" onunload="">
    <form id="form1" class="form" method="post" action="/apogee-web-1.0-SNAPSHOT/faces/Apogee.jsp" enctype="application/x-www-form-urlencoded">
    <tiles:insertDefinition flush="false" name="global.layout" />
    <input id="form1_hidden" name="form1_hidden" value="form1_hidden" type="hidden" />
    <input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="H4sIAAAAAAAAAKVWTWwbRRR+Xmexm4LSOCgEiZRIFESFsk7bCyIUSFInsfBPZZsU2kM6Xk/sDevdYXbWXreiag+ABBcQIIEUBBIcemhP3HoAqh4QSEUiEhdOFReEBBwQEj8HYGZs79qOZZNkZD2vd957M98333vja7+A6lKYOJfaRDWkmcgqa9niJtbZ/JvfPP/hIeeoqQB4BAAiDoUTul3VHNfSNpCOHQ0RYho6YoZtaXmGGE4jC5UxTVaJeaRAMc7YJfz7xo3Prs+tfH63yFM/A2KsdOfBHsOWw7PwlDXEENX4PLEtbDFHO40oM5BZoKiGqYPMNQPXc7bNxCIQ3Vw3Svxz3HNegkug1Gdl/pl2/jouuoa26WwEGXnCMgaVcHusMyo0OGqVVU1QK9x2RSlDojAq8Shuu6LCg6NShvUiqCa3u1lr0S41QC1y2xWlDo5atmkV1A1uj3muiBJD8Z+iwRM//3GpEpcZpraKnEoaETXy/c1bk+e/DYOyDKOmjUrLSGc2TcIBVqHYqdhmySNPPyNT3FWPikSCAAZHRC6vpQC+My4mbem5XC6RKayvJRNn1nPZbEEsPsbg0TYCIQLhrHEcPKCIHKwt5RILhcQpGeTvUSp50bZNjKzbM/Tyd1t//6pA6CyoNWS62CMhBjP9dpBNn85mxB6Sp/I820SAeIFS1EgZDvOubE+//yX6IAyhJIw4xgUsCyRUHxHSY21teYSwQKACSUweyziIidHVQjq1vriQTy4xOBhfIHYZY342hC96KFg0ZevIxJf+HD+/NffXzwqMJCFa4dTrvLJSENFt12K0wSAmCzguYMfzjBpWeT4FUfHT5ZsRyz7A3WuIGshi8qdH/uWDATBQsCVeHe5mL2kxzIs59sNHn/xx5bXHFYG2xV57i9Iv41aLmL567d3pg+/ceaPdLkKEEF87oT7KUjuUJZ7u2SGSkHg9ISfv7eK3WYWdcu1pYS0Grm+v/fjT9MUVf08MIkXDKvG5YGsc9COdQghKQ7a0VS5gTPOi+bzw9acn3966nVZAScEB3USOk0HVNrmjDvcpyRgGk83jMOx4HnPKTeMCKpp4nkuCL3e4rWZsamuCz4RHeKmIBiiaWvjG1eKDD3/1nmiYFKaae9vpWh+9fO7OF/+8pUi3Cd8t8Pj4ldfzv53dflLCr5+AsYcutmQmBfry8DZJiCfQTfomJswUx7czUvrL6R4zUAXh3apACVQguiprd7ze5vVYO3S246jFU5zIr+NdhEhFDSFE3AAtQo76ZgAhTX/SB3TwNLb3ImheD/uELSgcBpv7tGCf9M0g2MI/OH1CAv9u0+/d/1BMJKCsl9vdgZcEDgEvbuIW+Gd9MwB805+IBn9/nJeh7VLeU+IOa5j8LsSYabrjBNuGPvju27skmrf4/iQhq2kIK+KfRouVp3wzgJWmf8/gd9asuM5nTdSwXfbETJkapZ4GEhsuh6m90yWu5rl90iUpH0KX+IvVokv3zQC6pH9nBe0YfUoF/gMrokC8ywsAAA==" />
    </form>
    <script type="text/javascript">
    webui.suntheme.common.body = new webui.suntheme.body('/Apogee.jsp', '/apogee-web-1.0-SNAPSHOT/faces/Apogee.jsp',null,null,'com_sun_webui_util_FocusManager_focusElementId');</script>
    </body>
    </html>

  • Integrating Struts, Tiles, and JavaServer Faces

    I have tried some sample applications in jsf. They are working properly. Basically, our application is based on struts. We fee that that it will be difficult to convert struts based application into jsf. So we plan to integrate jsf components into struts application. I found a site http://www.ibm.com/developerworks/library/j-integrate/ where jsf-struts integration material has been given. For this integaration, struts-faces.jar is required. when i try to start the server after struts-faces-1.3.8.jar placed in Tomcat 5.5\common\lib folder, server is not started properly. I have found struts-faces-1.3.8.jar in struts-1.3.8-lib. Should I user struts-faces.jar? if it is so, Where to find struts-faces.jar Please provide a solution for this problem.

    Wow, Srikanth. What a great contribution! I'm right at the begining of the design phase of a project that will hopefully go live in March and while I had already settled on a Tiles/Struts approach, I was really wanting to bring in JSF as well. I'm glad to see that someone is actively working on the integration components. I hope that the code modifications you propose make it into the Struts-Faces libraries soon.
    One question. While I've been deveolping J2EE webapps for a couple of years now,
    I'm still a little new to the Struts/Tiles arena. After reading your article at IBM developerWorks I wasn't able to ascertain whether or not what you proposed worked with the idea of individual controllers for each tile, which is a pattern that my project will need to adopt (I read about it in the short article here - http://www.theserverside.com/resources/article.jsp?l=Tiles101).
    Can you shed some light on the subject? Will the modifications you proposed allow Tiles to continue to work in that fashion?
    -Matt Welch
    Hi,
    Currently JSF, Struts and Tiles cannot work together
    out of the box.
    Craig McClanahan has come up with Struts-Faces which
    lets you integrate Struts and JSF. This is ideal for
    projects who want to protect their code investment in
    Struts and also want to take advantage of JSF once it
    is final.
    Unfortunately if you are also using Tiles, this is not
    possible because of some showstoppers on your way. I
    started on this venture a while back and ran into the
    same problems and decided to write some code - on top
    of Struts-Faces and was pretty successful.
    I am sharing this knowledge with the rest of you with
    this article of mine on IBM developerWorks
    http://www-106.ibm.com/developerworks/library/j-integra
    e/
    As already pointed out in this forum earlier, this
    article covers the steps to integrate the three and
    provides complete source code and also a working
    example.
    Hope you will find the article and the code useful.
    Thanks,
    Srikanth

  • Current status of Tiles and JSF integration

    Hi. I am new to JSF, and I have been researching Tiles integration with JSF. I've read a lot of posts about difficulties encountered when integrating them, and other posts seem to suggest that it is definitely do-able (some posts say using Shale Tiles is the way to go instead of using Struts tiles.)
    I have not found any definitive or straight forward tutorial on integrating Tiles and JSF. Is it a matter of the JSF technology not being fully developed? Will tiles be easily integrated (as it is in Struts) in the future, without jumping through hoops?
    Any opinions or advice would be greatly appreciated. I would rather not use JSF w/ JSP includes as an alternative. It seems as though Struts would be a better choice for what I have to do, unless I can integrate JSF and tiles functionality with relative ease.
    Thanks.

    Cold-Gin wrote:
    I have not found any definitive or straight forward tutorial on integrating Tiles and JSF. Is it a matter of the JSF technology not being fully developed? Will tiles be easily integrated (as it is in Struts) in the future, without jumping through hoops?I certainly wouldn't say that JSF technology is not fully developed by any stretch. It's certainly possible that there's some sort of impedance mismatch between the two, but Tiles support is hardly the measure of a framework's maturity. :P
    Having said that, I really can't say much more than that with regard to Tiles. What I can suggest, though, is JSFTemplating or Facelets. Both are mature products, engineered specifically for use with JSF. Facelets is probably the more popular of the two and is slated for inclusion in JSF 2.0 in some form, while JSFTemplating, which supports the Facelets syntax, is another strong alternative (which, incidentally, is what powers the GlassFish admin GUI).
    Hope that helps...

  • JSF, tiles, xml and xsl

    Good days people, I am employed at an app that wants to integrate JSF, tiles, xml and xsl.
    Basically the app receives information of the user's interfaz, builds an url with the above mentioned information and invokes to a service web that a xml returns with the information. The idea is to generate the exit in format html or wml with an insole(staff) xsl and to send the result in this format to every jsp that is going to form a part of the page that it will generate tiles. at first I understand that it is feasible, i�d like to know if someone already has done it and since it has done it.
    Just now what I have is a managed bean that receives the parameters of the altar frontal and invokes a method of a service, like this:
    public String encuentra(){
    //deja los atributos privados rellenos.
    String mensaje ;
    crearYRellenarBusquedaVO();
    try {
    setResultado(this.getServicio().obtenerResultadosWML(this.getBusquedaVO()));
    mensaje="succesNoJS";
    }catch(java.lang.IllegalArgumentException e){
    mensaje="error";
    }catch(es.yell.frontlite.exceptions.SrvBusquedaNoxtrumServiceException e1){
    mensaje="error";
    }catch(Exception e2){
    mensaje="error";
    return mensaje;
    public String obtenerResultadosWML(es.yell.frontlite.service.impl.BusquedaVO busquedaVO){
    if (busquedaVO == null){
    throw new IllegalArgumentException(
    "obtenerResultadosJSdesactivado(es.yell.frontlite.service.impl.BusquedaVO busquedaVO) - 'busquedaVO' no puede ser nulo.");
    try{
    return this.manejarObtenerResultadosWML(busquedaVO);
    }catch(es.yell.frontlite.exceptions.SrvBusquedaNoxtrumServiceException e1){
    throw new es.yell.frontlite.exceptions.SrvBusquedaNoxtrumServiceException(
    "Error ejecutando el servicio String obtenerResultadosJSdesactivado(es.yell.frontlite.service.impl.BusquedaVO busquedaVO). " + e1.getCause(),e1);
    }catch(Exception e){
    throw new es.yell.frontlite.exceptions.SrvBusquedaNoxtrumServiceException(
    "Error ejecutando el servicio String obtenerResultadosJSdesactivado(es.yell.frontlite.service.impl.BusquedaVO busquedaVO). " + e.getCause(),e);
    //it returns html code!
    protected String manejarObtenerResultadosWML(es.yell.frontlite.service.impl.BusquedaVO busquedaVO)
    throws java.lang.Exception{
    try{
    // xmlOrigen has full xml response from server
    String xmlOrigen = manejarObtenerResultadosJSActivado(busquedaVO);
    Source xmlSource = new StreamSource(new StringBufferInputStream(xmlOrigen));
    Source xsltSource = new StreamSource(SrvBusquedaNoxtrumServiceImpl.class.getResourceAsStream(Constantes.XSL_FILE));
    StringWriter cadenaSalida = new StringWriter();
    Result bufferResultado = new StreamResult(cadenaSalida);
    TransformerFactory factoriaTrans = TransformerFactory.newInstance();
    Transformer transformador = factoriaTrans.newTransformer(xsltSource);
    transformador.transform(xmlSource, bufferResultado);
    System.out.println(cadenaSalida.toString());
    return cadenaSalida.toString();
    }catch(Exception e2){
    throw new es.yell.frontlite.exceptions.SrvBusquedaNoxtrumServiceException (e2.getMessage());
    With this exit in html, since(as,like) how could i forward it towards a jsp especially?
    faces-config.xml
    <navigation-rule>
    <from-view-id>/index.jsp</from-view-id>
    <navigation-case>
    <from-outcome>succesNoJS</from-outcome>
    <to-view-id>/jsDesactivado.jsp</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>error</from-outcome>
    <to-view-id>/error.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    index.jsp
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <f:view>
    <f:loadBundle basename="MessageResources" var="msg"/>
    <head>
    <title>
    ${msg.titulo}
    </title>
    </head>
    <body>
    <h:form id="formulario">
    Que:
    <h:inputText id="campoQue" value="#{yellProxy.campoQue}" />
    Donde
    <h:inputText id="campoDonde" value="#{ yellProxy.campoDonde}" />
    <h:commandButton id="boton" value="Encuentra" action="#{yellProxy.encuentra}"/>
    </h:form>
    </f:view>
    </body>
    </html>
    jsDesactivado.jsp
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%--
    The taglib directive below imports the JSTL library. If you uncomment it,
    you must also add the JSTL library to the project. The Add Library... action
    on Libraries node in Projects view can be used to add the JSTL 1.1 library.
    --%>
    <%--
    <%@taglib uri=" http://java.sun.com/jsp/jstl/core" prefix="c"%>
    --%>
    <!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=UTF-8">
    <title>JSP Page</title>
    </head>
    <body>
    <h1>JSP Page</h1>
    jsDesactivado!!
    <%--
    This example uses JSTL, uncomment the taglib directive above.
    To test, display the page like this: index.jsp?sayHello=true&name=Murphy
    --%>
    <%--
    <c:if test="${param.sayHello}">
    <!-- Let's welcome the user ${param.name} -->
    Hello ${param.name}!
    </c:if>
    --%>
    <jsp:getProperty name="yellProxy" property="resultado"/>
    </body>
    </html>
    If you could pass me a simple example of use of an app that uses JSF, tiles, xml and xsl, i�be grateful
    regards a lot!

    We too (at Viking Freight) would also be very interested to see if anybody
    has produced such a useful series of classes...
    Frank Lees, Developer
    -----Original Message-----
    From: Amin, Kamran [mailto:kamran.aminframeworkinc.com]
    Sent: Wednesday, January 19, 2000 12:11 PM
    To: 'Forte User'
    Subject: (forte-users) XML and XSL in Forte
    Has anybody integrated an XSL parser with Forte. I know Forte provides us
    with an XML parser but that does not help with parsing XSL. There a lot of
    parsers written in JAVA but that will not integrate well with Forte. We
    need something that will be easy to integrate with Forte. This parser will
    take our XML and XSL to give us a result set. If anybody can comment on the
    subject or share some information I would appreciate it.
    thanks in advance.
    ka
    For the archives, go to: http://lists.sageit.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.sageit.com

  • JSF And Struts Integration

    Can any body give some info on integration of JSF to existing struts application

    I describe the main differences between JSF and Struts in this sample Chapter from my JSF book:
    http://www.oreilly.com/catalog/jsvrfaces/chapter/ch01.pdf
    Hope that helps.

  • JSF and Struts - differences and integration goal.

    I am a newbie J2EE developer and I am not clear about main differences between JSF and Struts also I saw couple of articles describing integration between JSF and Struts. Could someone give me an explanation, what the main conceptual differences between those technologies and what's the goal of integration both of them?

    I describe the main differences between JSF and Struts in this sample Chapter from my JSF book:
    http://www.oreilly.com/catalog/jsvrfaces/chapter/ch01.pdf
    Hope that helps.

  • Jsf-tiles example

    I want to insert a menu page in my actula jsp,
    I'm having the following code, this is not working and giving Exception nuul, I'm not able to find what is the problem, did any one had this kind of problem, can some one help.
    Error I'm getting is, Exception in:null] null
    ===============================loginPage.jsp=====================
    <!doctype html public "-//w3c//dtd html 4.01 transitional//en">
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
    <tiles:importAttribute scope="request"/>
    <f:view>
    <div class="bfrm" style="width: 72%;" >
    <div id="location"></div>
    <div style="height: 425px" class="cv_c">
    <h:form id="HomePage">
    <h:panelGrid columns="1">
    <h:dataTable>
    <h:column>
    <f:facet name="header">
    <td> <h:outputFormat style="width: 720px;" value="Receiving Schedules"/></td>
    </f:facet>
    </h:column>
    </h:dataTable>
    </h:panelGrid>
    <h:panelGrid columns="2">
    <h:panelGrid>
    <h:dataTable>
    <td><img src="/images/collage.jpg" align="left" height="400" width="567"></td>
    </h:dataTable>
    </h:panelGrid>
    <h:panelGrid>
    <td>
    <f:facet name="loginmenu">
    <f:subview id="loginmenu">
    <tiles:insert definition="lMenu" attribute="menu" flush="false"/>
    </f:subview>
    </f:facet>
    </td>
    </h:panelGrid>
    </h:panelGrid>
    </h:form>
    </div>
    </div>
    </f:view>
    =====================menu.jsp==================
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <h:dataTable>
    <h:column>
    <h:outputText id="menuName" value="Test"/>
    </h:column>
    </h:dataTable>
    ======================tiles-defs.xml ======================
    <definition name=".loginPage" extends=".mainLayout">
    <put name="content" type="page"
    value="/WEB-INF/pages/loginPage.jsp"/>
    </definition>
    <definition name="lMenu">
    <put name="menu" value="/WEB-INF/layout/menu.jsp"/>
    </definition>
    ========================================================

    have been having trouble trying to get Suns JSF working with struts-tiles. It seem I don't know how to link to it in the face-config.xml like you would normally do in struts-config.xml. Can you email your code, exspecially the xml files, so I can how it is wired up.
    Thanks!
    [email protected]

  • Navigation issue using jsf, tiles, tomahawk  :loosing faces context

    Hi all,
    I enhanced my webapp using tomahawks jscookmenu.
    Triggering 1 menuItem the wanted pages displays correctly but the next click anywhere in the application shows this error:
    org.apache.jasper.JasperException: javax.faces.FacesException: Faces context not found. getResponseWriter will fail. Check if the FacesServlet has been initialized at all in your web.xml configuration fileand if you are accessing your jsf-pages through the correct mapping. E.g.: if your FacesServlet is mapped to  *.jsf (with the <servlet-mapping>-element), you need to access your pages as 'sample.jsf'. If you tried to access 'sample.jsp', you'd get this error-message.The web config is like that:
    <?xml version="1.0"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
         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">
         <context-param>
              <description>Tiles MyFaces Config</description>
              <param-name>tiles-definitions</param-name>
              <param-value>/WEB-INF/tiles.xml</param-value>
         </context-param>
         <context-param> 
              <param-name>javax.faces.DEFAULT_SUFFIX</param-name> 
              <param-value>.jsp</param-value>
         </context-param>
         <context-param>
              <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
              <param-value>server</param-value>
         </context-param>
         <context-param>
              <param-name>javax.faces.PARTIAL_STATE_SAVING_METHOD</param-name>
              <param-value>off</param-value>
         </context-param>
         <!-- context-params mafaces -->
         <context-param>
              <param-name>org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS</param-name>
              <param-value>true</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.RENDER_VIEWSTATE_ID</param-name>
              <param-value>true</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.STRICT_XHTML_LINKS</param-name>
              <param-value>true</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.CONFIG_REFRESH_PERIOD</param-name>
              <param-value>this is a bug in myfaces</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name>
              <param-value>org.apache.myfaces.renderkit.html.util.DefaultAddResource</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.RESOURCE_VIRTUAL_PATH</param-name>
              <param-value>/faces/myFacesExtensionResource</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name>
              <param-value>true</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
              <param-value>true</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
              <param-value>true</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
              <param-value>true</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
              <param-value>false</param-value>
         </context-param>
         <!-- StartupServletContextListener -->
         <listener>
              <listener-class>
                   org.apache.myfaces.webapp.StartupServletContextListener
              </listener-class>
         </listener>
         <!-- Faces MyFacesExtensionsFilter -->
         <filter>
              <filter-name>MyFacesExtensionsFilter</filter-name>
              <filter-class>
                   org.apache.myfaces.webapp.filter.ExtensionsFilter
              </filter-class>
              <init-param>
                   <param-name>uploadMaxFileSize</param-name>
                   <param-value>1m</param-value>
              </init-param>
         </filter>
         <filter-mapping>
              <filter-name>MyFacesExtensionsFilter</filter-name>
              <url-pattern>/faces/*</url-pattern>
         </filter-mapping>
         <filter-mapping>
              <filter-name>MyFacesExtensionsFilter</filter-name>
              <url-pattern>*.jsf</url-pattern>
         </filter-mapping>
         <!-- Faces Servlet -->
         <servlet>
              <servlet-name>Faces Servlet</servlet-name>
              <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
              <load-on-startup>1</load-on-startup>
         </servlet>
         <!-- Faces Servlet Mapping -->
         <servlet-mapping>
              <servlet-name>Faces Servlet</servlet-name>
              <url-pattern>*.jsf</url-pattern>
         </servlet-mapping>
         <welcome-file-list>
              <welcome-file>index.jsp</welcome-file>
         </welcome-file-list>
         <servlet>
              <servlet-name>imageServlet</servlet-name>
              <servlet-class>my.com.xplorer.gui.v.ImageServlet</servlet-class>
         </servlet>
         <servlet-mapping>
              <servlet-name>imageServlet</servlet-name>
              <url-pattern>/image/*</url-pattern>
         </servlet-mapping>
    </web-app>So I lost the faces context using the jscookmenu, I believe.
    My webapp uses tiles, and there is 2 navigation possibilities: tomahawaks jscookmenu and tomahawaks commandNavigation.
    Latter one runs ok, I do use
    <t:panelNavigation id="nav" styleClass="navigation"
         itemClass="navitem" separatorClass="navseparator" 
         activeItemClass="navitem_active" openItemClass="navitem_open">
         <t:commandNavigation action="#{newsHandler.userRequest}" value="#{newsHandler.rss_source_name[0]}">
              <f:param name="navigator"  value="/jsf/news.jsp" />
         </t:commandNavigation>
    </t:panelNavigation>for this kind of navigation I do not use any navigation rules in faces config. To dynamically include the desired faces page I do that:
    <%
         String s = (String)request.getParameter("navigator");
         if (s == null || s.length() == 0 ) {
              s =  "/jsf/explorer.jsp";
    %>
    <jsp:include page="<%=s %>" />That does work.
    Now like I said I did enhance the app by adding tomahawks jscookmenu.
    Therefore I use the following in another tile:
    <t:jscookMenu layout="hbr" theme="ThemeOffice" styleLocation="resources/css">
              <%/* Availaible jscookMenu themes: ThemeIE, ThemeMiniBlack, ThemeOffice, ThemePanel
                 Availaible jscookMenu layout: hbr, hbl, hur, hul, vbr, vbl, vur, vul
                 respect to Heng Yuan http://www.cs.ucla.edu/~heng/JSCookMenu
            */%>
      <t:navigationMenuItem id="nav_0" itemLabel="#{localz.Xplorer}" action="Xplorer" />
    </t:jscookMenu>For this kind of navigation I tried to use navigation rules and the following show the config:
         <navigation-rule>
           <from-view-id>/jsf/*</from-view-id>
            <navigation-case>
                <from-outcome>Xplorer</from-outcome>
                <to-view-id>/jsf/tileMain.jsp?navigator=/jsf/explorer.jsp</to-view-id>
            </navigation-case>
            <navigation-case>
                <from-outcome>Tabs</from-outcome>
                <to-view-id>/jsf/tileMain.jsp?navigator=/jsf/tab.jsp</to-view-id>
            </navigation-case>
         </navigation-rule>That works for the first click. The desired page is shown. The nect click anywhere in the app then show the mentioned error.
    Using tiles I use this view-handler
    <view-handler>org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl</view-handler>One question is: can I use another view-handler on top of the above one? So I could extend com.sun.facelets.FaceletViewHandler and try my luck with this? Or is the solution pointed out just a millisecond from being ok, I just don�t see it?
    Maybe you need to know a bit more on how I use tiles:
    That is the page I start with. It inserts the tile shown underneath.
    <f:view locale="#{userLocale}">
         <f:loadBundle var="localz" basename="my.com.xplorer.gui.v.Lokalization" />
         <f:loadBundle var="bundle" basename="my.com.xplorer.gui.v.messages" />
         <f:subview id="tileMain">
              <h:form id="myJsfForm" styleClass="standard">
                        <tiles:insert definition="template" flush="false" />
              </h:form>
         </f:subview>
         <h:messages />
    </f:view>
    </html>The foolowing is the tile structure.
    The bodi tile is the dynamic part. Above you see that I dynamically load the pages into it.
    <t:htmlTag value="div" styleClass="pageLayout">
         <h:panelGrid columns="2" align="center" styleClass="pageContent">
              <f:facet name="header">
                   <f:subview id="header">
                        <tiles:insert attribute="header" flush="false" />
                   </f:subview>
              </f:facet>
              <t:htmlTag value="div" styleClass="pageMenu">
                   <f:subview id="menu">
                        <tiles:insert attribute="menu" flush="false" />
                   </f:subview>
              </t:htmlTag>
              <t:htmlTag value="div" styleClass="pageContentWoMenu">
                   <f:subview id="bodi">
                        <tiles:insert attribute="bodi" flush="false" />
                   </f:subview>
              </t:htmlTag>
              <f:facet name="footer">
                   <f:subview id="footer">
                        <tiles:insert attribute="footer" flush="false" />
                   </f:subview>
              </f:facet>
         </h:panelGrid>
    </t:htmlTag>Maybe you also need to know the tiles config?
    <tiles-definitions>
       <definition name="template" path="/jsf/tileTemplate.jsp">
              <put name="header"  value="/jsf/header.jsp"/>
          <put name="menu"    value="/jsf/menu.jsp"/>
          <put name="bodi"    value="/jsf/bodi.jsp"/>
          <put name="footer"    value="/jsf/footer.jsp"/>
       </definition>
       <definition name="/jsf/news.tiles" extends="template">
              <put name="bodi"  value="/jsf/news.jsp"/>
       </definition>
       <definition name="/jsf/explorer.tiles" extends="template">
              <put name="bodi"  value="/jsf/explorer.jsp"/>
       </definition>
       <definition name="/jsf/tab.tiles" extends="template">
              <put name="bodi"  value="/jsf/tab.jsp"/>
       </definition>If you have read until here: thanks very much.
    There seems to be a sort of gap regarding jsf navigation documentation.
    I mean the ordinary way is covered everywhere (the book I have covers that too), but jscookmenu seems not to fit in too good. I also tried it with an actionslistener in the jscookmenu but that failed, too. So a link to documents telling the truth on jsf navigation I would appreciate very much.
    Kind regards
    Belle Ile En Mer

    This is the error i am getting into now..
    exception
    org.apache.jasper.JasperException: An exception occurred processing JSP page /welcomeJSF.jsp at line 19
    16: This file is an entry point for JavaServer Faces application.
    17: --%>
    18: <body>
    19: <f:view>
    20: <h3><h:outputText value="CHOULTRY'S IN BANGALORE" /></h3>
    21: <h:form>
    22: <table border="0">
    Stacktrace:
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    root cause
    java.lang.RuntimeException: Cannot find FacesContext
         javax.faces.webapp.UIComponentClassicTagBase.getFacesContext(UIComponentClassicTagBase.java:1811)
         javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:1628)
         org.apache.jsp.welcomeJSF_jsp._jspx_meth_f_005fview_005f0(welcomeJSF_jsp.java:112)
         org.apache.jsp.welcomeJSF_jsp._jspService(welcomeJSF_jsp.java:86)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

  • Why should i use JSF rather than Struts?

    What makes JSF useful than Struts? In my project I am using like
    <h:commandButton action="#{loginbean.execute}" actionListener="#{loginbean.handleEvent}" ..../>
    In the above commandButton as you can see that i am not exposing the beanName. However i am exposing the beanMethod which are execute and handleEvent. Is there any other way to hide the name of the method because
    From what i understand is Presentation Layer should be shielded from whatever is going on in the backend. So, this doesn't do good right?
    Please suggest.
    How does Component and Renderers help. I am using encodeEnd() method in Renderer to render what the input or the output should look like. Do we need to switch to JSF from Struts just because of this... I don't see how and why components and renderers could help me..

    srikanthradix wrote:
    What makes JSF useful than Struts? In my project I am using like
    <h:commandButton action="#{loginbean.execute}" actionListener="#{loginbean.handleEvent}" ..../>
    In the above commandButton as you can see that i am not exposing the beanName. However i am exposing the beanMethod which are execute and handleEvent. Is there any other way to hide the name of the method because
    From what i understand is Presentation Layer should be shielded from whatever is going on in the backend.You can use "binding" and define everything in Java code if you want. You can rename your method to reflect what you want to see in the front end if you want. You can use JSFTemplating to use handlers which can be mapped to any name you want to see and do not have to match the method name of the java class (although I suspect this is the opposite direction from what you are suggesting you want).
    EL in jsf (i.e. #{bean.login}) is meant to do the mapping in JSF pages rather than externalize this in a separate file and force the page developer to edit multiple files for simple tasks. Although in some cases navigation is broken out into a separate file (i.e. faces-config.xml file using the default NavigationHandler navigation rules), this can also be done inline. It's a different way of doing development and has its pros and cons (easier, but mixes up presentation and controller somewhat). That said... JSF is very flexible, it CAN externalize any of this information, it just requires you to provide a different ViewHandler information that allows you to enter the data the way you like to see it (imo, you won't realize any benefit from the separation, though -- I used to think it was worth doing but have changed my opinion).
    So, this doesn't do good right?Perhaps in theory... but in practice, I don't think it really has a drawback. One caveat, I like how I implemented event handling in JSFTemplating as opposed to action/actionListener attributes which are not configurable and are more opaque than I prefer. My parameterized handlers allow for better code-reuse, but arguably mix up presentation and controller code even more (depending on how they're used).
    Please suggest.
    How does Component and Renderers help. I am using encodeEnd() method in Renderer to render what the input or the output should look like. Do we need to switch to JSF from Struts just because of this... I don't see how and why components and renderers could help me..The idea of a component helps tremendously as someone else can create a component for you and you can benefit from it. There are many great component sets available on the market (for free and for purchase). For example: Woodstock (which has drag/drop support inside NetBeans), RichFaces, IceFaces, Tomahawk, Scales, etc.
    Renderers allow you to cleanly separate the presentation of a component with the data of the component. You can then switch out the presentation to support multiple markups (i.e. client devices). In addition, JSF's rich lifecycle provide logical places for certain types of operations to occur, the renderers participate in this so that they are performing their tasks at a well defined time. And finally, many different components may re-use the same renderer, or a single component may use one of several renderers. The separation of data and display (model and view) makes this very clean.
    JSF is not Struts. If you expect it to be struts, you may be disappointed (or if you expect struts to be JSF, you'll be disappointed). JSF has a lot to offer (as does struts), you have to decide what is important to you and your organization. Some things to consider wrt to JSF: very strong vendor support; many large set of components to choose from; multiple standards-based tools to choose from; very flexible (most parts of the framework are pluggable); active growing development community; component-based model which encapsulates complexity for things like Ajax, pagination, and other things (often complicated in a non-component architecture); good integration with other frameworks.
    I don't know if this makes your decision any easier, but hopefully it helps clarify how you should be viewing JSF & Struts.
    Good luck!
    Ken Paulsen
    https://jsftemplating.dev.java.net

  • The Old Questions: JSF vs. Struts

    Hi there,
    I know this is not new to most of you, and I also read all the postings here and on the Struts website to JSF vs. Struts or better: JSF & Struts.
    In one posting I read that one should consider using JSF for projects in the long run, and use Struts now. Isn't that a very clear recommendation for JSF, and: doesn't that mean that Struts + Integration Library for JSF is not THE solution?
    Considering Struts 2.0, it is expected that JSF and Struts work together nicely and still the View (JSF) will be clearly separated from the Controller and Struts will maintain a strong emphasis on the Controller component.
    Would you agree that Struts 1.1 + Integration Library seems to be a kind of intermediary soltuin to the Struts 2.0 real integration with JSF till Struts 2.0 will come out, one should concentrate more on JSF alone?
    Tough, I know. I would appreciate all your answers.
    cu
    SVEN

    Would you agree that Struts 1.1 + Integration Library
    seems to be a kind of intermediary soltuin to the
    Struts 2.0 real integration with JSF till Struts 2.0
    will come out, one should concentrate more on JSF
    alone?My answer is based on what it is that you want to do. If you are building a product today, then I'd have to recommend that you focus on Struts alone rather then JSF or a hybrid of Struts and JSF.
    Struts is production stable, JSF is not.
    If you are learning a technology for the future, then you are probably correct in mastering JSF alone, and then learning how to integrate with Struts as that strategy matures.

  • Tiles and RichFaces ?? Calendar

    Do tiles and RichFaces can work together ? I have project, jsf 1.2, tiles, mvc spring, tomcat 6 and i'm trying to add richfaces calendar when I write <rich:calendar/> the calendar button shows but when I click nothing happens. When I write <rich:calendar popup="false" /> nothing appears on the page. Please help how to begin with RichFaces.

    Plnjmw, welcome to the forum.
    If you have Windows System Restore setup, I suggest going back to a Restore point before you began having the problem.  This will tell you if the update is the problem.
    Please click the "Thumbs up + button" if I have helped you and click "Accept as Solution" if your problem is solved.
    Signature:
    HP TouchPad - 1.2 GHz; 1 GB memory; 32 GB storage; WebOS/CyanogenMod 11(Kit Kat)
    HP 10 Plus; Android-Kit Kat; 1.0 GHz Allwinner A31 ARM Cortex A7 Quad Core Processor ; 2GB RAM Memory Long: 2 GB DDR3L SDRAM (1600MHz); 16GB disable eMMC 16GB v4.51
    HP Omen; i7-4710QH; 8 GB memory; 256 GB San Disk SSD; Win 8.1
    HP Photosmart 7520 AIO
    ++++++++++++++++++
    **Click the Thumbs Up+ to say 'Thanks' and the 'Accept as Solution' if I have solved your problem.**
    Intelligence is God given; Wisdom is the sum of our mistakes!
    I am not an HP employee.

  • Please hepl me. i m intergrating ejb3 and struts in two server. but is not working

    it is simple application i m runing in tow server but i m get classsnotfound error pleas solve my problem. i will give my direct structure of application
    i m runing ejb3 in weblogic 10.3 and struts in tomcat server. both communication is not happening pleas help me. i m try from many days. But is not working form me
    root dir
    onlyenb6
    account class
    package ejb3.onlyejb;
    import java.io.Serializable;
    import javax.persistence.Entity;
    import javax.persistence.Id;
    @Entity
    public class account implements Serializable{
    @Id
    int accno;
      public int getAccno() {
        return accno;
    public void setAccno(int accno) {
        this.accno = accno;
    public String getName() {
        return name;
    public void setName(String name) {
        this.name = name;
    public float getBalance() {
        return balance;
    public void setBalance(float balance) {
        this.balance = balance;
    String name;
    float balance;
    Int6_clss code
    package ejb3.onlyejb;
    import java.io.Serializable;
    public interface Int6_cls extends Serializable {
        public void storing(int acc, String name, float amt);
    Session.class code
    package ejb3.onlyejb;
    import javax.ejb.Remote;
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    @Stateless(mappedName="saigoud")
    @Remote
    public class Session_ben implements Int6_cls {
        @PersistenceContext
        EntityManager mrg;
        public void storing(int acc, String name, float amt) {
    System.out.println("session="+acc);
    System.out.println("sess="+name);
            account accs=new account();
            accs.setAccno(acc);
            accs.setName(name);
            accs.setBalance(amt);
            mrg.persist(accs);
    build.xml
    <project name="onlyejb5" default="saifile">
    <property name="bea.home" value="C:/bea"/>
    <property name="wl_home" value="${bea.home}/wlserver_10.3"/>
    <path id="main.class.path">
    <pathelement path="${bea.home}/modules/com.bea.core.utils_1.4.0.0.jar"/>
    <pathelement path="${bea.home}/modules/com.bea.core.jarbuilder_1.2.0.0.jar"/>
    <pathelement path="${java.class.path}"/>
    </path>
    <target name="saifile">
    <echo message="***ANT Script should run from inside the ${wl.home}/server/lib *****" />
    <echo message="***** ********* ********* *****" />
    <java classname="com.bea.jarbuilder.JarBuilder">
    <classpath refid="main.class.path"/>
    <jvmarg value="-d ${wl.home}/server/lib -jar wljarbuilder.jar"/>
    </java>
    </target>
    </project>
    after run with ant i get successfully create wlfullclient.jar
    i m taking this wlfullclient.jar and pasting in tomcat lib directery and run webapplication
    my webapplication code
    package ejb3.onlyejb;
    import java.io.Serializable;
    public interface Int6_cls extends Serializable {
        public void storing(int acc, String name, float amt);
    package ejb3.onlywed;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.util.Hashtable;
    import java.util.Properties;
    import javax.ejb.EJB;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import ejb3.onlyejb.Int6_cls;
    public class Action_cls extends Action {
            public ActionForward execute(ActionMapping map, ActionForm fm, HttpServletRequest req, HttpServletResponse res)
        throws IOException{
            String respkey="fails";
            Action_form_bean bean=(Action_form_bean)fm;
            int ac=bean.getAccno();
            String na=bean.getName();
            float bal=bean.getAmt();
            System.out.println("accno="+ac);
    System.out.println("na="+na);
    System.out.println("bal="+bal);
    System.out.println("enter in to if loop");
               Hashtable p=new Hashtable();
    p.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
    p.put(Context.PROVIDER_URL,"t3://localhost:7001");
            System.out.println("jndi properties nuderprocess");
               try {
    System.out.println("loading p file="+p);
                InitialContext ic = new InitialContext(p);
    System.out.println("loading p file over="+ic);
            System.out.println("jndi file is  loaded");
          //System.out.println("wrs="+wrs);
    System.out.println("entry in try block");
    Int6_cls wrs=(Int6_cls)ic.lookup("saigoud#ejb3.onlyejb.Int6_cls");
           System.out.println("lookup susfull");
              wrs.storing(ac, na, bal);
        respkey="ok";
              } catch (NamingException e1) {
    // TODO Auto-generated catch block
    e1.printStackTrace();
            catch (Exception e) {
                // TODO: handle exception
            ActionForward fw=map.findForward(respkey);
            return fw;
    get error
    accno=44
    na=hjhjhj
    bal=777.0
    enter in to if loop
    jndi properties nuderprocess
    jndi properties nuderprocess22
    loading p file={java.naming.provider.url=t3://localhost:7001, java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory}
    loading p file over=javax.naming.InitialContext@12f9bcd
    jndi file is  loaded
    entry in try block
    Jul 5, 2013 1:36:22 PM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet action threw exception
    java.lang.ClassNotFoundException: ejb3.onlyejb.Int6_cls
        at weblogic.ejb.container.deployer.RemoteBizIntfClassLoader.getClassBytes(RemoteBizIntfClassLoader.java:151)
        at weblogic.ejb.container.deployer.RemoteBizIntfClassLoader.loadClass(RemoteBizIntfClassLoader.java:96)
        at weblogic.ejb.container.internal.RemoteBusinessIntfGenerator.generateRemoteInterface(RemoteBusinessIntfGenerator.java:54)
        at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.readObject(RemoteBusinessIntfProxy.java:205)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1846)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
        at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
        at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:197)
        at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:564)
        at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:193)
        at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:62)
        at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:240)
        at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:348)
        at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
        at weblogic.jndi.internal.ServerNamingNode_1030_WLStub.lookup(Unknown Source)
        at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:392)
        at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:380)
        at javax.naming.InitialContext.lookup(InitialContext.java:392)
        at ejb3.onlywed.Action_cls.execute(Action_cls.java:62)
        at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
        at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:619)

    Locking multipost.

Maybe you are looking for

  • Anyone willing to give some advice in Tampa FL area?

    Post Author: hcso CA Forum: General Feedback I live and work in the Tampa/St. Petersburg FL area and was looking for a company that has implemented and using Business Objects Enterprise XI Release 2 SP2.  Preferrably with SQL Server 2000, IIS, .NET a

  • Feeln movie cant open .... I try open but hard

    I am first time about feeln movie  I did put username and password but wont open and don't accept... I try 4 time.. I am fail......

  • WLC with LAG mode enable connected to a switch HP in LACP mode

    I am trying to connect a WLC 4402 5.0.148.0 mode with an HP 2800 switch. The switch is configured thunk mode with LACP protocol. The WLC in LAG mode uses the protocol LACP? How can configure them switch HP? Thanks. Mirko Severi.

  • Problem when Synchronizing... Nokia 9500

    I have a huge problem. Everytime I try to do a synch I get message in the log saying that it's unable to find either C:\System\Data\Calendar and C:\System\Data\Contacts.cdb eventhough I loads of information stored in both my contacts and calendar. I'

  • Integration directory and cache connectivity test doesn't run correctly

    Hi, In a production system, I can't open any configuration object because of session hangs when i try to see a cc or a receiver determination or any other object. Moreover, when i try to made a cache connectivity test, it holds and doesn't finish. Wh