tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hans Bergsten <h...@gefionsoftware.com>
Subject Re: fmt taglib validation fails with web-app_2_4.xsd
Date Thu, 02 Oct 2003 21:59:42 GMT
Adam Hardy wrote:
> Sorry, I'm struggling with this a bit. There's alot going on in tomcat5 
> that I'm not sure about yet.
> 
> It's caching the tld files which I didn't realise, so I had to add a bit 
> to my deploy script.
> 
> It seems like I'm getting a different error with every change I make.
> 
> Basically I get the error below when I start tomcat and it pulls out all 
> the TLDs.
> 
> I am also getting:
> JasperException: /WEB-INF/general/pageheader.jsp(9,2) According to TLD 
> or attribute directive in tag file, attribute property does not accept 
> any expressions
> 
> whenever I call the page with the struts html taglib that was 
> specifically modified to process EL.
> 
> Oh well. I shall struggle on and see what else comes of it. Any idea / 
> help would be v.v.welcome.

To make a long story short, if you primarily want to upgrade to TC 5 and
have no interest in using the new JSP 2.0 features, continue to use the
Servlet 2.3 deployment descriptor (DD) instead of changing it to a 2.4
DD. A JSP 2.0 container (like TC 5) treats an app with a 2.3 DD just as
a JSP 1.2 container, so the app should just work as-is if you do this.

If you change to a 2.4 DD, you're telling the JSP container to handle
all EL expressions (instead of letting the JSTL (Or custom library, like
Struts) tag handlers handle them). For this to work, you need to change
all tag libraries to JSP 2.0 versions (where the attributes are marked
as accepting "request-time attribute values"). JSTL 1.1 defines new
versions of all libraries for this purpose (with new URIs). I'm not sure
if there are JSP 2.0 versions of the Struts EL libraries, though.

For more on this, see the JSTL 1.1 spec.

Hans


> On 10/02/2003 09:06 PM Kris Schneider wrote:
> 
>> I really haven't played around with TC 5 or JSTL 1.1, but a quick 
>> smoke test
>> passed just fine. I used the following JSP:
>>
>> <%@ page contentType="text/plain" %>
>> <%@ taglib prefix="c"   uri="http://java.sun.com/jsp/jstl/core" %>
>> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
>> <c:set var="key" value="msg"/>
>> <fmt:bundle basename="messages">
>> Message: <fmt:message key="${key}"/>
>> </fmt:bundle>
>>
>> With the following resource bundle:
>>
>> msg=Hello, world!
>>
>> And got the expected output. Can you post relevent snippets from your 
>> web.xml
>> and JSP file?
>>
>> Quoting Adam Hardy <ahardy.struts@cyberspaceroad.com>:
>>
>>
>>> I had wanted to do that but had stupidly not found the tarball. I got 
>>> it now but after deploying them and changing the taglib declares to 
>>> what you gave, tomcat chokes on the TLD validation. Do you recognise 
>>> the problem?
>>>
>>> preRegister with Catalina:type=Logger,path=/blacksail,host=localhost
>>> org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid 
>>> content starting with element 'jsp-version'. The content must match
>>
>>
>> '((("http://java.sun.com/xml/ns/j2ee":description){0-UNBOUNDED},("http://java.sun.com/xml/ns/j2ee":display-name){0-UNBOUNDED},("http://java.sun.com/xml/ns/j2ee":icon){0-UNBOUNDED}),("http://java.sun.com/xml/ns/j2ee":tlib-version),("http://java.sun.com/xml/ns/j2ee":short-name),("http://java.sun.com/xml/ns/j2ee":uri){0-1},("http://java.sun.com/xml/ns/j2ee":validator){0-1},("http://java.sun.com/xml/ns/j2ee":listener){0-UNBOUNDED},("http://java.sun.com/xml/ns/j2ee":tag){0-UNBOUNDED},("http://java.sun.com/xml/ns/j2ee":tag-file){0-UNBOUNDED},("http://java.sun.com/xml/ns/j2ee":function){0-UNBOUNDED},("http://java.sun.com/xml/ns/j2ee":taglib-extension){0-UNBOUNDED})'.

>>
>>
>>>
>>>
>>> On 10/02/2003 07:32 PM Kris Schneider wrote:
>>>
>>>> You should probably try using Standard 1.1.0-B1 since TC 5 is a JSP 2.0
>>>> container. Note that the URI will be different:
>>>>
>>>> JSTL 1.0:
>>>> http://java.sun.com/jstl/fmt
>>>>
>>>> JSTL 1.1:
>>>> http://java.sun.com/jsp/jstl/fmt
>>>>
>>>> Quoting Adam Hardy <ahardy.struts@cyberspaceroad.com>:
>>>>
>>>>
>>>>
>>>>> I upgraded to tomcat 5 and taglib standard 1.0.4. In my deployment 
>>>>> descriptor I replaced the old web-app_2_3.dtd reference with 
>>>>> web-app_2_4.xsd . Now I'm having problems.
>>>>>
>>>>> What was working fine:
>>>>>
>>>>> <fmt:message key="${var4SomeKey}"/>
>>>>>
>>>>> is now causing the JasperException:
>>>>>
>>>>> According to TLD or attribute directive in tag file, attribute 
>>>>> property does not accept any expressions.
>>>>>
>>>>> I don't know why it should state that since the taglib was handling 
>>>>> the EL expressions before perfectly.
>>>>>
>>>>> In my web.xml I do not have any taglib tld location mappings and 
>>>>> I'm wondering if I need them now to solve my problem.
>>>>>
>>>>> I can't find any reference to this issue in the archives or google 
>>>>> or bugzilla, but I'm sure it must be a well known issue.
>>>>>
>>>>> Does anybody know what's up with my set-up?
>>>>>
>>>>> Adam
>>>>>
>>>>> -- 
>>>>> struts 1.1 + tomcat 5.0.12 + java 1.4.2
>>>>> Linux 2.4.20 RH9
>>>>
>>>>
>>>>
>>> -- 
>>> struts 1.1 + tomcat 5.0.12 + java 1.4.2
>>> Linux 2.4.20 RH9
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>>>
>>
>>
>>
> 


-- 
Hans Bergsten                                <hans@gefionsoftware.com>
Gefion Software                       <http://www.gefionsoftware.com/>
Author of O'Reilly's "JavaServer Pages", covering JSP 1.2 and JSTL 1.0
Details at                                    <http://TheJSPBook.com/>


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message