Using jsf with struts

hi;
i am trying to understand the proper architecture when using jsf and struts together.
i think i understand the differences between the technologies . it seems to me that instead of justifying jsf there should be a focus on how the two technologies actually collaborate.
specifically, i would like to know or see examples of things like replacing the view portion of struts and plugging in the jsf framework instead or how to i replace the struts actions with jsf commands or maybe they are totally different things.
where can i get information like this?
thanks.

At present, i think the best thing to do is to look at the example provided with the struts-faces integration taglib. I don't know any documentation about it.
http://cvs.apache.org/builds/jakarta-struts/nightly/struts-faces/

Similar Messages

  • Steps of Integrating JSF with struts

    Can anybody tell me the steps of intrgrate JSF with Struts
    Regds
    Amit Verma

    It's a better idea to upgrade your memory amount up to at least 1GB.

  • Using JSF and Struts

    I am a bit of a newbie in terms of UI applications on the JEE platform, so I apologize up front if this question seems silly. I was wondering if someone could comment on the approach below. Is this something that's possible or am I barking up the wrong tree?
    We have a vendor application that is written using Struts. We want to add a section of our own pages to this application, but we would rather use a more strategic approach in our pages, so we would like to use JSF for those.
    The original web.xml file in the vendor app uses a dtd of version 2.3 as shown below:
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    When I use JSF, I use a DTD version of 2.5 as shown here:
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    The problem is that when I use version 2.3, the elements needed to support JSF are invalid. When I use 2.5, the elements needed to support struts are invalid.
    Could someone comment in that, if you had this vendor app and you needed to add your own pages, is it not possible to use JSF in this scenario or if you can, what is the best approach to resolving this issue?
    Thank you in advance

    First make sure that your application server supports Servlet API 2.5. Whether the desired Servlet API version is supported or not solely depends on the application server implementation and version used. For example Tomcat 5.5 is a Servlet API 2.4 implementation which only supports the API versions up to with 2.4. If you want to use Servlet API 2.5, then you obviously need a Servlet API 2.5 implementation, for example Tomcat 6.0.
    Consult the website and/or documentation of the application server in question.

  • Oracle portal using JSF, JSP, Struts framework

    Hi ,
    Can anyone tell me how to build an oracle portal using JSF,Jsp and Struts Framework.
    Also please provide any manual or documentation for developing oracle portal.
    Thanks in Advance,
    Raghav

    At present, i think the best thing to do is to look at the example provided with the struts-faces integration taglib. I don't know any documentation about it.
    http://cvs.apache.org/builds/jakarta-struts/nightly/struts-faces/

  • How to use displaytags with struts

    How to use display tags with struts to generate report from database

    I think it would only consist in including the tag library of displaytags in the header and use the prefix of desplay tags.
    Exporting the report from a database would only need to retrieve this information from the database as a List, Map or Collection of objects (beans) and display tem with the corresponding tag (table)
    You have some more information here:
    http://displaytag.sourceforge.net/11/tut_basic.html
    Regards and good luck,
    Fran Serrano.

  • Unusual using jsf with own servlet

    Hi, it will be useful for me within my javax.servlet.Servlet class implementation I use JSF for printing output to my ServletResponse.
    What I must to do for it?
    thanks for suggestions.

    The simplest thing would be to forward to or include the appropriate URL that is handled by JSF. If for some reason this is not acceptable you might want to take a look at the implementation of the FacesServlet. But I would encourage you to pursue the forwarding/including solution first as it will be less fragile.

  • Using ajax with struts 1.2.9

    Hello Experts ,
    First of all I am sorry if I have posted question in a wrong forum but I have tried posting my problem in struts forum also but didn't get reply & I am pretty new to struts.
    I am trying to use ajax in struts 1.2.9.I have used 1 dependent combo.When I am changing value in 1 combo it will call an action class which will fetch data for 2nd combo .My problem is ,action class "success" has to be forwarded to some particular jsp.But I want to refresh only a part of page not the whole page.How to refresh just a part of page?? Any idea or any link which can help me.Any help in this will be highly appreciated.Many many Thanx in advance.

    Hello Shasi,
    Lets take the sample code for one combo box (College) , one change of which I want to display the information of that college in the textboxes below it.So on change of college combo I am calling the action class which is retrieving info of college.My problem is now how to send this data to jsp & what should be the success & failure forward for my action class.
    In my JSP I have written something like this....
                           createXMLHttpRequest();
                            queryString2 ="retrieve_college_info.do?";
                            queryString2 = queryString2 + "selcollege="+document.forms[0].college_name.options[document.forms[0].college_name.selectedIndex].value;
                            xmlHttp.open("GET", queryString2, true);
                            xmlHttp.onreadystatechange = handleCollegeRetrieve;
                            xmlHttp.send(null);My action class code goes like this
    package ibm.tgmc_nextyear.actionclass;
    import ibm.tgmc_nextyear.businesslogic.*;
    import ibm.tgmc_nextyear.formbean.*;
    import java.io.PrintWriter;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionMapping;
    import org.apache.struts.action.ActionForward;
    import java.sql.*;
    import java.util.ArrayList;
    import org.apache.struts.util.LabelValueBean;
    public class CollegeRetrieveInfoAjaxAction extends org.apache.struts.action.Action {
        public ActionForward execute(ActionMapping mapping, ActionForm  form,
                HttpServletRequest request, HttpServletResponse response)
                throws Exception {
                   String optionSelected = request.getParameter("selcollege");    
                   String responseText="";
                   Connection conn = null;
                   Statement stmt = null;
                   ResultSet rs = null;
                   TeamDetailsForm team_frm = null;
                   try {
                        conn = getDataSource(request).getConnection();
                        stmt = conn.createStatement();
                rs = stmt.executeQuery("select name , address  , city , pincode , ph_no , hod_name , principal_name , alt_no , website from user.college_table where college_id=" + optionSelected);
    *//what after this ???*
            } finally {
                if (rs != null) {
                    rs.close();
                if (stmt != null) {
                    stmt.close();
                if (conn != null) {
                    conn.close();
             *//what should be the value os success forward*
           return(mapping.findForward("success"));
    }

  • Best Practices for Using JSF with AJAX - BluePrints OR Ajax4Jsf ?

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

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

  • ALBPM5.7: Using ALUI with struts application??

    I have a fully functional struts application that uses PAPI to interact with ALBPM5.7. Now I want to Expose all UI screens on the portal server. This need not be portlets, rather using ALUI framework/ EDK to wrap the UI JSPs and expose them in our portal
    Can I reuse my Struts Application with ALUI in some way.
    Thanks.
    Edited by [email protected] at 12/11/2007 9:49 PM

    Ravinder,
    Yes, of course you can bring your struts web application on ALUI portal as a portlet.In general, any web application running either on remote server or ALUI server can be brought up to the ALUI portal.
    If your Struts application is running on the remote server ,here is the steps to view this application on ALUI Portal :
    Login to your ALUI admin ( http://<hostname>:<portnumber >/portal/server.pt(like http://yh759.yashind.com:7001/portal/server.pt) with Administrator as userid(no password required by default)
    Create a Remote server in ALUI where you need to have the info of your Struts application server info
    Create a remote webservice for portlet
    Create a portlet out of that remote webservice
    Put this portlet on any page.
    Alo you can find the online help on ALUI admin conosle for doing all the above steps.
    Thanks
    Bishnu
    Regards
    Bishnu

  • Use JSF with Portlet JSR 168 Specification

    Hi
    I need to know.... is possible run JSF application with Portlet Specification JSR 168, using Pluto Portal and Apache Tomcat ???
    Best Regards
    Mauricio

    Hi,
    the Apache Jetspeed2 - Project has a bridge,
    that is designed to work with MyFaces.
    http://cvs.apache.org/viewcvs.cgi/jakarta-jetspeed-2/portals-bridges/myfaces/
    Hope it helps you.
    Regards,
    Matthias

  • Using javascript with struts

    hi ,
    i have a jsp page which has a function to be called in javascript,
    if all the values entered are correct, then the details need to be submitted to the action form in struts.
    the coding is like below:-
    <%@ page language="java"%>
    <%@ taglib uri="/WEB-INF/struts-bean.tld"      prefix="bean"%>
    <%@ taglib uri="/WEB-INF/struts-html.tld"     prefix="html"%>
    <%@ taglib uri="/WEB-INF/struts-logic.tld"     prefix="logic"%>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Title</title>
    <link href="css/cherrysoft.css" rel="stylesheet" type="text/css" />
    <script language="javascript" src="javascripts/function_client.js" type="text/javascript"></script>
    <script src="javascripts/chgoto.js" language="JavaScript" type="text/javascript"></script>
    <script language="JavaScript">
    function fixSize() {
         buttondiv.style.top =  document.body.offsetTop +(document.body.offsetHeight - buttondiv.offsetHeight );
         contentDiv.style.height = document.body.offsetHeight -  buttonbar.offsetHeight - buttondiv.offsetHeight-14;
         function cancel(obj){
    obj.action="FinanceView.do?do=listBook";
              obj.submit();
         function check_details(obj)
              var frmyear=document.forms[0].fin_fromyear.value;
              var frmmonth=document.forms[0].fin_frommonth.value;
              var toyear=document.forms[0].fin_toyear.value;
              var tomonth=document.forms[0].fin_tomonth.value;
              var yearabbr=document.forms[0].fin_year_abbr.value;
              //alert("From Year : "+frmyear+" frmmonth : "+frmmonth + " : toyear "+toyear+" : to month "+tomonth);
              if(yearabbr.length < 1)
                   alert("The abbreviation field is mandatory");
                   document.forms[0].fin_year_abbr.focus();
              else if(frmyear.length < 1)
                   alert("The from year field is mandatory");
                   document.forms[0].fin_fromyear.focus();               
              else if(frmmonth.length < 1)
                   alert("The from month field is mandatory");
                   document.forms[0].fin_frommonth.focus();
              else if(toyear.length < 1)
                   alert("The to year field is mandatory");
                   document.forms[0].fin_toyear.focus();               
              else if(tomonth.length < 1)
                   alert("The to month field is mandatory");
                   document.forms[0].fin_tomonth.focus();               
              else if(frmyear == toyear)
                   alert("The from and to year cannot be same");
                   document.forms[0].fin_fromyear.focus();
              else if(frmmonth>4)
                   alert("The from month cannot start from "+frmmonth);
              else if(tomonth<3)
                   alert("The to month cannot be less than "+tomonth);
              else if(frmmonth==tomonth)
                   alert("The from month and to month cannot be same");
              else
                   obj.action="FinanceView.do?do=listBook";
                   obj.submit();
    </script>
    </head>
    <body onLoad="fixSize();" >
    <html:form action="/FinanceBeanAdd">
    <div style="height:5%;width:100%" >
         <div id="buttonbar" style="border:0px ;margin-top:0px">
         <table width="100%" cellspacing="0" class="main" >
          <tr>
                   <td class="heading" >Add Financial Year Details</td>
                     <td width="24" background="<%=request.getContextPath()%>/images/bg-titlemid.jpg"></td>
                      <td width="100"  valign="bottom" background="<%=request.getContextPath()%>/images/bgline.gif"></td>
          </tr>
         </table>
         </div>
    </div>
    <DIV id="contentDiv" class="workareadiv"  style="height:85%;width:100%">
    <table width="600px" height="380px" align="center" border"0" cellpadding="0" cellspacing="0">
         <tr>
              <td valign="top">
                   <table border="0"align="center" cellpadding="0" cellspacing="0" >
                        <tr>
                             <td  colspan="2">
                             <table width="600px" height="380px" border="0" align="center" cellpadding="0" cellspacing="0" >
                                  <tr>
                                       <td colspan="3" bgcolor="#FFFFFF">
                                            <tr>
                                                      <td colspan="3" valign="top">
                                       <div  id="enter_details" style=display:block>
                                       <table border="0" bgcolor="#FFFFFF" width="730px" >
    <tr bgcolor="#FFFFFF" class="firstrow">
    <td width='30%' align='left'style="padding-left: 40px" >
    <b>Abbreviation</b><font color='red'>*</font>
    </td>
    <td width='70%'>
    <html:text property="fin_year_abbr" maxlength="7"/></td>
    </tr>
    <tr bgcolor="#FFFFFF" class="secondrow">
    <td width='30%' align='left'style="padding-left: 40px" >
    <b>From Year</b><font color='red'>*</font>
    </td>
    <td width='70%'>
    <html:text property="fin_fromyear" maxlength="4" /></td>
    </tr>
    <tr bgcolor="#FFFFFF" class="firstrow">
    <td width='30%' align='left'style="padding-left: 40px" >
    <b>From Month</b><font color='red'>*</font>
    </td>
    <td width='70%'>
    <html:text property="fin_frommonth" maxlength="2" /></td>
    </tr>
    <tr bgcolor="#FFFFFF" class="secondrow">
    <td width='30%' align='left'style="padding-left: 40px" >
    <b>To Year</b><font color='red'>*</font>
    </td>
    <td width='70%'>
    <html:text property="fin_toyear" maxlength="4" /></td>
    </tr>
    <tr bgcolor="#FFFFFF" class="firstrow">
    <td width='30%' align='left'style="padding-left: 40px" >
    <b>To Month</b><font color='red'>*</font>
    </td>
    <td width='70%'>
    <html:text property="fin_tomonth" maxlength="2" /></td>
    </tr>
                             <tr>
                                                           <td>
                                                           <logic:messagesPresent>
                                                                <ul><font color='red' >
                                                                     <html:messages id="error1">
                                                                          <li><%= error1 %></li>                         </html:messages>
                                                                     </font>
                                                                </ul>
                                                           </logic:messagesPresent>
                                                           </td>
                                                           </tr>
                                                           </table>
                                                           </td>
                                                           </tr>
                                            </td>
                                       </tr>
                                  </table>
                                  </div>
                                  </td>
                             </tr>
                             </table>
                        </td>
                   </tr>
              </table>
    </td>
    </tr>
    </table>
    </div>
               <div id="buttondiv" style="height:10%">
                                                                       <table width="100%" align="left" border="0" cellpadding="3" cellspacing="0"  class="main" >
                                                                     <tr>
                                                                          <td colspan="4" bgcolor="#FFFFFF">
                                                                               <table border="0" cellpadding="2" cellspacing="2" align="left">
                                                                               <tr>
                                                                               <td>
                                                                                    <div align="left" id="save_btn">
                                                                                    <!-- <html:button property="do" value="Save" onclick="check_details(this.form);"/>-->
                                                                                         <!--<html:submit property="do" value="Save"/> -->
                                                                                     <input type="button" value="Save" onclick="check_details(this.form);"%>
                                                                                    </div>
                                                                               </td>
                                                                               <td><div align="left">
                                                                               <html:button property="Cancel" value="Cancel" onclick="cancel(this.form);"/>
                                                                               </div></td>
                                                                               </tr>
                                                                               </table>
              </div>
    </html:form>
    </body>
    </html>
    [/b]the problem right now is when the values are entered the details are not getting stored and it returns to the view.
    pls require someone's help.
    thanks
    sreejith

    I don't see anything at all in that code that has anything to do with JDBC.
    So certainly that code by itself can't store anything in a database.

  • How to plot bar chart using iReport with Struts 2

    Hi All
    Im working on iReport 3.5.1 to generate jasper report for our java enterprise application. Here, I have no problem, when im generating simple report[without any chart]. When i try to add a bar chart to jasper report, i coudnt get the exact chart what i wanted, im just getting some ridiculous chart which is exactly wrong, i guess the problem is with the data given to plot the chart. Do, anybody know how to transport data to plot the bar chart in iReport. For Simple chart im using javabeans to generate report, but for chart, how it should be?
    Thanks in advance
    Thanks and Regards
    Baskaran
    Edited by: Baskaran on May 22, 2009 12:36 PM

    jxl does not support create chart from scratch.
    Maybe you can do it by using excel template:
    define a chart in the sheet,using definedName or fixed range as chart data source.

  • Portal Development using JSF & Struts

    Can some one explain about the feasibility of developing portals using JSF and Struts? What are the advantages and disadvantages of doing so? Is it a right decision to develop portal servers using these?

    Yes I am familiar with all those links. Let me break down scenario and ask specific questions.
    Server version: Netweaver 7.0 (2004s) SP18
    1. Created External Library DC (i.e. ebuslib)
             - added 3rd party JARS (e.g. hibernate, Spring)
             - created two public parts - one for compilation, one for assembly (deploy)
             - activated activity
    2. Create J2EE Server Component - Library DC (i.e. ebuslib2)
              - added "ebuslib" assembly PP as Used DC (build only)
    3. Built "ebuslib2"
              - can see jars in the resulting sda file.
              - activated activity
              - confirmed on J2EE engine deployed library containing the jars.
    Scenarios
    A. EP Project DC
               - needs access to 3rd party jars
               - QUESTION: What do I need to reference? The External Library DC or the J2EE Server Component Library DC?
                             - I read that you should reference the J2EE Server Component BUT the jars are not available in the PP of that DC.
                             - One developer one talked to referenced the compilation PP of the External Library DC (i.e. "ebuslib").
                                     - this seemed to work but then I wondered how the project finds the JAR at runtime?
    QUESTION: Does SAP load all the classes that have been deployed via the J2EE Server Component Library DC method and hence those JARs are globally available at runtime hence no need to reference them during development except for compilation? What if > 1 J2EE library contain the same jar or same API but different versions (e.g. Hibernate 2 vs 3).
    Thanks for any clarifications. I want to understand the underlying technology and how it works. I have seen alot of information out there but some of it is confusing and conflicting.
    Dean Cyril Wood

  • BC4J with Struts using EditAction's create method.

    Hi,
    I am using BC4J with struts and using the EditAction and UpdateAction classes provided by BC4J.
    When i want to create a new row in the database the documentation asks me to call EditAction's create() method and then UpdateAction's execute() method to do it. But even when i just call UpdateAction's execute() method I am able to create a new row. So WHY should I call EditAction's create() method ?????

    EditAction's create() method is something you would call in the action before rendering the empty form for the user to fill in.
    It creates a row, and then marks the row as having STATUS_INITIALIZED using the Row.setNewRowState(Row.STATUS_INITIALIZED) call.
    By setting the row to STATUS_INITIALIZED, this makes BC4J "forget" that it's a new row that needs to be inserted. In effect, it makes that new row a throwaway row used only for the purpose of rendering the blank form. An important reason you would want to do things this way is to pickup entity-level default values in the attributes of the new row.
    For example, in the toy store demo, why is it that when you register as a new user the "Country" poplist defaults to "United States" ? (it's not the first entry in the list).
    The answer is that, since the EditAction (or in this case my custom subclass of that) creates the blank row, the fact that the "toystore.model.businessobjects.Account" entity object declares that its Country attribute has a default value of "US" makes the blank row created in the "toystore.model.dataaccess.Accounts" view object have a default value of "US", and that default value in the blank row causes the <jbo:InputSelect> tag that renders the poplist to mark the corresponding "United States" option in the list as currently selected (as it's the display string associated in the poplist with the value "US").

  • InputText issue with Struts

    I'm using jsf 1.1 with struts 1.3.5 and am experiencing an issue with the inputText element. The problem is the name attribute being generated is not allowing the form bean's attributes to be set. For example:
    <h:inputText id="username" value="#{loginForm.username}"/>
    generates
    <input id="_idJsp3:username" name="_idJsp3:username" type="text" value=""/>
    The issue being the name of the field is _idJsp3:username so the form property 'username' is not getting set. I've tried removing the inputText tag and replacing it with this:
    <input name="username" type="text"/>
    And it works. What's the deal? I know a lot of people have used/are using JSF and struts together, what am I doing wrong?
    By the way, this is the last hurdle i need to clear so any help would be appreciated.

    first - thanks for your reply
    I can understand what you mean , to adhere to the MVC conception , we need to have any action go through the controler .
    but , once I wanna access to a jsp file , then I need to set a global-forward and a ForwardAction , when time goes by, and the project keeps getting larger , so there will be too many forwards and FrowardActions , right ?
    actually , I have a Office.jsp , which has a frameset inside , left and right,each invokes a jsp file like this :
    <frameset rows="*" cols="144,*" framespacing="2" frameborder="NO" border="2" bordercolor="#CC0000">
    <frame src="OfficeLeft.jsp" name="leftFrame" scrolling="NO" noresize>
    <frame src="Notification.jsp" name="RightFrame">
    </frameset>
    when I have successfully forwarded to this Office.jsp , it prompts OfficeLeft.jsp and Notification.jsp are not available. so my problem is I don't know how to get this work fine .

Maybe you are looking for