JavaServer Faces and Struts

For those of you interested in using JavaServer Faces and Struts together (and my mailbox indicates that this is quite a few people :-), I'm happy to announce the immediate availability of an integration library that allows you to use the EA3 release of JavaServer Faces with a recent nightly build (20030216 or later) of Struts 1.1 -- it will also work with the upcoming 1.1-rc2 and 1.1-final releases -- together. Nightly builds of the integration library are available at <http://jakarta.apache.org/builds/jakarta-struts/nightly/struts-faces/>.
The sources for this package are in the Struts CVS repository, in the "contrib/struts-faces" directory, and will be included in the source nightly distributions starting with the 20030307 version. It is not currently planned to include the struts-faces integration library with binary distributions of Struts 1.1, since it is still an EA quality release.
See the README.txt file (included in the nightly build) for more information on running the example application and using the integration library in your own applications.

What are the reasons not to have extended
RequestProcessor from Struts with the
capabilities of the FacesServlet... a sort of
"FacesProcessor" (extended the regular
RequestProcessor)? (should be nice for views
with no JSF components: in order not to execute
FacesServlet for each views , event if there is
no JSF component in the view)It turned out that I needed a customized RequestProcessor anyway (a couple of the processXxx methods had to work differently), but it actually would have been more work incorporating FacesServlet directly into it. In essence, there is now (in the combined version) a "front controller" for UI events , FacesServlet, and a "middle controller" for form submit events (RequestProcessor). When a UI event happens that just causes the current page to be redisplayed (think of a tree control where you click on the "expand this node" icon), you don't really want the Struts controller servlet to even be bothered by this request. Indeed, if you're using a presentation that was based on DHTML+Javascript, such an event would have been handled on the client anyway, and would never have been sent to the server at all.
The combined approach still supports Faces and non-Faces pages, though. This means you can migrate one page at a time and test things (which is exactly what I did when I ported the pages of the example app).

Similar Messages

  • JavaServer Faces and JavaFX

    Is JavaServer Faces and JavaFX the same?

    Nope, Java FX was only announced in May 2007 whereas JSF has been around for a few years now. JSF is a framework and JavaFX are a series of products.
    Try looking up Wikipedia for the info:
    http://en.wikipedia.org/wiki/Java_FX
    http://en.wikipedia.org/wiki/Java_Server_Faces
    Illu

  • JavaServer Faces or Struts - New insights anyone?

    Hello Everyone:
    JSP or Struts???!! I'm really lost.
    I've read almost every posting on the subject (on this and other forums), yet, I couldn't come with a solid conclusion (may be only inclinations).
    I've started developing my very first real-world web application which is to be up and running by December 2003. I've started reading on both Struts and JavaServer Faces so as to adopt either in that application.
    What complicates things is that I'm a new comer to the web-application world in general (let alone Struts and JSF).
    I'm inclined to use JSF (as it seems that it would be gaining more support and popularity in the near future), yet, It's still in the EA form, while Struts is matured and already popular.
    I'm in need of a Mentor's advice to direct me to the suitable technology as I regard this first project to be both an investment into my career and a robust/reliable front end to my capabilities.
    Appreciate your responses and suggestions. I also appreciate all your previous posts (especially Craig's ones), and apologize if this is an old topic.
    Kindest regards

    You must have read my posts then.
    I think JSF should be ALLWAYS compared to
    http://borland.com/products/downloads/download_csharpbuilder.html which is free (Borland C#) or
    http://www.asp.net/webmatrix/guidedtour/getstarted/tooloverview.aspx
    at all times, and people should pick the one that is cheaper in production or faster to develop on.
    It would be great to read someplace feature/cost comparison to
    http://borland.com/products/downloads/download_csharpbuilder.html
    I think if people are using EJB and/or Blueprints, they should use JSF (but wait till version 2.0?)
    If they are using Windows Servers, they should use Borland C#
    If you like JSF design and would like open source, this is most like JSF, IMO (note that it could support standards like XUL or X-Forms or WS/SOA):
    http://jakarta.apache.org/ecs
    My choice is this via SOA:
    http://examples.macromedia.com/petmarket/store.html
    Struts does have 6 books out and at least 4 places that offer training on it, and a production track record, it is an open standard, everyone (WW2, Spring, etc.) allways starts w/ "We are like Struts,... only better".
    .V

  • JavaServer Faces and Portal Servers

    Hi all,
    Do you think JavaServer Faces will have substantial applications in developing the user interface for a portal server? To me, it seems like the whole portal page with the tabbed panes and other gadgets could be one large JavaServer Faces component, composed of many smaller JavaServer Faces components. The user interface for a portlet for instance would be a smaller component that is a part of the larger portal page component. Does this make sense to you?
    Your ideas are appreciated.
    Thanks,
    Mete

    Hello Craig,
    Thanks very much for your reply. I think this topic is an exciting one: Making portal servers and portlets integrate well with JavaServer Faces.
    You said that JavaServer Faces will make it easy for portal servers to contain portlets that have JavaServer Faces components in their GUI, but understandably this does not mean that portlets will be required to have a GUI that is made out of JavaServer Faces. The portal server should be tolerant to any kind of GUI that a portlet may be using. So, how would a portal server that has its portal layout built completely with JavaServer Faces work well with portlets that do not have a JavaServer Faces GUI? Would JavaServer Faces make it easy to to embed GUI markup from non-Faces portlets into a portal page that is generated by a master JavaServer Faces component that encapsulates the whole portal page layout?
    How could a scenario like this be handled:
    The user device is a handheld device, so the master portal page JavaServer Faces component decides to use a WML renderer for generating the portal page instead of an HTML renderer. All of the JavaServer Faces enabled portlets are generated using the WML renderer, but the portlets that do not have a JavaServer Faces GUI cannot be rendered in WML. What should the master portal page JavaServer Faces component do in this case?
    Thanks,
    Mete

  • JavaServer Faces and servlet???

    Dear All,
    I'm very new to J2EE. I'm wondering, when should we used Java Servlet?
    If we develop with JavaServer Faces technology, do we code any servlets? I came accross the FacesServlet. The book says that it is included with the JavaServer Faces API and it seems that I don't need to write any code for this class.
    I'm very confuse. PLease help me...

    did you maybe forget to specify the /faces/* prefix within the URL?
    You have to configure the faces servlet to a prefix path and specify it within your URLs...

  • ADF Faces and Struts confusion

    Hello alltogether,
    I'm developing with struts for some years now but I'm completely new to ADF and Faces.
    I want to integrate a "simple" ADF Faces page with one TreeTable to an existent struts application.
    The idea I had is to create an action within the struts-config.xml inheriting from the DataAction or DataForwardAction in order to load and prepare the data for the TreeTableModel.
    When I call the ADF Faces page using the .do call for the Action created (I have to prepend /faces/ to the normal Action call) the page is rendered correctly but I do not enter my derived Action class at all.
    So my question is: How is the preferred way to fill the Model of the TreeTable before the ADF Faces page is rendered. The necessary datasource is obtained from a struts basic action throughout the whole application.
    I'm now struggeling with the pageDef.xml (using the documentation from here: http://www.oracle.com/technology/documentation/jdev/b25947_01/index.html) but I'm really lost since I do not understand what happens when and how resp. why it happens.
    All I want is the following: Prepare and load the necessary TreeModel before the page gets rendered (the appropriate model depends on a parameter which is given in the request that is send and which successfully response should be the ADF Faces page with the TreeTable filled with the appropriate data)!
    Can please somebody give me the necessary piece of advice?
    I'm trying for almost a day now!
    Many thanks in advance
    Best Regards

    Dear Mr. Vohra, It is not yet Clear whether we can use ADF Faces with Tiles,
    With out using Facelets, of MyFaces?
    Some users say they are using these two frameworks, but still complain of problems.
    And you are suggesting to use facelets with ADF faces .
    Can't we use ADF Faces and Tiles with out any other intermediate technology?
    Thanking you,
    Samba.
    Message was edited by:
    saasira

  • Faces and Struts Intregration

    Its a hot topic nowadays.but there is no any help/answer is avaialable in this forum...
    i and many other develpers want to intregarte both framework.
    anybody knows the TESTED n VALID examle or sampe application.kindly give us link here.....or if anybody has done it then kindly let me know here as i have done some examples but facing some problems.
    PLEASE HELP ME AS OON AS U CAN

    Dear Mr. Vohra, It is not yet Clear whether we can use ADF Faces with Tiles,
    With out using Facelets, of MyFaces?
    Some users say they are using these two frameworks, but still complain of problems.
    And you are suggesting to use facelets with ADF faces .
    Can't we use ADF Faces and Tiles with out any other intermediate technology?
    Thanking you,
    Samba.
    Message was edited by:
    saasira

  • JavaServer Faces and J2EE 1.4

    I have been trying to load the JSF sample .WARs from the Java Web services development pack but the J2EE verifier tool and the application server won't accept the .WAR giving me the following error:
    Error loading C:\Java\jwsdp-1.2\jsf\samples\jsf-cardemo.war: The content of element type "web-app" must match "(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,...
    Is there some way to configure the application server so that it will accept the JSF .WARs, or am I bettter off calling my EJBs from the provided JSWDP Tomcat server? I need the J2EE application server because I am using EJBs in my application.
    Any information would be helpful.

    I manged to fix the deployment descriptor by changing the web-ap declaration:
    <web-app version="2.4" 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">
    I also altered the xml declarationg at the beginning to the following, just in case it made a difference:
    <?xml version="1.0" encoding="UTF-8"?>
    This change seemed to make the verifier tool happy but the server choked on the .war file and caused the server to crash issuing about 6k of errors and warnings that started as follows:
    <[WARNING][j2eesdk1.4_beta2][][][14][org.apache.commons.beanutils.MethodUtils][30.October.2003 09:51:27:873 EST][Cannot setAccessible on method. Therefore cannot use jvm access bug workaround.
    java.security.AccessControlException: access denied (java.lang.reflect.ReflectPermission suppressAccessChecks)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)
         at java.security.AccessController.checkPermission(AccessController.java:401)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
         at java.lang.reflect.AccessibleObject.setAccessible(AccessibleObject.java:107)
         at org.apache.commons.beanutils.MethodUtils.getMatchingAccessibleMethod(MethodUtils.java:578)
         at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:243)
         at org.apache.commons.digester.CallMethodRule.end(CallMethodRule.java:499)
         at org.apache.commons.digester.Rule.end(Rule.java:276)
         at org.apache.commons.digester.Digester.endElement(Digester.java:1064)
         at org.apache.xerces.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:546)
         at org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope(XMLDTDValidator.java:2041)
         at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:1992)
         at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:902)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1073)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1535)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:348)
    Does the phrase "cannot use jvm access bug workaround" mean that there is a bug with virtual machine that JSF manages to bring up?
    From what I understand JSF uses Tomcat 5.0 and the Application Server uses parts of Tomcat.  Are there some resources that the application server needs to reference in order to be able execute the jsf applications?
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • JavaServer Faces and table

    Hello,
    I need to create a table as the following with a single column and more rows. I think I need a datatable component because my data are in a list but how can I display all the information in a single column?
    Thanks and bye,
    Giordano
    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
    <tr>
    <td width="100%">Title</td>
    </tr>
    <tr>
    <td width="100%">Authors</td>
    </tr>
    <tr>
    <td width="100%">Info</td>
    </tr>
    <tr>
    <td width="100%"> <hr></td>
    </tr>
    <tr>
    <td width="100%">Title</td>
    </tr>
    <tr>
    <td width="100%">Authors</td>
    </tr>
    <tr>
    <td width="100%">Info</td>
    </tr>
    <tr>
    <td width="100%"> <hr></td>
    </tr>
    <tr>
    <td width="100%">Title</td>
    </tr>
    <tr>
    <td width="100%">Authors</td>
    </tr>
    <tr>
    <td width="100%">Info</td>
    </tr>
    <tr>
    <td width="100%"> <hr></td>
    </tr>
    </table>

    A couple of choices:
    1. Transpose your data source list control so it can be used with a datatable.
    basically turn the columns into rows in the list control bound to datatable.
    2. Use a custom datatable that does what you're looking for. There are a few out
    there that do similar things to what you're looking for in case you don't want to
    build it yourself. I would not suggest that you do since some people already
    did it

  • JavaServer Faces and Data Bases - Help me!

    I am beginning in JSF and I have that to create one aplication using JSF.
    somebody could indicate me a site or send for me code samples of JSF and data base, using insert, delete and update?
    since already I am thankful!

    Serarch google for "JSF CRUD table". Also, please read SUN JDBC tutorial.

  • How do I use Struts Tiles with JavaServer Faces?

    I want to use JavaServer Faces and need something like tiles.
    Is it right that tiles is for struts what Portlets is for JavaServer Faces?
    Do I have to use Portlets or is there something else?
    What Do I have to do to use Portlets?
    Do I have to use any "engines" or something like that?
    Thanks

    Miikee_
    I guess you understood me wrong!
    JSF RI (and also MyFaces) are implementation of JavaServer Faces Spec.
    Each JSF app needs to be deployed inside of a Servlet Container.
    (like Tomcat). An no, they aren't coming up with an own servlet engine.
    But... you can also run MyFaces and the RI inside of an portlet container
    (eg pluto) instead of Servlet Container.
    HTH,
    Matthias

  • [ANNOUNCE] JavaServer Faces Resources Page

    Hi Everyone,
    I've compiled a list of everything related to JavaServer Faces and put a page on my website for it.
    Here it is:
    http://www.jamesholmes.com/JavaServerFaces/
    If you see anything that I've missed, feel free to drop me a line.
    -James
    [email protected]

    well did you notice that JSF EA4 has just been released ?
    I have one more link (but in french) :
    http://www.builder.fr/story/0,,t541-s2134284,00.html
    It says "Struts is dead, live JSF" (bad translation maybe...)

  • Selecting the JavaServer Faces in the Frameworks list diables FINISH button

    I create a new Web Application in Netbeans 5.5.1 by clicking the new project item from the FILE pull down list. I complete steps 1 and 2 and continue to step 3, FRAMEWORKS. A list of possible frameworks are listed with unchecked checkboxes. I highlight the JavaServer Faces and put a check in the checkbox. As soon as the checkbox is checked, the FINISH button becomes disabled. If I uncheck the JavaServer Faces, the FINISH button is enabled.
    What do I do to allow JavaServer Faces when creating a new web application project?
    It is not only the JavaServer Faces checkbox that disables the FINIISH button, ALL of the frameworks listed disable the FINISH button when I check them.

    Resolution: In Netbeans 5, click on the TOOLS menu pull down list. In that list, select Module Manager. A node listing of modules is displayed. Scroll down to the WEB node and click on the plus (+) to list the web modules. Uncheck the GWT4NB in the Active column. In my case it was version 1.3.4. Also uncheck the Struts Support in the active column, my version was1.3.30.1

  • 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

  • When to move from Struts to JavaServer Faces

    Hi all,
    we've noticed that JavaServer Faces appears to be the future for Model-View-Controller (MVC) framework, and eventually make Struts obsolete (IMHO).
    we are just about to embark on a new project and wondering if JavaServer Faces (JSF) is mature enough to deserve our attention, or should we wait until its full production release.
    any comments will be appreciated.
    regards,
    Trajano

    I would say if it's not at a full production release yet, then wait. If you have a real world app, it's not worth using a beta system to run it on. At least not without some thorough testing of your own, but only you know what your application needs.

Maybe you are looking for