• Post Reply Bookmark Topic Watch Topic
  • New Topic

XML on JSP

 
Cyrus Serrano
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys,

new comer on JSP.. can you give me some help on how to display XML on JSP. thanks. im currently using bea weblogic.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe you could describe what you're trying to do in a little more detail?

"display XML on JSP" could mean several things.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
 
Cyrus Serrano
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.. i was rushing things...sorry

Well im currently creating a JSP page and it has a listbox that should be populated with data. But the data would be coming not from a database but from an xml file. Any idea on how to implement this.

thank for correcting me
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whether the data comes from a database, xml file, flat file, webservice, or any other source, the best place the JSP is not the best place to work with it.

I would want to have some sort of bean that could get, parse, and move the data from your xml file into some sort of collection that can be worked with easily for display purposes in a JSP.

For intstance, once in a List or Map, data can be iterated over with JSTL and written to the output stream with EL.

There are lots of products for working with XML from within Java classes.
Say the word and I'll move this to our XML and Related Technologies forum for you.
[ July 28, 2006: Message edited by: Ben Souther ]
 
Cyrus Serrano
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey thanks, please move this.. im a beginner actually on java web apps. Your reply has somewhat stimulated me to learn more. im trying to grab a copy of HFJS.. by the weekend.

my next problem would be is what is a BEAN? is it like a DLL?
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSTL has a collection of XML handling tags.
I've used those in the past to prepopulate forms with default values that were somewhat flexible.
They could change per customer but the rate of change was low enough that it was overkill to put them in a database table.

For anything but such semi-static data for populating form controls I'd probably not consider the combination and either hardcode it in the JSPs or populate it in a servlet controller from a database.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!