Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<%@ 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="" prefix="c" %>
<select name='${name}'
<c:forEach var="attrEntry" items="${tagAttrs}">

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

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
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!