dcsimg
Difference between Tomcat As Start from Service And As Start from startup command from bin
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   sachin_chowdhary
Posted On:   Thursday, January 30, 2003 08:17 PM

When i am creating an XML File than it is created in bin when i start tomcat from command startup but when i will start it from Services in windows2000 than it is creating winnt/system32 directory.So why it is happening I am not able to create file my desired position in tomcat by passing destination like file://c:anydictmyXML.xml I am using Tomcat 4.1.18 jdom b8 jdk1.4 and suggest my code for creating XML <%@ page import="java.io.*,java.util.*,org.w3c.dom.*,javax.xml.parsers.*, org.jdom.output.XMLOutputter %> <% ObjectOutputStream fout; fout=new FileOutputStream("file1.xml&   More>>

When i am creating an XML File than it is created in bin when i start tomcat from command startup

but when i will start it from Services in windows2000 than it is creating winnt/system32 directory.So why it is happening

I am not able to create file my desired position in tomcat by passing destination like file://c:anydictmyXML.xml

I am using

Tomcat 4.1.18
jdom b8
jdk1.4

and suggest

my code for creating XML





<%@ page import="java.io.*,java.util.*,org.w3c.dom.*,javax.xml.parsers.*, org.jdom.output.XMLOutputter %>



<%
ObjectOutputStream fout;
fout=new FileOutputStream("file1.xml");

// Element root = new Element("GREETING");


DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.newDocument();

Element newLink = doc.createElement("root");
Element newLink1 = doc.createElement("root");
doc.appendChild(newLink);
doc.appendChild(newLink1);


out.println("hello");

try {
XMLOutputter serializer = new XMLOutputter();
serializer.output(doc,System.out);
}
catch (IOException e) {
//System.err.println(e);
}


fout.close();
%>


   <<Less

Re: Difference between Tomcat As Start from Service And As Start from startup command from bin

Posted By:   rajeev_kumar  
Posted On:   Friday, January 31, 2003 01:14 AM

do the following
ObjectOutputStream fout; fout=new FileOutputStream("c:\anydict\myXML\file1.xml");

and execute ur code
About | Sitemap | Contact