Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
surjeet yadav
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<html>
<head>
<title>Count to 10 Example(using JSTL)</title>
</head>

<body>
<c:forEach var="i" begin="1" end="10" step="1">
<cut value="${i}"/>

<br />
</c:forEach>
</body>
</html>





hi friends i get the eror that "According to TLD or attribute directive in tag file, attribute value does not accept any expressions" when i write this simple program in netbeans ide 6.5rc2. i have added library jstl1.1 still i get eror.
please give me a solution.
thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64843
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your URI is incorrect. It should be: http://java.sun.com/jsp/jstl/core
 
Tripti Ag
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<%@ page contentType="text/html" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<head>
<title>User Info Entry Form </title>
</head>
<body>
<form action="input_jstl.jsp" method="post">
<table>
<tr>
<td> Name: </td>
<td><input type="text" name="username"> </td>
</tr>
<tr>
<td> Birth Date: </td>
<td><input type="text" name="birthdate"></td>
<td> (use format yyyy-mm-dd) </td>
</tr>
<tr>
<td>Email Address: </td>
<td><input type="text" name="email"></td>
<td> (use format name@company.com) </td>
</tr>
<tr>
<td> Gender: </td>
<td><input type="radio" name="gender" value="m" checked>Male<br>
<input type="radio" name="gender" value="f">female </td>
</tr>
<tr>
<td>Favorite Foods: </td>
<td><input type="checkbox" name="food" value="pi">Pizza <br>
<input type="checkbox" name="food" value="pa">Pasta <br>
<input type="checkbox" name="food" value="ch">Chinese<br>
</td>
</tr>
<tr>
<td colspan=2><input type="submit" value="Submit"></td>
</tr>
</table>
</form>

<br><br><h3> You have entered the following data: </h3> <br><br>
Name: <c:out value="${param.username}" /><br>
Birth Date: <c:out value="${param.birthdate}" /><br>
Email Address: <c:out value="${param.email}" /><br>
Gender: <c:out value="${param.gender}" /> <br>
Favorite Food: <c:forEach items="${paramValues.food}" var="current">
<c:out value="${current}" />  
</c:forEach>
</body>
</html>

Still getting the same error.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64843
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where? Which line? Please TellTheDetails.
 
Tripti Ag
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
/input_jstl.jsp (line: 42, column: 12) According to TLD or attribute directive in tag file, attribute value does not accept any expressions

Line 42 is
Name: <c:out value="${param.username}" /><br>
 
Tripti Ag
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I changed filename to Test.jsp and now it is working properly
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64843
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's.... odd. What you name your JSP has no bearing on the tag library.
 
Tripti Ag
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know, that's why I posted it too. Earlier filename was input_jstl.jsp. Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic