This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) 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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply locked 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
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60765
    
  65

Please do not post the same question more than once.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
wood burning stoves
 
subject: could not understand an example in head first servlet (dynamic attribute in tag file)
 
Similar Threads
Java Simple Tag Handler
Dynamic attribute in Tag File
dynamic list - javax.el.PropertyNotFoundException
Doubt in JSP Custom tags (Simple Tag) in Dynamic Drop Down
could not understand an example in head first servlet (dynamic attribute in tag file)