• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

JSP and XML

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
because i don't know what they are!
 
Bear Bibeault
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok how do I know what version of JSP and what version of JSTL i'm using?
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
There’s no place like 127.0.0.1. But I'll always remember this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic