This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line!
See this thread for details.
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 Make it so: Java DB Connections & Transactions this week in the JDBC 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
author & internet detective

Joined: May 26, 2003
Posts: 32844

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.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Servlet Producing Wrong Output
jQuery in Action, 3rd edition