• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Writing a file

 
kalai sundar
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My problem is i want to write a file with file name as ejb-jar.xml.when i click save button in my program, the follwoing content

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN" "http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd">
<ejb-jar>
<enterprise-beans>
<session>
<description>Session Bean</description>
<display-name>ActSchedule</display-name>
<ejb-name>ActualScheduling</ejb-name>
<home>FRP.masters.bean.actschedule.ActScheduleHome</home>
<remote>FRP.masters.bean.actschedule.ActScheduleRemote</remote>
<ejb-class>FRP.masters.bean.actschedule.ActScheduleBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<resource-ref>
<res-ref-name>jdbc/ClientDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>ActualScheduling</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>

should be saved in the file with name as ejb-jar. for some tag i am geting vales from the user, so those values wgich i get from text bos has to be placed in bettween tag, how to write in to the file ejb-jar, can u give me sample code

kalai
 
Niki Nono
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can write it the same way you write to any file.
you use a string object to write to a file.
just make the string the way you want it with the values which you want.
i am sure you know how to build the string which you want.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic