• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JDOM, and JSP

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I'm using Tomcat to produce jsp which I want to be able to output and read XML. I have written my code using JDOM which works when the JSP isn't connected to it (i.e. in a separate file and using a command line interface to test it). However, once I link it up to my JSP pages I get little or no XML reading / writing. Does anyone know why this is?
 
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Cause you are doing something wrong. . .
Can't be sure from your post what it is though. Have you tried viewing the source generated by your jsp/servlet? That's the first place to look when a JSP doesn't act the way you think it should.
 
Arthur Nyunt
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok I think I have somethimg more specific for you. I have used JDOM to read my XML from the command line with no problem. I Then ported the code (cut and paste) to a Java Servlet. Within the try block of the servlet I added a simple "Hello World" type html code using print writer as a test at the end of the code, concerning JDOM. I have now found that if I comment out all but the first line of code cocerned with reading the XML (SAXBuilder builder = new SAXBuilder() ; ) The Hello World message is displayed. The servlet appears to not like the next line when I included the program line by line (for debug)
Document aDocument = builder.build(new File("xml/myFile.xml"));
Any suggestions?
 
Look! I laid an egg! Why does it smell like that? Tiny ad, does this smell weird to you?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic