File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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

Nagaraju Yanamala
Greenhorn

Joined: Aug 27, 2012
Posts: 5
According to TLD or attribute directive in tag file, attribute items does not accept any expressions


I run this code in eclipse, but i got some error like this According to TLD or attribute directive in tag file, attribute items does not accept any expressions

please any one correct this code.





<%@ page contentType="text/html"%>
<%@ page import="java.util.*"%>
<%@ page import="org.apache.taglibs.datagrid.DataGridParameters"%>
<%@ page import="java.sql.*"%>
<%@ page import="emp.*"%>
<%@ taglib uri="http://jakarta.apache.org/taglibs/datagrid-1.0" prefix="ui" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>

<html>
<head>
<title>jsp paging example in datagrid</title>
<style>
th a:link { text-decoration: none; color: black }
th a:visited { text-decoration: none; color: black }
.rows { background-color: white }
.hiliterows { background-color: pink; color: #000000; font-weight: bold }
.alternaterows { background-color: #efefef }
.header { background-color: cyan; color: #000000;font-weight: bold }

.datagrid { border: 1px solid #C7C5B2; font-family: arial; font-size: 9pt;
font-weight: normal }
</style>
</head>
<body>
<br><br>

<span align="center" style="padding-left:250px;font-size:20px;">THE USER DEATAILS ARE</span><BR><BR>
<br>
<% ArrayList empList = new ArrayList ();
Employee empObj;
int fromIndex, toIndex;
int tcount =0;
int perpage=4;
int tpage=0;
try {

Connection connection = null;
Statement statement = null;
ResultSet rs = null;


Class.forName("oracle.jdbc.driver.OracleDriver");
connection =DriverManager.getConnection("jdbc:oracle:thin:@10.86.24.120:1521:hipa5010","ICDTEST","CmtIcdTest");
if(connection!=null)
{
System.out.println("the connection is established............");
}
else
{
System.out.println("the connection is not established............");
}

statement = connection.createStatement();
rs = statement.executeQuery("SELECT * from CMT_USER_ACCOUNT2");
while (rs.next()) {
tcount++;
empObj= new Employee ();
empObj.setId(rs.getInt(1));
empObj.setName(rs.getString(2));
empObj.setLname(rs.getString(3));
empObj.setPassword(rs.getString(4));
empObj.setPasswordhint(rs.getString(5));
empObj.setPasswordhintans(rs.getString(6));
empObj.setDoj(rs.getString(7));
empObj.setRole(rs.getString(8));
empObj.setCreateby(rs.getString(9));
empObj.setEmail(rs.getString(10));

// System.out.println("all values is inserted...........");

empList.add(empObj);
}

rs.close();
statement.close();
connection.close();
}
catch (Exception ex) {
System.out.println("Unable to connect to batabase."+ex);
}
fromIndex = (int) DataGridParameters.getDataGridPageIndex (request, "datagrid1");
if ((toIndex = fromIndex+4) >= empList.size ())
toIndex = empList.size();
request.setAttribute ("empList", empList.subList(fromIndex, toIndex));


pageContext.setAttribute("tCount", tcount);
%>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<ui:dataGrid items="${empList}" var="employee" name="datagrid1" cellPadding="0"
cellSpacing="0" styleClass="datagrid" >
<columns>

<column width="400">
<header value="LOGIN_ID " hAlign="left" styleClass="header"/>
<item value="${employee.id}" hAlign="left" styleClass="item"/>
</column>


<column width="400">
<header value="First_Name " hAlign="left" styleClass="header"/>
<item value="${employee.name} ${employee.lname}" hAlign="left" styleClass="item"/>
</column>


<column width="400">
<header value="Last_Name" hAlign="left" styleClass="header"/>
<item value="${employee.lname}" hAlign="left" styleClass="item"/>
</column>


<column width="400">
<header value="Password" hAlign="left" styleClass="header"/>
<item value="${employee.password}" hAlign="left" styleClass="item"/>
</column>


<column width="400">
<header value="Password_Hint" hAlign="left" styleClass="header"/>
<item value="${employee.passwordhint}" hAlign="left" styleClass="item"/>
</column>


<column width="400">
<header value="Password_Hint_Ans" hAlign="left" styleClass="header"/>
<item value="${employee.passwordhintans}" hAlign="left" styleClass="item"/>
</column>

<column width="400">
<header value="Created_Date" hAlign="left" styleClass="header"/>
<item value="${employee.doj}" hAlign="left" styleClass="item"/>
</column>

<column width="400">
<header value="ROLE" hAlign="left" styleClass="header"/>
<item value="${employee.role}" hAlign="left" styleClass="item"/>
</column>

<column width="400">
<header value="CREATE_BY" hAlign="left" styleClass="header"/>
<item value="${employee.createby}" hAlign="left" styleClass="item"/>
</column>


<column width="400">
<header value="E_MAIL" hAlign="left" styleClass="header"/>
<item value="${employee.email}" hAlign="left" styleClass="item"/>
</column>





</columns>



<rows styleClass="rows" hiliteStyleClass="hiliterows"/>
<alternateRows styleClass="alternaterows"/>

<paging size="4" count="${tCount}" custom="true" nextUrlVar="next"
previousUrlVar="previous" pagesVar="pages"/>
<order imgAsc="up.gif" imgDesc="down.gif"/>
</ui:dataGrid>
<table width="750" style="font-family: arial; font-size: 10pt" border=0>

<tr>
<td align="left" width="33%">
<c:if test="${previous != null}">
<a href="<c:out value="${previous}"/>">Previous</a>
</c:if> 
</td>
<td align="center" width="33%">
<c:forEach items="${pages}" var="page">
<c:choose>
<c:when test="${page.current}">
<b><a href="<c:out value="${page.url}"/>"><c:out value="${page.index}"/></a></b>
</c:when>
<c:otherwise>
<a href="<c:out value="${page.url}"/>"><c:out value="${page.index}"/></a>
</c:otherwise>
</c:choose>
</c:forEach>
</td>
<td align="right" width="33%"> 
<c:if test="${next != null}">
<a href="<c:out value="${next}"/>">Next</a>
</c:if>
</td>
</tr>
</table>
</body>
</html>




Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1016
Change this:



to this:



The subtle addition of /jsp into the mix tells it to use JSTL1.1 rather than JSTL1.0
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: According to TLD or attribute directive in tag file, attribute items does not accept any expressions
 
Similar Threads
Getting error while deploying Paging folder in tomcat 4.1
having Problem about JSTL
Data Grid 1.2 Tag DateFormat
Jakarata DataGrid TagLib
problem in data grid