File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes JSP and XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP and XML" Watch "JSP and XML" New topic
Author

JSP and XML

colm o'donnell
Greenhorn

Joined: Apr 07, 2008
Posts: 17
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

Joined: Jan 10, 2002
Posts: 60059
    
  65

Why aren't you using the JSTL XML tags?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
colm o'donnell
Greenhorn

Joined: Apr 07, 2008
Posts: 17
because i don't know what they are!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60059
    
  65

But you're searching for information on them right now, correct?
colm o'donnell
Greenhorn

Joined: Apr 07, 2008
Posts: 17
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

Joined: Sep 15, 2007
Posts: 294
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

Joined: Jan 10, 2002
Posts: 60059
    
  65

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

Joined: Apr 07, 2008
Posts: 17
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

Joined: Jan 10, 2002
Posts: 60059
    
  65

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

Joined: Apr 07, 2008
Posts: 17
ok how do I know what version of JSP and what version of JSTL i'm using?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

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.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP and XML
 
Similar Threads
Rounding off $$ amounts
jsp:include and c:import combination/nesting
required fields not populating
Error comes whilke compiling the jsp page
Getting search results on same search page