Re: jstl x:parse outputs data
Kris Schneider <[email protected]>
| Newsgroups | gmane.comp.jakarta.taglibs.user |
|---|---|
| Message-ID | <[email protected]> |
You don't need those taglib entries in web.xml. Remove them and use the
proper JSTL 1.1 URIs:
<jsp:root xmlns:jsp=â€http://java.sun.com/JSP/Pageâ€
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
xmlns:x="http://java.sun.com/jsp/jstl/xml"
...
version=â€2.0">
You don't need a taglib entry for the Struts taglib either. Find out what
its proper URI is and use it instead of "struts-html".
Isabelle Phan wrote:
> this is the complete declaration in the JSP:
>
> <jsp:root
> xmlns="http://www.w3.org/1999/xhtml"
> xmlns:jsp="http://java.sun.com/JSP/Page"
> xmlns:tags="urn:jsptagdir:/WEB-INF/tags/"
> xmlns:c="jstl-core"
> xmlns:fmt="jstl-fmt"
> xmlns:x="jstl-xml"
> xmlns:html="struts-html"
> version="2.0"
> >
>
> and in web.xml:
>
> <jsp-config>
>
> <taglib>
> <taglib-uri>jstl-core</taglib-uri>
>
> <taglib-location>/WEB-INF/tld/c.tld</taglib-location>
> </taglib>
>
> <taglib>
> <taglib-uri>jstl-functions</taglib-uri>
>
> <taglib-location>/WEB-INF/tld/fn.tld</taglib-location>
> </taglib>
>
> <taglib>
> <taglib-uri>jstl-fmt</taglib-uri>
>
> <taglib-location>/WEB-INF/tld/fmt.tld</taglib-location>
> </taglib>
>
> <taglib>
> <taglib-uri>jstl-xml</taglib-uri>
>
> <taglib-location>/WEB-INF/tld/x.tld</taglib-location>
> </taglib>
>
>
> Kris Schneider wrote:
>
>> I would think you'd be using these:
>>
>> xmlns:c="http://java.sun.com/jsp/jstl/core"
>> xmlns:x="http://java.sun.com/jsp/jstl/xml"
>>
>> Isabelle Phan wrote:
>>
>>> Hi Kris
>>>
>>> the x taglib is declared like other jstl libraries:
>>>
>>> xmlns:x="jstl-xml"
>>>
>>> it follows the taglib declarations in web.xml, but from the output
>>> you are right, it seems like the tag is ignored:
>>>
>>> <x:parse escapeXml="true" xml="<?xml version="1.0"
>>> encoding="ISO-8859-1"?>
>>> etc...
>>>
>>>
>>> I have the vague feeling it's some stupid typo...
>>>
>>> thanks for your help
>>>
>>> Isabelle
>>>
>>> Kris Schneider wrote:
>>>
>>>> Are you sure you're properly declaring the x taglib? It almost looks
>>>> like <x:parse> is being treated as a plain XML element and
>>>> ${rssFeed} is simply evaluated and used for the value of the xml
>>>> attribute. Can you view the source of the generated page?
>>>>
>>>> Isabelle Phan wrote:
>>>>
>>>>> My problem: x:parse is outputting the RSS feed content even though
>>>>> the JSP does not contain <x:out> or <c:out> statement
>>>>>
>>>>> The code:
>>>>>
>>>>> <c:import var="rssFeed"
>>>>> url="http://www.expasy.org/spotlight/index.xml"/>
>>>>> <x:parse var="rss" xml="${rssFeed}"/>
>>>>>
>>>>> output:
>>>>>
>>>>> http://www.expasy.org/spotlight/ one month, one protein en-us
>>>>> [email protected] 2007-03-26T10:13:59+01:00 hourly 1
>>>>> 2000-01-01T12:00+00:00
>>>>> etc...
>>>>>
>>>>> until:
>>>>>
>>>>> while obestatin reports adequacy.
>>>>> 494@http://www.expasy.org/spotlight/ Article
>>>>> 2006-01-19T13:22:59+01:00 " var="rss"/>
>>>>>
>>>>>
>>>>> It looks as if part of the x:parse tag is printed on the HTML page!
>>>>>
>>>>> I am using JSTL 1.1
>>>>>
>>>>> Anybody seen this before?
>>
>>
>
>
--
Kris Schneider <mailto:[email protected]>
D.O.Tech <http://www.dotech.com/>