Results 1 to 2 of 2
  1. #1
    ashokkumar is offline Member
    Join Date
    Oct 2008
    Rep Power

    Default Creating Java bean From XML File in WebApplication

    I am getting follwoing XML file by browsing in my jsp page,then i want to create java bean class by clicking one "convertBEAN" button in my JSP page.Using JAXB,XMLBean etc i am able to create the java bean.

    But my problem is how to add this thing in Web application(JSP file) so that it will dynamically generate the bean class.

    If any one have already done this thing please help me.


    After Clicking "ConvertButton", Converted bean class should be

    public class Employee
    private String name;
    private String dept;
    private Address address;

    public Employee(){}

    public String getName()
    return name;

    public setName(String name)
    { = name;

    public String getDept()
    return dept;
    public setDept(String dept)
    this.dept = dept;

    public Address getAddress()
    return address;
    public setAddress(Address address)
    this.address = address;

    class Address
    private String city;
    private int zip;

    public Address(){}

    public String getCity()
    return city;
    public setCity(String city)
    { = city;

    public int getZip()
    return zip;

    public setZip(int zip)
    { zip;


  2. #2
    georgemc is offline Senior Member
    Join Date
    Sep 2008
    Rep Power


    Why do you need to do that? How do you plan on having your application use types it knows absolutely nothing about until runtime? What are you actually trying to do?

Similar Threads

  1. how to import a ejb bean in java file
    By vijayinani in forum Enterprise JavaBeans (EJB)
    Replies: 2
    Last Post: 06-30-2009, 11:05 PM
  2. Creating Folder in JAVA and Copying File
    By fnoman in forum New To Java
    Replies: 8
    Last Post: 10-18-2008, 08:33 AM
  3. Replies: 0
    Last Post: 04-06-2008, 08:44 PM
  4. Replies: 0
    Last Post: 04-06-2008, 08:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts