wood burning stoves*
The moose likes Servlets and the fly likes Servlet Producing Wrong Output Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet Producing Wrong Output" Watch "Servlet Producing Wrong Output" New topic

Servlet Producing Wrong Output

shaun michael

Joined: Jan 05, 2005
Posts: 7
When I access the code below from a command line program it gives me the correct output, however when I access the same code from a servlet the output is incorrect. For example when I run from the command line the variable name = "program" and link = "program.html" and the output would be <a href="program.html">program</a>. When accessed from a servlet the variables come out backwards so the output would be <a href="program">program.html</a>. Can someone explain why this happens and how it might be fixed. Thanks in advance.
Jeanne Boyarsky
internet detective

Joined: May 26, 2003
Posts: 29275

Welcome to JavaRanch!

Accoring to the API, "The order of attributes in the list is unspecified, and will vary from implementation to implementation." My guess is that your servlet container is pointing to a different version/implementation of SAX than your command line.

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
I agree. Here's the link: http://aspose.com/file-tools
subject: Servlet Producing Wrong Output
Similar Threads
Parsing XML elements
Parsing with SAX parser
? How to call JAXP/JDOM from other class
SAX problem
'reading' an xml document - what am i doing wrong?