aspose file tools*
The moose likes JSP and the fly likes According to TLD or attribute directive in tag file, attribute items does not accept any expressions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "According to TLD or attribute directive in tag file, attribute items does not accept any expressions" Watch "According to TLD or attribute directive in tag file, attribute items does not accept any expressions" New topic
Author

According to TLD or attribute directive in tag file, attribute items does not accept any expressions

hariharan jayaprakash
Ranch Hand

Joined: Sep 09, 2010
Posts: 63
I am using struts 1.3 version with Tomcat 5.5

I dunno exactly which version of JSTL jar, i have to use?...

Rite now am using jstl.jar and standard.jar

i was stuck with two days, because of this problem..

In my JSP am using:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page isELIgnored="false"%>



In my JSTL.jar, c.tld file i got the following details

<?xml version="1.0" encoding="UTF-8" ?>

<taglib xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
version="2.1">

<description>JSTL 1.2 core library</description>
<display-name>JSTL core</display-name>
<tlib-version>1.2</tlib-version>
<short-name>c</short-name>
<uri>http://java.sun.com/jsp/jstl/core</uri>




can anyone help me to solve this probs?..
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

Except for the <%@ page isELIgnored="false"%> being unnecessary (remove it -- goop on the pages, even if it isn't causing problems, is still goop), I don't see much else wrong. If the EL doesn't work with this removed, your app is misconfigured.

What's the tag that's causing the issue?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
hariharan jayaprakash
Ranch Hand

Joined: Sep 09, 2010
Posts: 63
Am trying to use forEach tag:

<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page import="java.util.*,com.manu.classes.productVO"%>
<%@ page isELIgnored="false"%>


And am using scriplet to get ArrayList objects

<%
ArrayList productDetails =(ArrayList)request.getAttribute("productDetails");
%>



Then when i try to use
<c:forEach var="displayDetails" items="${productDetails}">
----- iteration to get the arraylist objects
</c:forEach>


I got this error:

According to TLD or attribute directive in tag file, attribute items does not accept any expressions
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

What on earth is that scriptlet for? Remove it. Scriptlets are never used anymore. Also remove the isElIgnored directive.

Is your web.xml properly declared using the XML schema as opposed to the old 2.3 DTD?

Did you mistakenly extract a TLD file for the JSTL and place it somewhere?

What jars are in your WEB-INF/lib folder?
hariharan jayaprakash
Ranch Hand

Joined: Sep 09, 2010
Posts: 63
I downloaded jstl-1.2.jar from internet...

In META-INF folder c.tld Contains

<?xml version="1.0" encoding="UTF-8" ?>

<taglib xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
version="2.1">

<description>JSTL 1.1 core library</description>
<display-name>JSTL core</display-name>
<tlib-version>1.1</tlib-version>
<short-name>c</short-name>
<uri>http://java.sun.com/jsp/jstl/core</uri>




I ve used servlets for storing arraylist objects in request scope... I am not able to use JSTL. tats the reason i used scriptlets to retrieve the objects.

I didnt configure anything in web.xml directory.


Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

Please answer my questions.

Bear Bibeault wrote:Is your web.xml properly declared using the XML schema as opposed to the old 2.3 DTD?

Did you mistakenly extract a TLD file for the JSTL and place it somewhere?

What jars are in your WEB-INF/lib folder?
hariharan jayaprakash
Ranch Hand

Joined: Sep 09, 2010
Posts: 63
This is my web.xml file...


<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
<display-name>Struts Blank Application</display-name>

<!-- Standard Action Servlet Configuration -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>


<!-- Standard Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>


<!-- The Usual Welcome File List -->
<welcome-file-list>
<welcome-file>main.jsp</welcome-file>
</welcome-file-list>

</web-app>
hariharan jayaprakash
Ranch Hand

Joined: Sep 09, 2010
Posts: 63
Jars



[Thumbnail for jars.jpg]

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

And here is at least one of your problems:

Check the JSP FAQ for the proper way to declare your web.xml.
hariharan jayaprakash
Ranch Hand

Joined: Sep 09, 2010
Posts: 63
okay, but actually what we need to configure in web.xml directory regarding to JSTL?...

and what you mentioned few lines in my web.xml.. what is tat exactly?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

Nothing needs to be added to the web.xml with regards to the JSTL.

If you do not know what those lines are in the web.xml, you need to grab a copy of the Servlet Specification and start reading. Understanding the deployment descriptor is required when writing servlets.

Again, the JSP FAQ contains the info you need to correctly set up web.xml.
hariharan jayaprakash
Ranch Hand

Joined: Sep 09, 2010
Posts: 63
okay.. thanks i read those things properly first ..
 
 
subject: According to TLD or attribute directive in tag file, attribute items does not accept any expressions