This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet Producing Wrong Output" Watch "Servlet Producing Wrong Output" New topic
Author

Servlet Producing Wrong Output

shaun michael
Greenhorn

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
Marshal

Joined: May 26, 2003
Posts: 30068
    
149

Shaun,
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
 
Consider Paul's rocket mass heater.
 
subject: Servlet Producing Wrong Output
 
Similar Threads
? How to call JAXP/JDOM from other class
Parsing XML elements
SAX problem
Parsing with SAX parser
'reading' an xml document - what am i doing wrong?