Forums Register Login
A customer of mine is complaining that our App Server can't handle XML Name Space tags in a JSP page. BUT... I'm wondering if its even legal to have XMLNS in a JSP???
The code looks EXACTLY like a taglib tag... so our app server is interpretting it as such, and is throwing an exception 'cause there's no taglib tld defined. Now, if it is legal to have XMLNS in a JSP, I can write the code to work around it and what not... but I wanted to post over here to see if anyone had a valid argument as to why this should or should not be allowed.
(Why this guy wants to do it is a totally other question... I have no idea)
Thanks for any ideas!
[ January 28, 2002: Message edited by: Jessica (Bradley) Sant ]
im pretty sure u can.
u just need to include a page directive at the start stating that the page will have text/xml content.
check this link
Thanks for the link, it started me down the right path - here's some more info that helps to answer my own question:
Writing JSPs in XML using JSP 1.2
as well as the JSP 1.2 specification -- Section 5.2 and 5.5
Basically the key sentence in the 'OnJava' article is this: "A JSP can now use either traditional JSP syntax or XML syntax within its source file. However, it is important to note that a JSP source file cannot intermix JSP syntax and XML syntax"
The file I was working with looked like this (it works fine as a .html, but fails as a .jsp):

BUT -- I believe the code needs to look like this:
im glad it got u in the right track!
thanks for the info, it is actually quite an interesting and valuable topic to know
Jessica - I think that in some cases you should be able to get away without the CDATA sections (an ugly bit of XML) as well.
Also, as far as I recall, the XML with namespaces spec's tell you it is legal to have an 'xmlns' tag in any element anywhere in a wellformed (& valid?) document.
Regards, Guy
[ January 29, 2002: Message edited by: Guy Allard ]
Yeah.... so after thinking about this a bit more... it seems I was on the wrong track...
The problem is that a bit of code like this:

To the app server, it looks like a taglib... But now I'm leaning towards the fact that it is legal... and we've just gotta get the server to skip over it... hmmm....
I promise I will be the best, most loyal friend ever! All for this tiny ad:
global solutions you can do at home or in your backyard

This thread has been viewed 2141 times.

All times above are in ranch (not your local) time.
The current ranch time is
Apr 22, 2019 04:53:21.