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 could not understand an example in head first servlet (dynamic attribute in tag file) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "could not understand an example in head first servlet (dynamic attribute in tag file)" Watch "could not understand an example in head first servlet (dynamic attribute in tag file)" New topic
Author

could not understand an example in head first servlet (dynamic attribute in tag file)

himani jangid
Greenhorn

Joined: Jul 04, 2013
Posts: 18
<%@ tag body-content='empty' dynamic-attributes='tagAttrs'
%>
<%@ attribute name='optionsList' type='java.util.List'
required='true' rtexprvalue='true' %>
<%@ attribute name='name' required='true' %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<select name='${name}'
<c:forEach var="attrEntry" items="${tagAttrs}">
${attrEntry.key}='${attrEntry.value}'
</c:forEach>
>

<c:forEach var="option" items="${optionsList}">
<option value='${option}'> ${option} </option>
</c:forEach>
</select>

so in this example from where we are getting the tagAttrs var.
its an haspmap but who sets the values in this. and how it help in checking the correct values of attritbutes

and also when i am pasting this code in eclipse i am getting an error on line
<c:forEach var="attrEntry" items="${tagAttrs}">

error is: isValid()==false
what is this, i have never this type of error.

and i remove this from <select , it is working fine but in this select tag it is giving this error
 
 
subject: could not understand an example in head first servlet (dynamic attribute in tag file)