Set html components JSF

Hi there,
I m using JSF but in some places there are simple html components like <select> menu.
I want to set HTML components when loading page dynamically on the basis of student record.
Can someone give me a hint how I can set html components using jsf while page is loading?
Any work-arounds would also be highly appreciated.
Regards,
Arsalan

well this has given me some hint, thanks.
However my main problem is that I have a code in html page page1 like
<input id="rdCamp_0" type="radio" name="rdCampus" value="A" />
<input id="rdCamp_1" type="radio" name="rdCampus" value="C" />
<input id="rdCamp_2" type="radio" name="rdCampus" value="B" />Now at run time, from backing bean I want to set one of these radio html components like when I am calling page1. I want to set the value of html radio button according to my database record.
Regards,
Arsalan

Similar Messages

  • JSF Components in HTML Components

    Hi,
    I'm trying to use JSF components as children of HTML components but the UI isn't being rendered properly.
    Basically, here's my scenario:
    <ul>
         <li>
              <h:commandLink id="newQuoteLink" styleClass="topNav" action="#{pc_HeaderFragment.newQuote}">
                   <h:outputText value="Add New Quote"/>                              
              </h:commandLink>               
         </li>
    </ul>All I want rendered is a text link ("Add New Quote") that will execute a backing bean method
    When I run the server, the <a> tag is generated before my original <ul> list.
    How come it can't simply return to the outputtext to the location that I called it?
    Am I missing something here?
    Thanks in advance!
    Matt

    Looks like you're using JSF 1.1. At this version of the spec, there were issues with content interweaving that necessitated the need
    of f:verbatim tags to wrap template text (i.e. non jsf-markup).
    This isn't necessary for 1.2, but if you must stick with 1.1, your markup should look something like:
    <f:verbatim>
    <ul>
        <li>
    </f:verbatim>
    <h:commandLink id="newQuoteLink" styleClass="topNav" action="#{pc_HeaderFragment.newQuote}">
        <h:outputText value="Add New Quote"/>                              
    </h:commandLink>            
    <f:verbatim>
         </li>
    </ul>
    </f:verbatim>Given the ugliness if this, if you have to use JSP for your views, migrate to JSF 1.2.
    If you must stay with 1.1, look into Facelets [1], Clay [2], or JSFTemplating [3]
    as a substitute for JSP as you won't have these issues.
    [1] https://facelets.dev.java.net
    [2] http://shale.apache.org
    [3] https://jsftemplating.dev.java.net

  • Html components to JSF

    hi
    i have a html page ie written purely using html tags. and im now trying to use the JSF components instead of html tags.
    is there any way to do this.
    i have to open the html file in JDev 11.and change the html tags to JSF.
    How to do this????

    im sorry to confuse u.
    im writing it again.
    i have a html page ie check_html.html
    i copied tht file along with the css and the images used in the file into the public_html directory of an exsisting project.
    and it runs fine.
    now i wanted to use jsf components in this html file.but in the component palatte there is only html componenets.so i could not replace the html components with JSF.
    so i saved this file as check_html.jsp file in the same location.
    now when i opened this file all tag lib are displayed in the component palatte.
    so i used the jsf components also in the new check_html.jsp file.and i could see it fine in the
    design view.
    By WEB-INF directory contains all xmls.
    but once i run this check_html.jsp page i am getting the error
    500 Internal Server Error
    javax.servlet.jsp.JspException: Cannot find FacesContext     at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:427)     at com.sun.faces.taglib.html_basic.FormTag.doStartTag(FormTag.java:345)     at check_html._jspService(_check__html.java:50)     [check_html.jsp]     at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.1.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:453)     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:591)     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:515)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:711)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)     at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)     at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)     at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)     at java.lang.Thread.run(Thread.java:595)

  • Threadinar10 - Page Separator, Page Fragment Box , Tab Set & Tab Components

    Hi All,
    This is the tenth in the Threadinar series. See the Components Threadinar Index at http://forum.sun.com/jive/thread.jspa?threadID=103424 for the complete list to date.
    This Threadinar will discuss 4 components in the "Components Palette: Layout Section" section of the Creator Component Catalog.
    The components we will focus on today are
    "Page Separator", "Page Fragment Box" , "Tab Set" & "Tab" Components.
    Let us begin our discussion with the "Page Separator" Component.
    Page Separator Component
    You can drag the Page Separator component from the Palette's Layout category to the Visual Designer to create a horizontal line that resizes to any page width selected by the user. This component is the visual equivalent of an HTML <hr> tag.
    In the page bean, a Page Separator component is a PageSeparator object.
    * Note: If you want to use an HTML <hr> tag, drop a Meta component on the page and set its tag property to hr.
    [b]Page Fragment Box Component
    This component enables you to include a page fragment in a page. A page fragment is a separate, reusable part of a page that can be included in any number of pages. For example, you might want to put a common a visual element like a header graphic in a page fragment and then include it in all the pages in an application.
    When you drag the Page Fragment Box component from the Layout category of the Palette and drop it on a page, the Select Page Fragment dialog box prompts you for the name of the page fragment to be included. You can enter the name of an existing page fragment or create a new page fragment. If you create a new page fragment, the IDE gives the new fragment a .jspf file suffix and creates a node for it in the Projects window, as well as adding the page fragment to the Outline window.
    * Note: A Page Fragment Box component simply includes a page fragment in a page. Deleting a Page Fragment Box component from a page does not delete the page fragment itself, even if you originally used the Select Page Fragment dialog box to create the page fragment.
    After dropping a Page Fragment Box component on the page, if you click inside the component, you see the properties for the included fragment. If you click the border of the component, you see the properties for the enclosing <div> block. You can also use the Outline window to select the enclosing block, the page fragment, or the components in the page fragment. In the Outline window, the Page Fragment Box component is represented by a node named directive.include:fragment-file.jspf, where fragment-file is the name of the page fragment file.
    If you double-click the page fragment, it opens as a page in the Visual Editor, enabling you to edit it like a regular page. The page fragment has an associated JavaBeans object, a page fragment bean, which you can edit by clicking the Java button at the top of the page fragment when it is open in the Visual Editor. As with a regular page, if you drop a component like a button in a fragment, double clicking adds an event handler in the page fragment bean, enabling you to reuse the code on any page to which you add the page fragment. A common scenario for reusing component code would be a Search Box fragment that has a search Label, a Text Field where the user enters the search string, some Inline Help, and search logic code in the page fragment bean.
    * The tab order of the components in the page is unlikely to work properly unless you enclose the entire page fragment box in the Faces Verbatim component.
    For more details see tutorial : "Using Page Fragments"
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/pagefragments.html
    [b]Tab Set Component
    The Tab Set component in the Palette's Layout category is a container for a set of Tab components. Typical uses of a tab set are:
    * To provide alternate sets of components on the same page and enable the user to navigate to them by clicking on tabs. The user sees only the components under the currently selected tab. For more information on adding components to tabs, see Tab Component.
    * To navigate among a set of pages. If you use a tab set this way, you would usually have the tab set near the top of each page with the component's width set at 100%. You would use the Page Navigation editor to define each tab to display a page in the application, with the current page's tab set as the selected tab. In addition, you would need to delete the default Layout Panel component under each tab so the tab would display the page contents.
    You can set Tab Set properties in the component's Properties window.
    A Tab Set component contains Tab Components, and Tab components can contain other Tab components. You can see these components displayed as hierarchical nodes in the Outline window after you add a Tab Set to your page.
    You can add a new tab to a tab set in two ways, by right-clicking the Tab Set component and choosing Add Tab or by dropping a new tab component on the Tab Set or on a Tab component.
    You can drop a new tab component on a tab set in the Visual Designer to the right or left of existing tabs to create a new tab at that level. The tabs in a tab set can also be containers for other tabs. If you drop a Tab component on an existing tab, the new tab becomes a child of the tab on which you dropped it. The maximum number of levels for tabs is three.
    The tab set component determines which tab is rendered as selected, storing the value in the selected property. By default, the selected property is set to the first tab created for the component. If you click a tab while designing your web page, that tab becomes the selected tab. You can tell during design time that a tab is selected because its color changes.
    [b]Tab Component
    A Tab is part of a Tab Set component. You can add a new tab to a tab set in two ways, by right-clicking the Tab Set component and choosing Add Tab or by dragging a new Tab component from the Layout category of the Palette and dropping it on the Tab Set or on another Tab component. You can also drag from the Palette and drop the tab on the tab set's nodes in the Outline window.
    * If you drop the Tab component to the left or right of an existing tab, it is added to the same row of tabs.
    * If you drop the Tab component on an existing tab, the dropped tab becomes a child tab of the tab on which you drop it unless the existing tab is a third level tab. You can have at most three levels of tabs in a tab set.
    o Note: You cannot add a child tab to a tab that has components in its Layout Panel. When you drop a tab on an existing tab component that has an empty Layout Panel, the empty Layout Panel is deleted to make room for the dropped tab.
    By default, a Tab component has a Layout Panel below it where you can drop components that will be displayed when the user selects the tab. The Layout Panel by default has its panelLayout property set to Grid Layout, meaning that components dropped on the panel are aligned at the location where they are dropped. You can change the layout behavior by setting the panelLayout property to Flow Layout, which aligns dropped components left to right in rows. For more information on Layout Panel properties, see Layout Panel Component Properties Window.
    To select a tab in a tab set, either click the Tab component on the page or select the Tab component's node in the Outline window. To select the whole tab set, either click the border of the Tab Set component on the page or select the tab set's node in the Outline window. Alternatively, you can select a Tab component and either press Escape or right-click and choose Select Parent to select its parent component.
    * Note: If you select a tab on a page in the Visual Designer, a side effect is that it becomes the selected tab. If this effect is not what you want, select the tab in the Outline window so you can set its properties.
    You can drag tabs in the Outline window to change their location and level in the tab set.
    Some typical uses of tabs:
    * You can drop components on the Layout Panel component below a tab to enable a set of components to be displayed below each tab. When the user selects a tab, they see only the components that are associated with the tab, without having to change pages.
    * You can use a tab set to navigate among a set of pages. Each tab component links to a page in your web application. You would use the Page Navigation editor to define each tab to display a page in the application, with the current page's tab set as the selected tab. If you want to use the tab set for page navigation, be sure to delete each tab component's Layout Panel.
    You can also right-click the Tab component and choose one of the following options:
    * Edit action Event Handler. Code the action event handler, the method that is called when the user clicks the tab. This method determines which page or resource to open based on specified conditions. The action method typically processes mouse clicks and returns a string indicating the name of a page navigation case (the page in your application to display next). The default name for the method is tab-id_action, where tab-id is the value of the tab's id property.
    * Bind to Data. Dynamically set the text that appears on the tab. You can bind the component's text property to an object or a data provider, as described in the topic Bind to Data Dialog Box.
    * Property Bindings. Opens a dialog box that enables you to bind properties of the component in addition to the text property to other objects or bean properties that update this component's properties automatically.
    [b] Please join in and share your comments, experiences, additional information, questions, feedback, etc. on these components. <br><br>
    Thank you for your participation

    The following blog has a mini tutorial on using a tab set in a page fragment for page navigation:
    http://blogs.sun.com/divas/entry/tabbing_thru_the_tulips
    A reader commented that the mini tutorial needed to be improved upon to show how to keep the tab state and navigation state in synch.
    How would you do it? If you have a good example, maybe post it to this thread.
    Also, there is no tab tutorial but it is on the priority list. What would you like a tab tutorial to show how to do?

  • Style Message in design view with Apache Trinidad HTML components

    Hi !!!
    I'm using Apache Trinidad HTML components. In that components after using Table Layout I'm trying to use Row layout after dragging the row layout to the design view the following message is appearing in the design view, the same is happening in the browser window also.
    style="position:absolute;width:auto;height:auto;top:0px;left:0px;bottom:0px;right:0px"
    Thanks in Advance
    Anil Kumar Golla

    Ric,
    First I created an application by selecting New Application from the Application Navigator. In that application window I submitted relevant names for creating the new application, after that it displayed the project window in that I given the project name then in Jdeveloper's Application window the project name is displayed from there I selected new by right clicking, in that New gallery window, I selected Web Tier > Page Template > Ok. In the Create Jsf Page template window I created a File Name and Facet Definitions namely North, West, East, South and Center. After that Jdeveloper created the new JSPX page. In that page first I dragged panel stretch layout from Adf Faces to the Jdeveloper's design view and given facet references (North, West, East, South and Center). In the North Portion I dragged the Apache Trinidad HTML's Table Layout component, after that Row layout, then in the design window I'm getting the "style="position:absolute;width:auto;height:auto;top:0px;left:0px;bottom:0px;right:0px". The same is displaying in the browser window also.
    Thanks in Advance
    Anil Golla

  • Mixing HTML and JSF or better pure JSF Tags?

    I'm relatively new to JSF, but i can say, i work with all the Web Standards in HTML and CSS.
    So the HTML Render Results of JSF may not fit into a Web Developers Dreams of perfect HTML/CSS.
    An Option i see is to use HTML and put only the dynamic parts in there as JSF Components.
    What are the Pro's and Con's using HTML?
    some stuff i can image:
    Using pure JSF:
    - May many components have impact to the performance?
    - Mixed with HTML: What if the application should be rendered to another client pc (e.g. Mobile)?
    What are your experiences?

    The one downfall of mixing html with jsf, unless you use the f:verbatim tag, that the page is not properly represented in the component tree. Also depending on certain technologies you use (when I used ajax4jsf it worked this way) that the jsf component tree was rendered and then all the html was rendered at the end. This caused html tags and text that I had inside a jsf tag to be improperly displayed.
    This though was the case when I was originally using jsf 1.1, so it may have been improved in later editions, but since I have become accustomed to writing the entire page in jsf tags I have not really tested that limit in the current version.

  • Resizing html components based on monitor resolution

    I have an AIR app that runs in full screen mode continuously as a kiosk.  However when it is installed on computers with low resolution monitors, some of the components get chopped off and even worse, the borders sometimes only display on three sides due to these clipping issues.  How can I avoid this.  The components in question are html components and the app essentially flips through a series of web pages, reloading them after each iteration. 
    Here's a sample of a component:
    <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" clipContent="true" backgroundAlpha="0"
    horizontalScrollPolicy="off" verticalScrollPolicy="off" hideEffect="Fade" showEffect="Fade"
    horizontalAlign="center" verticalAlign="middle" id="pan1" >
    <mx:HTML styleName="effectBox"  verticalScrollPolicy="off" id="html1" location="http://mydomain.com/index.html"/>
    </mx:VBox>
    // style:
    .effectBox {
    borderColor: #000000;
    borderThickness: 10;
    borderStyle: solid;
    cornerRadius: 5;

    domWindow is a reference to the HTML page's window object. You use it to access the JavaScript execution context from your ActionScript code.
    Out of curiosity, I put together a demo:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
         <mx:Script>
              <![CDATA[
                   import mx.events.FlexEvent;
                   private var elem;
                   protected function button1_clickHandler(event:MouseEvent):void
                        elem.style.zoom = parseInt(elem.style.zoom)10'%';
                        trace("Zoom: " + elem.style.zoom);
                   protected function button2_clickHandler(event:MouseEvent):void
                        elem.style.zoom = parseInt(elem.style.zoom)-10+'%';
                        trace("Zoom: " + elem.style.zoom);
                   protected function html_completeHandler(event:Event):void
                        elem = html.domWindow.document.body;
                        elem.style.setProperty( "zoom", "100%", "0" );
              ]]>
         </mx:Script>
         <mx:Button click="button1_clickHandler(event)" label="Zoom In"/>
         <mx:Button click="button2_clickHandler(event)" label="Zoom Out"/>
         <mx:HTML id="html" location="http://www.adobe.com" complete="html_completeHandler(event)"/>
    </mx:WindowedApplication>
    I don't know if this will work for your issue or not. There is certainly some funkiness in how the page layout reacts to zooming. Images on the page are still scaled, of course, though text looks better with this technique.

  • Help Getting CS6 DreamWeaver to Allow Me to Set HTML Settings in Property Inspector

    Hi,
    Another quesiton regarding table layout.  As I often am designing email newsletters, I still need easy ways to set old fashioned HTML elements without messing with CSS (alignment, etc) - it just works better for me for email blasts to code in HTML, plus Outlook still doesn't follow CSS very well in HTML emails.
    After moving to CS6 on a Mac, I can't get the property inspector to allow me to edit HTML Cell properties in the property inspector.  Everything is grayed out.  I'm sure this is some setting somewhere but I can't find it.  In Preferences I do have "HTML instead of CSS" set.  Note that in CS6 on my PC I AM able to edit these fields and change alignment and other cell propertie.s  But, see below, on the Mac, everything is grayed out and I can't edit anything.
    It's got to be a setting somewhere.  How do you over ride CS6 insistance on CSS and HTML blocking and go back to ability to set HTML properties in the property inspector?  There has to be something set different on my PC install than my Mac install but I can't figure out what, as I personally don't remember changing anything and both are brand new installs of CS6, and both are editing the same file.
    HELP!  Thanks!

    Hi Nancy,
    Thanks so much for the response, and I understand CS6 is more standards compliant, but they did NOT remove the ability to make these changes.  You’re missing that I AM able to change and edit in the property inspector to my hearts content in CS6 on my WINDOWS install.  See this screen shot – I can click in the property inspector for a cell and change alignment, etc, and CS6 happily makes the code (like it should) for me.  But on the MAC, it’s grayed out per my original post.  There is a setting I’m missing that I can’t find, or does CS6 Mac not work like CS6 Windows?  Something doesn’t add up.

  • How to set html bullet effect for text in text area

    Hi All,
    How can i set html bullet effect for my text in text area.
    i need like      hello world
    Can any help me.
    thanks
    Raghu

    Use the htmltext property of TextArea. For example...
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
        <mx:Script>
            <![CDATA[
                [Bindable] private var theHTML:String = "<ul><li>First</li><li>Second</li><li>Third</li></ul>";
            ]]>
        </mx:Script>
        <mx:TextArea htmlText="{theHTML}" width="400" height="400"/>
    </mx:Application>

  • Parsing HTML in JSF webuijsf:textArea

    html>
         <body>
              some information and links and more HTML command
         </body>
    </html>
    This is the contents I read from DB. Then it is desplayed in webuijsf:textArea.
    I want it to be executed HTML but it shows text.
    What command should be used, if you please help do this.
    Hope my question is clear
    Thanks

    First of all, if you output this HTML unescaped, then it would be invalid HTML after all. You cannot and should not nest multiple <html> tags in each other.
    Regarding to your actual problem: I know nothing about the Woodstock components, but in the Sun JSF h:outputText you have the 'escape' attribute. If you set it to 'false' then it will output unescaped HTML. Check the TLD docs if you don't see something similar for your component. Otherwise you might have more luck asking this Woodstock specific question at their mailinglist. As long as I walk around here I have never seen another Woodstock expert walking around here.

  • How the refer the HTML components name or property.

    Hi guys,
    My doubt is on STRUTS, if this is not correct forum to ask the questions in struts pls redirect me to the correct forum.
    i am very new to struts.......
    my question is ,
    we are using lot of components like text, button and radio in the jsp file, like
    <html:text property="">
    The value of such components will be read out from the Bean, but where they are specifying the name or property name of the component.
    see the below example,
    index.jsp
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <html:html locale="true">
        <head>
            <title>Struts File Upload and Save Example</title>
            <html:base/>
        </head>
        <body bgcolor="white">
            <html:form action="FileUploadAndSave" method="post" enctype="multipart/form-data">
                <table>
                    <tr>
                        <td align="center" colspan="2">
                        <font size="4">File Upload on Server</font>
                    </tr>
                    <tr>
                        <td align="left" colspan="2">
                        <font color="red"><html:errors/></font>
                    </tr>
                    <tr>
                        <td align="right">
                            File Name
                        </td>
                        <td align="left">
                            <html:file property="theFile"/>
                        </td>
                    </tr>
                    <tr>
                        <td align="center" colspan="2">
                            <html:submit>Upload File</html:submit>
                        </td>
                    </tr>
                </table>
            </html:form>
        </body>
    </html:html>
    * StrutsUploadAndSaveForm.java    (Bean)
    * Created on September 8, 2007, 4:05 PM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package com.myapp.struts;
    * @author subbu.chandrasekaran
    import org.apache.struts.action.*;
    import org.apache.struts.upload.FormFile;
    * Form bean for Struts File Upload.
    public class StrutsUploadAndSaveForm extends ActionForm
      private FormFile theFile;
       * @return Returns the theFile.
      public FormFile getTheFile() {
        return theFile;
       * @param theFile The FormFile to set.
      public void setTheFile(FormFile theFile) {
          System.out.println("the set method called");
        this.theFile = theFile;
    package com.myapp.struts;
    import com.myapp.struts.StrutsUploadAndSaveForm;
    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 org.apache.struts.upload.FormFile;
    import java.io.*;
    * Struts File Upload Action Form.   (Controller)
    public class StrutsUploadAndSaveAction extends Action
      public ActionForward execute(
        ActionMapping mapping,
        ActionForm form,
        HttpServletRequest request,
        HttpServletResponse response) throws Exception{
        StrutsUploadAndSaveForm myForm = (StrutsUploadAndSaveForm)form;
        System.out.println("the instance has been created for myForm");
        System.out.println("Going to get file");
            // Process the FormFile
            FormFile myFile = myForm.getTheFile();
            System.out.println("Got selected file");
            String contentType = myFile.getContentType();
        //Get the file name
            String fileName    = myFile.getFileName();
            //int fileSize       = myFile.getFileSize();
            byte[] fileData    = myFile.getFileData();
        //Get the servers upload directory real path name
        String filePath = getServlet().getServletContext().getRealPath("/") +"upload";
        /* Save file on the server */
        if(!fileName.equals("")){ 
            System.out.println("Server path:" +filePath);
            //Create file
            File fileToCreate = new File(filePath, fileName);
            //If file does not exists create file                     
            if(!fileToCreate.exists()){
              FileOutputStream fileOutStream = new FileOutputStream(fileToCreate);
              fileOutStream.write(myFile.getFileData());
              fileOutStream.flush();
              fileOutStream.close();
        //Set file name to the request object
        request.setAttribute("fileName",fileName);
            return mapping.findForward("success");
    <%@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>
    <title>Success</title>
    </head>
    <body>
    <%
    String fileName=(String)request.getAttribute("fileName");
    %>
    <p align="center"><font size="5" color="#000080">File Successfully Received</font></p>
    <p align="center"><a href="upload/<%=fileName%>">Click here to download</a></p>
    </body>
    </html>
    Struts-config.xml
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE struts-config PUBLIC
              "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
              "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">
    <struts-config>
        <form-beans>
         <form-bean
        name="FileUploadAndSave"
        type="com.myapp.struts.StrutsUploadAndSaveForm"/>    
        </form-beans>
        <global-exceptions>
        </global-exceptions>
        <global-forwards>
            <forward name="welcome"  path="/Welcome.do"/>
        </global-forwards>
        <action-mappings>
            <action path="/Welcome" forward="/welcomeStruts.jsp"/>
            <action
            path="/FileUploadAndSave"
            type="com.myapp.struts.StrutsUploadAndSaveAction"
            name="FileUploadAndSave"
            scope="request"
            validate="true"
            input="/index.jsp">
            <forward name="success" path="/downloaduploadedfile.jsp"/>
            </action>       
        </action-mappings>
        <controller processorClass="org.apache.struts.tiles.TilesRequestProcessor"/>
        <message-resources parameter="com/myapp/struts/ApplicationResource"/>   
        <!-- ========================= Tiles plugin ===============================-->
        <!--
        This plugin initialize Tiles definition factory. This later can takes some
        parameters explained here after. The plugin first read parameters from
        web.xml, thenoverload them with parameters defined here. All parameters
        are optional.
        The plugin should be declared in each struts-config file.
        - definitions-config: (optional)
        Specify configuration file names. There can be several comma
        separated file names (default: ?? )
        - moduleAware: (optional - struts1.1)
        Specify if the Tiles definition factory is module aware. If true
        (default), there will be one factory for each Struts module.
        If false, there will be one common factory for all module. In this
        later case, it is still needed to declare one plugin per module.
        The factory will be initialized with parameters found in the first
        initialized plugin (generally the one associated with the default
        module).
        true : One factory per module. (default)
        false : one single shared factory for all modules
        - definitions-parser-validate: (optional)
        Specify if xml parser should validate the Tiles configuration file.
        true : validate. DTD should be specified in file header (default)
        false : no validation
        Paths found in Tiles definitions are relative to the main context.
        -->
        <plug-in className="org.apache.struts.tiles.TilesPlugin" >
            <set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" />     
            <set-property property="moduleAware" value="true" />
        </plug-in>
        <!-- ========================= Validator plugin ================================= -->
        <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
            <set-property
            property="pathnames"
            value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
        </plug-in>
    </struts-config>can any one pls give me explanation, how the data is being flow thru out these files.
    --Subbu                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    hi,
    Study MVC once again deeply,
    it will explain all what you expect..
    links for Flow
    http://www.ibm.com/developerworks/cn/websphere/techjournal/0302_fung/fung.html
    http://java.sun.com/blueprints/patterns/MVC.html
    Concepts
    http://en.wikipedia.org/wiki/Apache_Struts

  • Mixing Html and JSF

    Hi,
    I have a very simple question concerning a good jsf programming style:
    Often I get Html pages from designers in order to put the necessary
    jsf-code in it in order to get the application work.
    So do I have to replace all html-code with jsf-tags or is it ok when
    I only put jsf-tags where it is necessary (eg. where I have to output
    some data from a bean etc. ).?
    Thanks for your comments,
    Andy

    In general, if there are ways to accomplish the markup you want with JSF component tags (either standard ones, ones you write yourself, or ones written by third party component library providers), I believe that pages composed purely with JSF components will be more maintainable in the long run. In addition, you have the potential ability to use a different renderkit to output a different sort of markup, wihtout doing anything more to your pages than changing the URI of the tag libraries in use (and even that can turn out to be a one-place change if you're using something like a JSP 2.0 prelude file that is automatically included on every page).
    That being said, there will be times when you absolutely, positively, have to include some raw HTML markup along with JSF component tags. Although this works pretty well in simple cases, there are lots of scenarios where it is problematic. However, there is a standard means to deal with this problem -- just enclose your raw HTML markup in an <f:verbatim> tag, and it becomes a JSF component that plays nicely with other JSF component tags, in every scenario.
    I recommend that anyone planning on intermixing raw markup with their JSF component tags should plan on enclosing it in <f:verbatim> tags, to avoid interoperability problems.
    Craig

  • Mix HTML and JSF

    How do I go about interspersing HTMl with the JSF components? The outputText works Ok for small bits of code but cannot be nested.
    Basically, I need to go to Flow-Based layout using tables and cannot seem to get started so any ideas would help.

    <%-- jsf:codeBehind language="java" location="/JavaSource/pagecode/jsp/banking/BankAccountsAndCreditCards.java" --%><%--
    /jsf:codeBehind --%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%@ taglib uri="/WEB-INF/tld/portlet.tld" prefix="portletAPI" %>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@taglib uri="http://www.ibm.com/jsf/html_extended" prefix="hx"%>
    <%@ page
    language="java"
    contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"
    session="false"
    %>
    <portletAPI:init />
    <f:view>
    <LINK rel="stylesheet" type="text/css"
              href='<%=response.encodeURL("/theme/stylesheetx.css")%>' title="Stylex">
              <LINK rel="stylesheet" type="text/css"
              href='<%=response.encodeURL("/theme/stylesheet.css")%>' title="Style">
              <f:loadBundle basename="gov.ohio.jfs.eric.bundle.labels" var="labels" />
              <h:form id="bankAccountsAndCreditCards"\>
         <div id="contentzone">
         <div id="taskarea">
              <div id="taskareaheader" style="width:100%">
                   <span class="style4" style="width:75%"><h:outputText
    value="#{labels['bankAccountsAndCreditCards.title']}"/></span>
              </div>
    <div id="instructions"><span class="style4"><h:outputText
    value="#{labels['bankAccountsAndCreditCards.instructions.title']}"/></span><span class="style9"><h:outputText
    value="#{labels['bankAccountsAndCreditCards.instructions']}"/></span> </div>
              <h:outputText value="#{labels['bankAccountsAndCreditCards.warning']}"
    rendered="#{pc_BankAccountsAndCreditCards.bankAccountsAndCreditCardsFB.labelPresent}"></h:outputText>
    <div id="datatable" style="padding-top:5px;MARGIN-top:15px" class="style16"><span
    style="padding-left:15px"><h:outputText value="#{labels['bankAccountsAndCreditCards.bankAccounts.title']}"/></span>
                   <div id="title">          
                        <table border="0" cellpadding="0" cellspacing="0">
                             <tr>
                             <td align="left" class="style16" style="width:80%"> </td>
                             <td align="right" style="width:10%" id="buttonpad"><hx:commandExButton
    type="submit"
    value="#{labels['bankAccountsAndCreditCards.bankAccounts.buttonName.addBankAccount']}" styleClass="commandExButton"
    id="addBankAccount"
    action="#{pc_BankAccountsAndCreditCards.addBankAccounts}" >
    </hx:commandExButton></td>
                             <td align="right" style="width:10%" id="buttonpad"><hx:commandExButton
    type="submit"
    value="#{labels['bankAccountsAndCreditCards.bankAccounts.buttonName.delete']}" styleClass="commandExButton"
    id="deleteBankAccount"
    action="#{pc_BankAccountsAndCreditCards.deletBankAccounts}" >
    </hx:commandExButton></td>
                             </tr>
                        </table>
              </div>
              <div id="datatable">          
                   <h:dataTable var="varsecurityInfo" width="100%"
                   rowClasses="rowon,rowoff" headerClass="tableheader"
                   id="bankAccountid"
                   value="#{pc_BankAccountsAndCreditCards.bankAccountsAndCreditCardsFB.bankAccountCreditCardCDB}">
                   <h:column>
                        <f:facet name="header">
                             <h:selectBooleanCheckbox id="selectallaccounts1"></h:selectBooleanCheckbox>
                        </f:facet>
                        <h:selectBooleanCheckbox id="selectaccounts1"
                             value="#{varbankAccountCreditCardCDB.deleteRow}">
                        </h:selectBooleanCheckbox>
                   </h:column>
                   <h:column>
                        <f:facet name="header">
                             <h:outputText
    value="#{labels['bankAccountsAndCreditCards.bankAccounts.accountType']}"></h:outputText>
                        </f:facet>
                        <h:outputText
    value="#{varbankAccountCreditCardCDB.paymentProfileDataBean.thePaymentInfoDataBean.accountType}"></h:outputText>
                   </h:column>
                   <h:column>
                        <f:facet name="header">
                             <h:outputText
    value="#{labels['bankAccountsAndCreditCards.bankAccounts.routingNumber']}"></h:outputText>
                        </f:facet>
                        <h:outputText
    value="#{varbankAccountCreditCardCDB.paymentProfileDataBean.thePaymentInfoDataBean.transitNumber}"></h:outputText>
                   </h:column>
                   <h:column>
                        <f:facet name="header">
                             <h:outputText
    value="#{labels['bankAccountsAndCreditCards.bankAccounts.accountNumber']}"></h:outputText>
                        </f:facet>
                        <h:outputText
    value="#{varbankAccountCreditCardCDB.paymentProfileDataBean.thePaymentInfoDataBean.accountNumber}"></h:outputText>
                   </h:column>
                   <h:column>
                        <f:facet name="header">
                             <h:outputText
    value="#{labels['bankAccountsAndCreditCards.bankAccounts.nameOnAccount']}"></h:outputText>
                        </f:facet>
                        <h:outputText
    value="#{varbankAccountCreditCardCDB.paymentProfileDataBean.thePaymentInfoDataBean.bankName}"></h:outputText>
                   </h:column>
                   <h:column>
                        <f:facet name="header">
                             <h:outputText
    value="#{labels['bankAccountsAndCreditCards.bankAccounts.status']}"></h:outputText>
                        </f:facet>
                        <h:outputText value=""></h:outputText>
                   </h:column>
                   <h:column>
                        <f:facet name="header">
                             <h:outputText
    value="#{labels['bankAccountsAndCreditCards.bankAccounts.createdBy']}"></h:outputText>
                        </f:facet>
                        <h:commandLink id="actionlink" action="">
                             <h:outputText value="getLastUPDTS(use summaryofdebits like)"></h:outputText>
                        </h:commandLink>
                   </h:column>
                   <h:column>
                        <f:facet name="header">
                             <h:outputText
    value="#{labels['bankAccountsAndCreditCards.bankAccounts.action']}"></h:outputText>
                        </f:facet>
                        <h:commandLink>
                             <h:outputText value="#{varbankAccountCreditCardCDB.action}"></h:outputText>
                        </h:commandLink>
                   </h:column>
              </h:dataTable>          
              </div>                         
              </div>
              <div id="datatable" style="padding-top:5px;MARGIN-top:15px" class="style16"><span
    style="padding-left:15px"><h:outputText
    value="#{labels['bankAccountsAndCreditCards.creditCardAccounts.title']}"></h:outputText></span>
                   <div id="title">          
                        <table border="0" cellpadding="0" cellspacing="0">
                             <tr>
                             <td align="left" class="style16" style="width:80%"> </td>
                             <td ><hx:commandExButton type="submit"
    value="#{labels['bankAccountsAndCreditCards.creditCardAccounts.buttonName.addCreditCard']}" styleClass="commandExButton"
    id="addcreditAccount"
    action="#{pc_BankAccountsAndCreditCards.addCreditCardAccounts}" >
    </hx:commandExButton></td>
                             <!-- <td align="right" style="width:10%" id="buttonpad"><input name="button"
    type="button" value="Add Bank Account" class="style16"></td> -->
                             <td><hx:commandExButton type="submit"
    value="#{labels['bankAccountsAndCreditCards.creditCardAccounts.buttonName.delete']}" styleClass="commandExButton"
    id="deletecreditAccount"
    action="#{pc_BankAccountsAndCreditCards.deleteCreditCardAccounts}"
    >
    </hx:commandExButton></td>
                             <!-- <td align="right" style="width:10%" id="buttonpad"><input name="button"
    type="button" value="Delete" class="style16"></td> -->
                             </tr>
                        </table>
              </div>
              <div id="datatable">          
    <h:dataTable var="varbankAccountCreditCardCDB" width="100%"
                   rowClasses="rowon,rowoff" headerClass="tableheader"
                   value="#{pc_BankAccountsAndCreditCards.bankAccountsAndCreditCardsFB.bankAccountCreditCardCDB}">
                   <h:column>
                        <f:facet name="header">
                             <h:selectBooleanCheckbox></h:selectBooleanCheckbox>
                        </f:facet>
                        <h:selectBooleanCheckbox
                             value="#{varbankAccountCreditCardCDB.deleteRow}">
                        </h:selectBooleanCheckbox>
                   </h:column>
                   <h:column>
                        <f:facet name="header">
                             <h:outputText
    value="#{labels['bankAccountsAndCreditCards.creditCardAccounts.cardType']}"></h:outputText>
                        </f:facet>
                        <h:outputText
    value="#{varbankAccountCreditCardCDB.paymentProfileDataBean.thePaymentInfoDataBean.accountType}"></h:outputText>
                   </h:column>
                   <h:column>
                        <f:facet name="header">
                             <h:outputText
    value="#{labels['bankAccountsAndCreditCards.creditCardAccounts.creditCardAccountNumber']}"></h:outputText>
                        </f:facet>
                        <h:outputText
    value="#{varbankAccountCreditCardCDB.paymentProfileDataBean.thePaymentInfoDataBean.transitNumber}"></h:outputText>
                   </h:column>
                   <h:column>
                        <f:facet name="header">
                             <h:outputText
    value="#{labels['bankAccountsAndCreditCards.creditCardAccounts.nameOnCreditCard']}"></h:outputText>
                        </f:facet>
                        <h:outputText
    value="#{varbankAccountCreditCardCDB.paymentProfileDataBean.thePaymentInfoDataBean.accountNumber}"></h:outputText>
                   </h:column>
                   <h:column>
                        <f:facet name="header">
                             <h:outputText
    value="#{labels['bankAccountsAndCreditCards.creditCardAccounts.status']}"></h:outputText>
                        </f:facet>
                        <h:outputText
    value="#{varbankAccountCreditCardCDB.paymentProfileDataBean.thePaymentInfoDataBean.accountNumber}"></h:outputText>
                   </h:column>
                   <h:column>
                        <f:facet name="header">
                             <h:outputText
    value="#{labels['bankAccountsAndCreditCards.bankAccounts.action']}"></h:outputText>
                        </f:facet>
                        <h:commandLink>
                             <h:outputText value="#{varbankAccountCreditCardCDB.action}"></h:outputText>
                        </h:commandLink>
                   </h:column>
              </h:dataTable>               
              </div>                         
              </div>
              <div id="taskareanav" style="width:100%">          
              <table border="0" cellpadding="0" cellspacing="0">
                   <tr>
                   <td align="left" class="style16" style="width:100%"><
                        Previous</td>
                   </tr>
              </table>
              </div>
    </div>          
    </div>
         <h:outputText value="#{pc_BankAccountsAndCreditCards.bankAccountsAndCreditCardsFB.name}"
    rendered="#{pc_BankAccountsAndCreditCards.bankAccountsAndCreditCardsFB.labelPresent}"></h:outputText>
         </h:form>
    </f:view>

  • Embed manually created servlet/dyamically built html into JSF Page.

    Hi there,
    I am wondering if anybody has ever tried embedding manually created pages (ie: using servlets to dyamically build an HTML page), inside of a JSF Page?
    The reason I ask is I have about 3000 of these pages already in production and can't really take advantage of JSF, without massive rewrites.
    Is there a way for the embedded page to communicate with the outer JSF Page?

    That works fine Thanks. Now the issue i am facing is if i have one chart and one table in one form , the form is always displayed first then table even if the table is drawn first in design time. IS there any way to Hide the graph Because this component does not have the rendered property.
    I want to render the graph conditionaly.Also Is it possible to change the graph type dynamically ie on selection of any radio button. I can get the handle of button in my Backing Bean.
    I tried to put the graph in Form PAnelBorder as well as in table and set the rendered property to false but still the graph is showing.
    Please help us....Pleas point us to some sample examples where thsi kind of scnario is done.
    Thanks
    Anshu

  • Put HTML in JSF Panel Control

    Hi to everyone,
    how i can put an html code (like: <p><b>Hello</b></p>) in Panel Control or in another jsf control?
    Thanks,
    Fabio

    There are several ways:
    Just put it inline:<b>Hello</b>Put it in a h:outputText with a style:<h:outputText value="Hello" style="font-weight: bold;" />Put it raw in h:outputText with HTML escape set to false:<h:outputText value="<b>Hello</b>" escape="false" />

Maybe you are looking for

  • Getting Ora 01843  not a Valid month Error

    Hi I was trying to assign the data in MM/DD/YY format from a date value '09/25/2009'.. I cannot Obain the result i always get this ORA-01843: not a valid month May i ask you kindly to help me out here. Below is the code Snippet; DECLARE lv_date DATE;

  • Hi-can any body give me material of  (XI)

    HI ALL,       iam venu gopal ,i working in abap ,can any body give matetail of xi ..plz send to me my mail id [email protected] thanks & regards venu gopal

  • Unable to create Azure Database for trial.

    I have signed up for an Azure trial and have been under the impression that i can spend £125 on services...if this is the case what on earth is the point of a trial if i am unable to deploy my simple web application to Azure?  Can you please let me k

  • 0rt_pa_tran_control initialization of delta queues

    Hi all, we are doing initialization for delta queues of Infopackage 0rt_pa_tran_control (POS DM), but the initialization job finished with the error RSAR 260 "Source system XXXXXXXX is not active for this BI" (XXXXXXXX is the logical system). Any ide

  • Can I upload Final Cut Express on a second iMac?

    Hi, Just curious - I am going to purchase a second iMac & would like to put Final Cut Express/Microsoft 2004, etc. on it. Are there any restrictions in doing so? Thanks, K