|
Re: using jstl taglibs [message #148229 is a reply to message #148221] |
Tue, 22 November 2005 15:49 |
|
Zohar wrote:
> 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?
Where and when was this error reported?
--
- Nitin
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
Re: using jstl taglibs [message #148353 is a reply to message #148221] |
Tue, 22 November 2005 17:18 |
Eclipse User |
|
|
|
Originally posted by: erickson_d.yahoo.removethis.com
I can't say for sure if this is your problem, but there are some
versions of JSTL kicking around that have bad TLDs. I had trouble with
a version that I got from an older JWSDP. But I'm using a version out
of the Apache Tomcat 5.5 distribution that works fine.
Zohar wrote:
> 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 #149058 is a reply to message #148221] |
Thu, 24 November 2005 22:47 |
Eclipse User |
|
|
|
Originally posted by: thisisnot.mymail.com
Zohar wrote:
> 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.
>
>
Do you have xalan in you libs?
|
|
|
|
|
|
Re: using jstl taglibs [message #149668 is a reply to message #149433] |
Tue, 29 November 2005 13:45 |
Zohar Amir Messages: 419 Registered: July 2009 |
Senior Member |
|
|
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
>>>>>
>>>>
>>>>
>>
|
|
|
Re: using jstl taglibs [message #149722 is a reply to message #149668] |
Tue, 29 November 2005 16:29 |
|
Zohar wrote:
> [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)
it looks like restaurants.xml is itself not well-formed. Perhaps
it's missing the XML declaration at the start or the DOCTYPE is invalid?
--
- Nitin
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
|
Re: using jstl taglibs [message #150258 is a reply to message #150129] |
Thu, 01 December 2005 10:05 |
|
Zohar wrote:
>>>[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)
My bad. It looks like it's complaining about the stylesheet.
--
- Nitin
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06321 seconds