• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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">
<c:out 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.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your URI is incorrect. It should be: http://java.sun.com/jsp/jstl/core
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where? Which line? Please TellTheDetails.
 
Tripti Ag
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I changed filename to Test.jsp and now it is working properly
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know, that's why I posted it too. Earlier filename was input_jstl.jsp. Thanks.
 
reply
    Bookmark Topic Watch Topic
  • New Topic