Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP and XML

 
colm o'donnell
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I was hoping for some help retrieving XML data using JSP. I have the following JSP page (home.jsp):


and I have the following XML page(clubs.xml):



What I want to do is straight forward enough - I want to replace their names in the HTML code with the values of the name nodes and replace their description in the HTML with the values of the story nodes.

I would really appreciate someones help.

Thanks in Advance
Colm
</clubs>
[ April 24, 2008: Message edited by: colm o'donnell ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64990
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why aren't you using the JSTL XML tags?
 
colm o'donnell
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
because i don't know what they are!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64990
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But you're searching for information on them right now, correct?
 
colm o'donnell
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok i have a little sample on the JSTL tags but im getting this error

org.apache.jasper.JasperException: /website/test.jsp(3,0) Unterminated <%@ taglib tag

code for sample is:


do you know why i'm getting this error?

Thanks
Colm
 
Doug Slattery
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably because of this line:

The error message part (3,0) says the error is on line 3, column 0 which is the opening angle bracket. Unterminated tag comes from the closing angle bracket in front of your uri attribute.

Aloha,
Doug

-- Nothing is impossible if I'mPossible
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64990
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, you can't prefix more than one tag library with the same name. Conventionally, "x" is used for the XML library.
 
colm o'donnell
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a million for all the help guys but unfortunately i changed the prefix and got rid of the bracket but now I am getting this error:

org.apache.jasper.JasperException: /website/test.jsp(8,1) According to TLD or attribute directive in tag file, attribute xml does not accept any expressions

Anybody know what this means?

Thanks a million again
Colm
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64990
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It usually means that you are using the wrong version of the JSTL. Follow the directions in the JSP FAQ to correctly set up your app for the correct version of JSTL for your container.
 
colm o'donnell
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok how do I know what version of JSP and what version of JSTL i'm using?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would have to check with the documentation for the container you're using to know what version of JSP/Servlets is supported.

For JSTL, you download and install the jars yourself so you should know what version you're getting.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic