How to cast an object in JSF?

I am working on a travel application. A user can have several bookings and a booking can have several components. A component can be either air or hotel. I want to list the user's bookings on the client using JSF datatable.
<h:dataTable var="component" value="#{booking.components}">
Now depending upon the class of component I need to present different information.
My question is how to cast the variable in JSF ?
Thanks

You can use the String value of Object#getClass()#getName() to lookup the classname and evaluate it in the 'rendered' attribute.
Basic example:
package mypackage;
public class Animal {}
package mypackage;
public class Cat extends Animal {}
package mypackage;
public class Dog extends Animal {}
package mypackage;
public class Fish extends Animal {}MyBeanpublic List<Animal> getList() {
    List<Animal> animals = new ArrayList<Animal>();
    animals.add(new Dog());
    animals.add(new Cat());
    animals.add(new Fish());
    return animals;
}JSF<h:dataTable value="#{myBean.list}" var="item">
    <h:column>
        <h:outputText value="It's a Cat" rendered="#{item.class.name == 'mypackage.Cat'}" />
        <h:outputText value="It's a Dog" rendered="#{item.class.name == 'mypackage.Dog'}" />
        <h:outputText value="It's a Fish" rendered="#{item.class.name == 'mypackage.Fish'}" />
    </h:column>
</h:dataTable>As far there is no way to cast objects in JSF.
Edit
If you find it useful, move the classname request to the superclass:
public class Animal {
    public String getType() {
        String className = getClass().getName();
        return className.substring(className.lastIndexOf('.') + 1);
}Which makes life easier without struggling with package names:<h:outputText value="It's a Cat" rendered="#{item.type == 'Cat'}" />
<h:outputText value="It's a Dog" rendered="#{item.type == 'Dog'}" />
<h:outputText value="It's a Fish" rendered="#{item.type == 'Fish'}" />Message was edited by:
BalusC

Similar Messages

  • How to cast an Object into a specific type (Integer/String) at runtime

    Problem:
    How to cast an Object into a specific type (Integer/String) at runtime, where type is not known at compile time.
    Example:
    public class TestCode {
         public static Object func1()
    Integer i = new Integer(10); //or String str = new String("abc");
    Object temp= i; //or Object temp= str;
    return temp;
         public static void func2(Integer param1)
              //Performing some stuff
         public static void main(String args[])
         Object obj = func1();
    //cast obj into Integer at run time
         func2(Integer);
    Description:
    In example, func1() will be called first which will return an object. Returned object refer to an Integer object or an String object. Now at run time, I want to cast this object to the class its referring to (Integer or String).
    For e.g., if returned object is referring to Integer then cast that object into Integer and call func2() by passing Integer object.

    GDS123 wrote:
    Problem:
    How to cast an Object into a specific type (Integer/String) at runtime, where type is not known at compile time.
    There is only one way to have an object of an unknown type at compile time. That is to create the object's class at runtime using a classloader. Typically a URLClassloader.
    Look into
    Class.ForName(String)

  • How to cast an object to a class known only at runtime

    I have a HashMap with key as a class name and value as the instance of that class. When I do a 'get' on it with the class name as the key, what I get back is a generic java.lang.Object. I want to cast this generic object to the class to which it belongs. But I don't know the class at compile time. It would be available only at runtime. And I need to invoke methods on the instance of this specifc class.
    I'm not aware of the ways to do it. Could anybody suggest/guide me how to do it? I would really appreciate.
    Thanks a lot in advance.

    Thanks all for the prompt replies. I am using
    reflection and so a generic object is fine, I guess.
    But a general question (curiosity) specific to your
    comment - extraordinarily generic...
    I understand there's definitely some overhead of
    reflection. So is it advisable to go for interface
    instead of reflection?
    Thanks.Arguments for interfaces rather than reflection...
    Major benefit at run-time:
    Invoking a method using reflection takes more than 20 times as long without using a JIT compiler (using the -Xint option of Java 1.3.0 on WinNT)... Unable to tell with the JIT compiler, since the method used for testing was simple enough to inline - which resulted in an unrealistic 100x speed difference.
    The above tests do not include the overhead of exception handling, nor for locating the method to be executed - ie, in both the simple method invocation and reflective method invocations, the exact method was known at compile time and so there is no "locative" logic in these timings.
    Major benefit at compile-time:
    Compile-time type safety! If you are looking for a method doSomething, and you typo it to doSoemthing, if you are using direct method invocation this will be identified at compile time. If you are using reflection, it will compile successfully and throw a MethodNotFoundException at run time.
    Similarly, direct method invocation offers compile-time checking of arguments, result types and expected exceptions, which all need to be dealt with at runtime if using reflection.
    Personal and professional recommendation:
    If there is any common theme to the objects you're storing in your hashtable, wrap that into an interface that defines a clear way to access expected functionality. This leaves implementations of the interface (The objects you will store in the hashtable) to map the interface methods to the required functionality implementation, in whatever manner they deem appropriate (Hopefully efficiently :-)
    If this is feasible, you will find it will produce a result that performs better and is more maintainable. If the interface is designed well, it should also be just as extensible as if you used reflection.

  • How to view View Objects or JSF locally?

    Hi
    I am very new to ADF and Fusion Applications.
    As the JDeveloper is running too slow, I would like to know if there is any way to view the view objects and JSFF definitions locally to understand and customize the seeded objects.
    Any pointers will be useful and appreciated.
    Thanks
    Nagendra

    Hi Nagendra,
    you can certainly explode and explore the ear file contents with whatever tools you like (eg, emacs or vi or Notepad++). Creating new artifacts, while in theory possible, would be a major challenge and we certainly cannot recommend that. Instead, perhaps we can first take a look at the root cause of your question -- JDeveloper being slow: can you let us know
    - what release you are using (Fusion Apps and JDeveloper)
    - what development platform for JDeveloper (Windows, Linux?)
    - specs of your machine, especially available RAM -- highly recommended to have 8+ GB of RAM
    - which dialogs/wizards or tasks performed in JDev in particular are slow for you?
    Thanks!
    Oliver
    Fusion Apps Developer Relations
    http://blogs.oracle.com/fadevrel

  • How can I get objects of multiple instances of InDesignServer

    Hello,
    We need to have InDesignServer running in more than one configuration. And we need to script them. So to keep easy let's pretend there are 2 instances of InDesignServer running. One startet with 'indesignserver -configuration conf0' and the other started with 'indesignserver -configuration conf1'.
    So we try (Visual Basic):
    dim myIndApp0 as InDesign.Application
    dim myIndApp1 as InDesign.Application
    myIndApps0 = CreateObject("InDesignServer.Application.CS2")
    myIndApps1 = CreateObject("InDesignServer.Application.CS2")
    But both objects referring to the instance with conf0. How can we get an object of the second instance?
    We tried to solve this using System.Diagnostics.Process.GetProcesses(). So we got both processes. But did not find a way to get an object of class InDesignServer.Application by using an object of System.Diagnostics.Process. Any ideas about that way?

    Hi Ian,
    The problem is not to start different instances. In the Windows Task Manager and the console output of InDesign Server I can see, that both instances are running with different configurations. When I use Systems.Diagnostics.Processes.GetProcess() I get both processes too.
    But I don't know how to get objects of both instances using the Interop Assembly or (as a runaround) how to cast an object of System.Diagnostics.Process into an object of InDesignServer.Application.
    When you talking about SOAP, do you know how to start InDesignServer twice with diffrent ports from inside VB and getting the InDesignServer.Application objects of it?
    This should be solve our problem too.

  • How to cast object type to integer type?

    Hi,
    Object [] temp;
    Int [] value;
    How can I assign temp to value? (value = temp?)
    In other words how to cast array of type object to array of type integer?
    Thanks a lot.

    Hi,
    Object [] temp;
    Int [] value;
    How can I assign temp to value? (value = temp?)
    In other words how to cast array of type object to
    array of type integer?
    Thanks a lot.That my friend, is (sometimes) illegal. other times use
    value = (Integer[]) temp;
    Pray that temp is holding an Integer array so that you dont throw a runtime exception.
    I am assuming you know the diff between "int" and "Integer".

  • Calling a method in BPM Object from jsf page

    Hi All,
    How do I call a method in BPM object from JSF page? Is it possible to invoke it in a manner similar to invoking a method from managed bean in JSF application?
    Please help.
    Thanks and Regards,
    Veronica

    You can use f:invoke (or f:invokea to with parameters)
    For ajax calls, you can use f:invokeUrl to get the URL to a particular method within your BPM object, although make sure the Server-Side Method property is set to Yes.
    http://download.oracle.com/docs/cd/E13154_01/bpm/docs65/taglib/index.html

  • How to cast vector to vector with out using loop. and how to override "operator =" of vector for this kind of condition.

    Hi All How to TypeCast in vector<>...  typedef  struct ...  to class... 
    //how to cast the vector to vector cast with out using loop
    // is there any way?
    //================ This is Type Definition for the class of ClsMytype=====================
    typedef struct tagClsMytype
    CString m_Name;
    int m_Index;
    double m_Value;
    } xClsMytype;
    //================ End of Type Definition for the class of ClsMytype=====================
    class ClsMytype : public CObject
    public:
    ClsMytype(); // Constructor
    virtual ~ClsMytype(); // Distructor
    ClsMytype(const ClsMytype &e);//Copy Constructor
    // =========================================
    DECLARE_SERIAL(ClsMytype)
    virtual void Serialize(CArchive& ar); /// Serialize
    ClsMytype& operator=( const ClsMytype &e); //= operator for class
    xClsMytype GetType(); // return the typedef struct of an object
    ClsMytype& operator=( const xClsMytype &e);// = operator to use typedef struct
    ClsMytype* operator->() { return this;};
    operator ClsMytype*() { return this; };
    //public veriable decleare
    public:
    CString m_Name;
    int m_Index;
    double m_Value;
    typedef struct tagClsMyTypeCollection
    vector <xClsMytype> m_t_Col;
    } xClsMyTypeCollection;
    class ClsMyTypeCollection : public CObject
    public:
    ClsMyTypeCollection(); // Constructor
    virtual ~ClsMyTypeCollection(); // Distructor
    ClsMyTypeCollection(const ClsMyTypeCollection &e);//Copy Constructor
    DECLARE_SERIAL(ClsMyTypeCollection)
    virtual void Serialize(CArchive& ar);
    xClsMyTypeCollection GetType();
    ClsMyTypeCollection& operator=( const xClsMyTypeCollection &e);
    ClsMyTypeCollection& operator=( const ClsMyTypeCollection &e); //= operator for class
    void Init(); // init all object
    CString ToString(); // to convert value to string for the display or message proposed
    ClsMyTypeCollection* operator->() { return this;}; // operator pointer to ->
    operator ClsMyTypeCollection*() {return this;};
    public:
    vector <ClsMytype> m_t_Col;
    //private veriable decleare
    private:
    //===================================================
    ClsMytype& ClsMytype::operator=( const xClsMytype &e )
    this->m_Name= e.m_Name;
    this->m_Index= e.m_Index;
    this->m_Value= e.m_Value;
    return (*this);
    //==========================Problem for the vector to vector cast
    ClsMyTypeCollection& ClsMyTypeCollection::operator=( const xClsMyTypeCollection &e )
    this->m_t_Col= (vector<ClsMytype>)e.m_t_Col; // how to cast
    return (*this);
    Thanks in Advance

    Hi Smirt
    You could do:
    ClsMyTypeCollection* operator->() {
    returnthis;};
    // operator pointer to ->
    operatorClsMyTypeCollection*()
    {returnthis;};
    public:
    vector<ClsMytype>
    m_t_Col;//??
    The last line with "vector<xClsMytype>
    m_t_Col;". It compiles but I doubt that is what you want.
    Regards
    Chong

  • How to create an object of a class?

    plz read the question carefully ..
    how to create the object of a class by giving the class name as an String
    suppose i have a java file name:" java1.java ".
    so now how to create an object of this class "java1"by passing a string "java1"..

    kajbj wrote:
    rajeev-usendi wrote:
    thanks but still i have problem..
    i have created the object but now i m unable to do anything with that created object..
    i have coded like this..
    Object o= Class.forName("java1").new Instance();
    after this i m unable to do anything with the object 'o'..So why did you create the instance? You can also get all methods using reflection, but that is probably not what you want to do. You should instead let the class implement an interface and cast the created object into that interface ans call the methods that you want to call.
    KajI agree with Kaj. If you need to use a class that's unavailable at compile time, you should create an appropriate interface by which to refer to the class and then you create instances reflectively and access them normally via their interface (which is called reflective instantiation with interface access)

  • How to cast a BLOB to OrdImage

    Hi,
    How can I cast or convert a BLOB to OrdImage? For example,
    <import...>
    public class ConvertBlobToOrdImage {
    public static void main(String args[]) throws Exception {
    // Load the Oracle JDBC driver:
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    // Connect to the database:
    Connection conn =
    DriverManager.getConnection(<"Your database connection">);
    conn.setAutoCommit(false);
    // Create a Statement:
    Statement stmt = conn.createStatement();
    String query = "SELECT blob FROM image_t where image_id = 1";
    OracleResultSet rset = (OracleResultSet) stmt.executeQuery(query);
    rset.next();
    OrdImage imageProxy = (OrdImage) rset.getCustomDatum(1, OrdImage.getFactory()); // <-- java.lang.ClassCastException: oracle.sql.BLOB
    rset.close();
    int height = imageProxy.getHeight();
    int width = imageProxy.getWidth();
    System.out.println("Image Dimension: " + height + " x " + width);
    System.out.println("Image Mime Type: " + imageProxy.getMimeType());
    TIA,
    Henry

    xwindy wrote:
    Does anyone knows how to cast a HashMap to HashMap<String, Object>?
    the session.getAttribute return only a HashMapthere is no way to do this safely
    you can use this annotation to suppress unchecked warnings
    @SuppressWarnings("unchecked")

  • Casting the Object dynamically

    Hi All,
    I am looking for a way to dynamically cast the object. I am receiving an object which is JAXB object as parameter of a method. This object can be type pf one the 5 jaxb objects my logic is handling. I need to identify the actual type of object and perform some operations on it.
    Each of these 5 JAXB objects have some common method (although these objects does not inherit from any common class) and some methods which are specific to them.
    I can not make changes to JAXB classes as i am importing those as jar.
    I know it will need reflection somehow but i am not sure how to do it exactly. Below code will give you idea what i am trying to achieve. Its giving compile time error as xngEvent is typecasted in if-else block. This is just to show what i want to achieve using reflection.
    public void processMessage(Object inputObject)
    if(inputObject instanceof com.att.granite.jaxb.xngevents.dtd.equipment.XngEvent){
                        com.att.granite.jaxb.xngevents.dtd.equipment.XngEvent xngEvent = (com.att.granite.jaxb.xngevents.dtd.equipment.XngEvent)inputObject;
                   }else if(inputObject instanceof com.att.granite.jaxb.xngevents.dtd.cable.XngEvent){
                        com.att.granite.jaxb.xngevents.dtd.cable.XngEvent xngEvent = (com.att.granite.jaxb.xngevents.dtd.cable.XngEvent)inputObject;
                   }else if(inputObject instanceof com.att.granite.jaxb.xngevents.dtd.ipaddress.XngEvent){
                        com.att.granite.jaxb.xngevents.dtd.ipaddress.XngEvent xngEvent = (com.att.granite.jaxb.xngevents.dtd.ipaddress.XngEvent)inputObject;
                   }else if(inputObject instanceof com.att.granite.jaxb.xngevents.dtd.ipsubrange.XngEvent){
                        com.att.granite.jaxb.xngevents.dtd.ipsubrange.XngEvent xngEvent = (com.att.granite.jaxb.xngevents.dtd.ipsubrange.XngEvent)inputObject;
                   }else if(inputObject instanceof com.att.granite.jaxb.xngevents.dtd.path.XngEvent){
                        com.att.granite.jaxb.xngevents.dtd.path.XngEvent xngEvent = (com.att.granite.jaxb.xngevents.dtd.path.XngEvent)inputObject;
                   }else{
                        com.att.granite.jaxb.xngevents.dtd.site.XngEvent xngEvent = (com.att.granite.jaxb.xngevents.dtd.site.XngEvent)inputObject;
    String database = xngEvent.getDatabase();
    String elementType = xngEvent.getElementType();
    String editOperation = xngEvent.getEditOperation();
    validateEvent(elementType,editOperation,xngEvent);Thanks,
    Aashu

    What you are talking about is called runtime class working. It can do the job you want but for reasons the other responders already mentioned I cannot recommend it for your use case. The primary reasons being the complexity involved, the likelihood that you will need changes that will not be backward compatible, the difficulty in testing and debugging and the difficulty in finding developers that will even understand this approach that can take over after you are gone.
    This type of functionality is very roughly related to the use of dynamic proxies and code injection used by Spring and other frameworks.
    With those caveats in mind this is a link with an excellent example of how to do it and the issues involved.
    http://www.ibm.com/developerworks/java/library/j-dyn0610/
    For your use case I would recommend the approach you have probably already settled on. But first follow gimbal2's advice and document your requirements and use case and the dependencies on possibly duplicated code sections you previously mentioned.

  • Re-casting of object from control reference

    I feel like this question is likely answered elsewhere, but after days of searching I couldn't find an answer. Sorry if I'm missing the answer in some obvious place.
    I'm given a reference to a cluster control and told that the elements of the cluster are all children of parent class A. Using the controls[] property I get an array of the elements, and the value property of each of those elements gives a variant that can be turned into class A. At that point, all of the object oriented overriding and private data stuff works as expected.
    So far so good.
    But one method I call on those objects changes the private data, and I need to update the control with the updated object. There I get a runtime error because the control isn't A but some child class of A.
    I think this is where Preserve Runtime Class comes into play, but since I only get a reference to work with, what do I do? This is especially frustrating because debugging probes show that LabVIEW knows the child class on the wire, but I can't see how to tell LabVIEW to cast down to the class that it knows it has.
    For example, is there some way to use the ClassName property of the control to cast the object of class A into the child that the control is expecting?
    Solved!
    Go to Solution.

    nathand wrote:
    So your trying to write to the specific control within the cluster, by reference, as a variant, and you're getting an error? What's the actual text of the error?
    Really you shouldn't ever be using a front panel object this way, especially one where the user never sees the data in it. For passing data around you should use a wire. Neither a wire nor a DVR will get you the ability to pass an arbitrary cluster, though, which it sounds like is what you're trying to do. With a bit more information we might be able to suggest a better approach.
    I don't have the text of the error handy, but it comes from the write value property node and basically says the given variant can't be converted to the type of the control. It happens only when the value is cast to the parent class, which makes sense.
    In other words, given a control of child type,
    control.value ---> variant ---> to parent ---> variant ---> control.value     failes with the error
    control.value ---> variant ---> to child ---> variant ---> control.value       succeeds
    So a solution would be a way to cast to the child instead of to the parent. LabVIEW knows what class the control contains; it is listed in a number of places from the ClassName property through the probe window. The problem is I know of no way to bridge the gap from "LabVIEW knows what class this thing is" to "have LabVIEW cast the variant to that class."
    I completely agree that I shouldn't have to ever be using a front panel control this way, but I don't want to get sidetracked into talking about the shortcomings of LabVIEW that have required such a use. Suffice it to say, that is the assignment.

  • Casting webservice Objects

    I've got a question about Webservices in Flex. When using the 'Import Web Service'-command, Flex automatically creates the appropiates Classes and Connection scripts. When using these scripts, Flex automatically casts Objects received by a Webservice to a Strong-typed Class, and not a ObjectProxy. This is very handy. The only downside of this features is that you'd have to recreate all the files when you change a property in your webservice. Because I had to make manual changes in the generated files, everytime I make a change in my Webservice, I have to update all these files again. Therefor I would like to make my own connectionscripts, so when my webservice changes, I only have to make this change in my Flex-classes. Problem is I couldn't find any scripts that correctly connects to a Webservice, AND casts my objects to a Strong-typed class. Everytime I try to cast a received ObjectProxy to a certain Class, I get null returned. I've tried several things, including the SoapDecoder, and the SchemaRegister, but I somehow can't get it to work.
    Does anybody has an example of a script that does this job or know how to get this done?
    Thanx,
    Paul

    Hi Mike,
    Thank you for your response. Yes, I was trying to cast the elements returned from
    examineHeaderElements to SOAPHeaderElement. This was throwing a ClassCastException.
    Now, I am using
    soapHeader.getChildElements(nodeName)
    This seems to work fine. Where I created the nodeName through SOAPEnvelope's createNode()
    method. Don't know what the original problem was. But, now I avoided using that
    API. Will let you know if I get any more information.
    Regards,
    Adam
    "Michael Wooten" <[email protected]> wrote:
    >
    Hi Adam,
    The java.util.Iterator returned from the examineHeaderElements() method,
    should
    contain javax.xml.soap.SOAPHeaderElement objects. Is that what you are
    trying
    to cast to?
    Regards,
    Mike Wooten
    "Adam Athimuthu" <[email protected]> wrote:
    Hello,
    I am getting a ClassCastException when trying to process the SOAPHeader
    in a SOAP
    handler. I tried the following...inside the handleRequest(MessageContext
    context)
    method:
    SOAPPart soapPart=null;
    SOAPEnvelope soapEnvelope=null;
    SOAPHeader soapHeader=null;
    SOAPMessageContext soapContext=(SOAPMessageContext) context;
    System.out.println("handleRequest");
    SOAPMessage soapMessage=soapContext.getMessage();
    System.out.println("SOAPMessage: "+soapMessage.toString());
    try
    soapPart=soapMessage.getSOAPPart();
    soapEnvelope=soapPart.getEnvelope();
    soapHeader=soapEnvelope.getHeader();
    System.out.println("SOAPHeader: "+soapHeader.toString());
    soapHeader.addTextNode("CustomNode");
    Iterator allHeaders=soapHeader.examineHeaderElements("http://someuri.com");
    The examineHeaderElements throws a ClassCastException, no matter what
    method gets
    invoked on the soapHeader object. I tried casting this to the weblogic.webservice.core....
    implemented objects. The result is the same.
    I appreciate any help.
    Thanks,
    Adam
    Athi D. Athimuthu

  • How to get POF object's field value from query result

    hi,all:
    I want to get field value from the query result, my code is below
    Set setResults = cache.entrySet(createFilter("homeAddress.state = 'MA'"));
    for (Iterator iter = setResults.iterator(); iter.hasNext(); )
    Contact c=(Contact)iter.next();
    System.out.println ("firstame####=" + c.getFirstName());
    * but I get error*
    Exception in thread "main" java.lang.ClassCastException: com.tangosol.util.ConverterCollec
    tions$ConverterEntrySet$ConverterEntry cannot be cast to com.oracle.handson.Contact
    at com.oracle.handson.QueryExample.printResults(QueryExample.java:159)
    at com.oracle.handson.QueryExample.query(QueryExample.java:86)
    at com.oracle.handson.QueryExample.main(QueryExample.java:43)
    who can tell me how to get POF object's field value from query result

    Hi,
    If you look at the Java Doc for the entrySet method here http://download.oracle.com/docs/cd/E15357_01/coh.360/e15725/com/tangosol/util/QueryMap.html#entrySet_com_tangosol_util_Filter_ you will see that it returns a Set of Map.Entry instances so you need to do this...
    Set setResults = cache.entrySet(createFilter("homeAddress.state = 'MA'"));
    for (Iterator iter = setResults.iterator(); iter.hasNext(); )
        Map.Entry entry = iter.next();
        Contact c=(Contact)entry.getValue();
        System.out.println ("firstame####=" + c.getFirstName());
    }JK

  • How to do edit functionality in JSF

    Can you please tell how to edit the data in JSf.
    I am having a table which displays values, Customer Name, which is a link , onclick of a link I should go to that Customer page, and It should allow me to edit and save the data latest data.
    can any one tell me how to do it in jsf?
    Sample code will help me.
    Thanks
    Suresh

    I am using a hidden field which refers to Customer Id
    Let me know how to do in JSf, Like in struts , I have done like this.
    am having one page, which has a link Edit customer.
    I am putting a hidden variable which actually refers to Customer id.(custId)
    Onclick I am calling a JavaScript() which will submit action.
    The content in the JSP
    <table width="760" border="0" cellpadding="0" cellspacing="0" style="margin-left:15px; margin-top:12px">
    <tr>
    <td width="510" valign="top" nowrap><table border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td width="510" valign="top" nowrap><table width="510" border="0" cellspacing="0" cellpadding="0">
    <html:hidden name="marine.customer" property="custId"/>
    <tr>
    <td style="font-size:15px" class="subtitle">
    <bean:write name="marine.customer" property="name"/>
    </td>
    <td align="right" valign="bottom" class="subtitle" style="padding-right:5px"><span style="text-align:right; font-size:10px; font-weight:normal; font-family:Arial, Helvetica, sans-serif; text-align:right">
    Edit Customer Information</span></td>
    </tr>
    </table>
    In The Action Class
    Get the form, which actually contains hidden variable
    I am passing the hidden variable to get the customer object.
    After getting the Customer object , Set all values from Customer object to editCustomerForm(it�s a form bean, which contains all jsp page atributes) to display
    And I am putting that one in session.
    HttpSession session = httpRequest.getSession();
    DynaValidatorForm customerForm = (DynaValidatorForm) actionForm;
    int customerId = 0;
    try
    /*Parse the customer id*/
    customerId =Integer.parseInt( (String) customerForm.get(AccountManagementConstants.ATTR_CUSTOMER_ID));
    Customer customer = Customer.getCustomer(customerId);
    //Set all values from Customer object to editCustomerForm to display
    //on screen
    MarineStrutsModelAdapter.buildActionFormForEditCustomer(customer,customerForm);
    session.setAttribute(AccountManagementConstants.ATTR_CUSTOMER_ID,String.valueOf(customerId));
    session.setAttribute(AccountManagementConstants.ATTR_MARINE_CUSTOMER, customer);
    But the problem here in Jsf is I don't have "form bean ", concept.
    could you tell me how to implement this.

Maybe you are looking for

  • Macbook - tv, audio & video on separate channels?!

    so i'm on a quest to watch movies that are stored on my macbook's hard drive on my 36" insignia hdtv. i have separate connections for the video and audio. the video is connected through hdmi, and the audio cord connects my headphone jack to a red/whi

  • Connecting iBook to Verizon EVDO with a Cell Phone

    Verizon allows access to their EVDO network through four cell phones models with a USB cable connecting the cell phone and a notebook computer. Has anyone done this with an iBook? If so, can you tell me how to do it? Any information would be apprecia

  • Outer join query for SQL server from Oracle

    Hi All, My question is regarding making queries from Oracle to SQL Server database thorugh DBLink. In my oracle database I have a DBLink emp.world for SQL Server database. I need to query SQL Server data from oracle (so that this query can be combine

  • HOW CAN I DOWNLOAD A MOVIE WITH SUBTITTLES

    I would like to download movies subtittled (english subtittles). Is it possible? How?

  • HELP! Lost Bulgarian Language on Nokia 3500 classi...

    When I update my phone's software my phone was with automatic language and it was English but when I go to the phone settings I saw that I haven't got Bulgarian Language. It wasn't a problem but now I want Bulgarian Language urgently. Please if enybo