wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Writing a file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Writing a file" Watch "Writing a file" New topic

Writing a file

kalai sundar
Ranch Hand

Joined: May 25, 2005
Posts: 69
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">
<description>Session Bean</description>

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

Niki Nono
Ranch Hand

Joined: Mar 20, 2005
Posts: 256
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.

Life called,so here I am.<br />Cheers<br />Niki.:-)
I agree. Here's the link: http://aspose.com/file-tools
subject: Writing a file
Similar Threads
Failed to resolve ejb-link
Problem deploying ejbs in weblogic
Starting WL 5.1 after deploying an Entity bean
Problem with CMT on Stateless Session beans
xdoclet problem while generating ejb-jar.xml