using jstl taglibs [message #148221] |
Tue, 22 November 2005 07:30  |
Eclipse User |
|
|
|
Hi,
I just started working with jsp for the first time. I tried using it with
jstl, but I got some errors. I put the 2 jar files that come with the jstl
in WEB-INF/lib . I then added "<%@taglib
uri="http://java.sun.com/jsp/jstl/xml" prefix="x"%> to my jsp file. When
trying to access this jsp I got:
[Fatal Error] jstl::1:1: Content is not allowed in prolog.
ERROR: 'Content is not allowed in prolog.'
FATAL ERROR: 'Could not compile stylesheet'
Any idea why?
Thanks,
Zohar.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: using jstl taglibs [message #149668 is a reply to message #149433] |
Tue, 29 November 2005 08:45   |
Eclipse User |
|
|
|
I've now reduced the jsp to this:
---------------------------8<-------------------------------------------------
<%@taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<x:transform xml="restaurants.xml" xslt="restaurants.xsl" />
---------------------------8<-------------------------------------------------
I still get this when trying to get it:
[Fatal Error] jstl::1:1: Content is not allowed in prolog.
ERROR: 'Content is not allowed in prolog.'
FATAL ERROR: 'Could not compile stylesheet'
Nov 29, 2005 3:39:48 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
javax.xml.transform.TransformerConfigurationException: Could not compile
stylesheet
If I take out the line
<x:transform xml="restaurants.xml" xslt="restaurants.xsl" />
it works OK (nothing is returned, but no exception is thrown)
"Larry Isaacs" <Larry.Isaacs@sas.com> wrote in message
news:dmd6qb$rho$1@news.eclipse.org...
>I think I was looking at a jar from JSTL 1.0.x, so it looks like they
>changed the URI going to 1.1. Since your URI was correct, I'm not sure why
>the taglib tag was causing problems.
>
> Larry
>
> Zohar wrote:
>> I have this in x.tld:
>>
>> <description>JSTL 1.1 XML library</description>
>> <display-name>JSTL XML</display-name>
>> <tlib-version>1.1</tlib-version>
>> <short-name>x</short-name>
>> <uri>http://java.sun.com/jsp/jstl/xml</uri>
>>
>> So it seems like it's http://java.sun.com/jsp/jstl/xml - is that correct?
>>
>> "Larry Isaacs" <Larry.Isaacs@sas.com> wrote in message
>> news:dm28r8$ae9$1@news.eclipse.org...
>>
>>>I believe it should be "http://java.sun.com/jstl/xml", without the "jsp".
>>>Assuming there's no relevant taglib declaration in the web.xml, then the
>>>TLD will be read directly from the jar's internal META-INF directory. If
>>>you are unsure what the URI should be, examine the appropriate TLD within
>>>the jar, x.tld in this case. Find the <uri> element and that will give
>>>you what you should specify.
>>>
>>>Cheers,
>>>Larry
>>>
>>>Zohar wrote:
>>>
>>>>it seems that this line is the problematic one:
>>>>
>>>><%@taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x"%>
>>>>
>>>>when I take it out the page compiles fine.
>>>>
>>>>"Andreas Holtz" <A.Holtz@gmx.net> wrote in message
>>>>news:85e544de8f836c9d41631bfc150f9a89$1@www.eclipse.org...
>>>>
>>>>
>>>>>Could you post the first rows of your jsp?
>>>>>Perhaps your applications server does not compile it and sends it
>>>>>directly to the browser.
>>>>>
>>>>>You should not have something like
>>>>><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
>>>>>"http://www.w3.org/TR/html4/strict.dtd"> in your jsp.
>>>>>
>>>>>Andreas
>>>>>
>>>>
>>>>
>>
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07730 seconds