Results 1 to 2 of 2
- 10-22-2008, 02:36 PM #1
Member
- Join Date
- Oct 2008
- Posts
- 1
- Rep Power
- 0
Creating Java bean From XML File in WebApplication
Hi
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.
<employee>
<name>Ashok</name>
<dept>Acct</dept>
<address>
<city>xyz</city>
<zip>560037</zip>
</address>
</employee>
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)
{
this.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)
{
this.city = city;
}
public int getZip()
{
return zip;
}
public setZip(int zip)
{
this.zip= zip;
}
}
Thanks
Ashok.
- 10-22-2008, 05:02 PM #2
Senior Member
- Join Date
- Sep 2008
- Posts
- 135
- Rep Power
- 0
Similar Threads
-
how to import a ejb bean in java file
By vijayinani in forum Enterprise JavaBeans (EJB)Replies: 2Last Post: 06-30-2009, 10:05 PM -
How to write a java bean class object to XML file
By Java Tip in forum java.ioReplies: 1Last Post: 01-29-2009, 09:35 AM -
How to extracts a java bean object from the XML file
By Java Tip in forum java.ioReplies: 1Last Post: 01-29-2009, 09:33 AM -
Creating Folder in JAVA and Copying File
By fnoman in forum New To JavaReplies: 8Last Post: 10-18-2008, 07:33 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks