bernd pier

Ranch Hand
+ Follow
since Jun 21, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by bernd pier

you can convert html files into xml files by using java.
but i don`t know what exactly you mean.
if you could explain your problem a little more different, it would be easier to give an answer.
bernd
java can do this job.
you create a DOMTree, serialize it and write the file to harddisk.
the source can be databse,textfile or something else.
the tutorial from IBM is very good, i`ve used the tutorial manipulating datas with xslt, i think, and the book Java & XML from Bret Mclaughlin.
bernd
hey,
what about java and ipsec.
i want to manage a secure tunnel connection between server and client.
thanx
bernd
21 years ago
i`ve fixed the problem.
it was a logical problem, there were two connections to the database.
i`m still learning.
ciao bernd
21 years ago
hey,
i`ve a servlet,that shows a formpage using xml,xsl.
user can write datas in that form and they had to stored in a database.
with html it works, but with xsl it don`t.
i`m using the getParameter method, and when i wrote datas in the textfield and klick the ok button, the variablename and the data appears in the url.
but they will not be stored in the database.
i thought i could take the html code and change it into xsl.
i would be happy if anybody can help me.
thanx
bernd :roll:
21 years ago
hey david,
i want to give you a shoulder to lean on.
i`m just new in java and i know your feelings very well, but be sure there is a way to make servlet`s run.
don`t give up.

bernd
21 years ago
thanx willliam,
your`re right sometimes it`s so easy.
bernd
21 years ago
hey folks,
i have a servlet, which creates a DOMTree and write it into a xml file.
now i want to transform the DOMTree with transformerfactory.
compiling is no problem, but when i run the servlet i got following error:
getWriter() has already been called for this response.
i create a PrintWriter object in my servlet for one time, cause i had to write some html code.
in the DO;Serializer class, which is used from the servlet, i create a second PrintWriter object to write the xml file, but i use the close method for this object.
pls give me some help.
bernd
21 years ago
hey sid,
did you want to call a servlet from a html page?
the code for this is:
<form action="http://localhost:8080/examples/servlet/servletname" method="get">....
so the html page could be anywhere on your pc, cause you refer via localhost:8080 to tomcat/examples directory.
good luck
bernd
21 years ago
hey dave,
thanx for your help.
it seems, that i was a little bit on the edge, cause yesterday, after sleeping about it,i saw, that i only had to parse the xml file and that`s it i think.
first i had the idea, that there could be something like href in html.
ciao
Bernd
21 years ago
hey,there in the outerspace;
is there a simple way to connect to a xml file from a servlet.
i have a servlet, that creates a xml file and i want to display this xml file in a browser from this servlet.
sounds complicated?
ok, the basic question is:
i have a servlet and a xmlfile(with a xslfile) and i want the servlet to call the xml file, just like a browser call a html file to display.
any idea?
bernd :roll:
21 years ago
hey sid,
if you want to connect from a html page to a servlet you don`t need a web.xml file.
the only thing you had to do is to start tomcat, before calling the html page and to set the right pass to your servlet.
i`ve wrote a little html page that connect to a servlet and the correct path is:
< form action="http://localhost:8080/examples/servlet/Coffees4" method="get" />
infact the examples folder is a default folder from tomcat and i have my .java and .class files in it.
the html file should be whereever it will be, doesn`t matter.
hope this may help you.
bernd
21 years ago
hey
i have wrote a html page which referred to a servlet.
the action tag look like this:
<form action="http://localhost:8080/examples/servlet/Coffees4" method="get" />
it work`s.
maybe your tomcatserver is not running?
bernd
21 years ago
hey there,
i`m trying to create a DOMTree, but it doesn`t work.here is a code fragment:
while (rs.next())
{
//create the element to hold the row
Element rowEl=dataDoc.createElement("row");
//for each row loop through each column
for (int i=1; i<=numCols;i++) {
//get name and value
String colName=resultmetadata.getColumnName(i);
String colValue=rs.getString(i);

//create a new element with column name and add value,then add element to row
Element columnEl=dataDoc.createElement(colName);
//out.println(dataDoc.createTextNode(colValue));
columnEl.appendChild(dataDoc.createTextNode(colValue));

rowEl.appendChild(columnEl);
out.println(columnEl.toString());
out.println(rowEl.toString());
out.print(dataDoc.createTextNode(colValue).toString());
}
//add the row element to the root
dataRoot.appendChild(rowEl);
}
//add the root to the document
dataDoc.appendChild(dataRoot);
and here is a piece of the output:
[#text: alhambra][SUP_ID: null]
[row: null]
[#text: 120][PRICE: null]
[row: null]
[#text: 6.99][SALES: null]
[row: null]
[#text: 0][TOTAL: null]
[row: null]
[#text: 0]
i`m just wondering about [PRICE: null], because i think there had to be a value e.g 6.99 and even [row: null].
i expected [row: PRICE: 6.99] or something like this.
maybe it`s a stupid question, so excuse me, but i`m just learning.
thanx for your forthcoming help
bernd
hey mark,
i knew SAX,DOM,JDOM,JAXP to parse xml.
i`m just a beginner in java and xml, but i have some links for you:
DOM
http://www.jcpohl.de/technik/tut1dom.html
http://www.w3c.com //this is the reference side including tutorials
the main difference between DOM and SAX is, that DOM hold the XML in a tree structure and you can access to any level, node or childnode to any time.
SAX parse the XML file line after line, so if SAX is in level 4 of the XML structure it`s impossible to access to level 2 or level 5. level 2 is parsed and lost and level 5 will be parsed.
when the XML file is very big, the DOM parser needs a lot of resources of cpu and memory to hold it and then it`s better to use the SAX parser.
at least you need a parser, i prefer xerces from apache.
i hope this help`s.
best wiches
bernd