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 Struts and the fly likes HTML:OPTIONS 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 » Frameworks » Struts
Bookmark "HTML:OPTIONS " Watch "HTML:OPTIONS " New topic
Author

HTML:OPTIONS

venkateshwara vellellacheruvu
Greenhorn

Joined: Jul 10, 2005
Posts: 1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>


<head><title>PRODUCTS AVAILABLE FOR THE SHOPING</title></head>
<body>

<html:errors/>

<logic resent name="PRODUCTFORM" property="results"/>

<hr width="100%" size="1">

<bean:size id="size" name="PRODUCTFORM" property="results"/>
<logic:equal name="size" value="0">
<center><font color="red"><b>No Employees Found</b></font></center>
</logic:equal>



<table>
<logic:iterate id="mapID" name="PRODUCTFORM" property="results" >
<tr>
<td>
<html:radio property="results" value='<bean:write name="mapID" property="PRODUCTID"/>' />
<bean:write name="mapID" property="PRODUCTDESCRIPTION"/>
</td>
<tr>
</logic:iterate>
</table>


</logic resent>

<logic:greaterThan name="size" value="0"/>
<table border="1">
<tr>
<th>PRODUCTID</th>
<th>PRODUCTDESCRIPTION</th>
<th>PRICE</th>
<th>QOH</th>
<th>ROL</th>
<th>UNITS</th>
</tr>



</table>
</logic:greaterThan>
</body>
</html>




I got this error?

[Servlet Error]-[Cannot find bean under name org.apache.struts.taglib.html.BEAN]: javax.servlet.jsp.JspException: Cannot find bean under name org.apache.struts.taglib.html.BEAN


Please provde me with the answer[EMAIL][/EMAIL]
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1016
In order to use any of the html:input fields, you need to nest them in an html:form tag.

So put an html:form tag around your code, and see if it works.

Cheers,
evnafets
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1016


Taking a closer look, there are other things wrong with this code.
1 - you can't have custom tags as attributes to other custom tags - so the bean:write for the value attribute will create an error
2 - The property for your iterate tag is results. So is the property for your html:radio. What do you want "results" to be? A List or a specific item in the list?
I think you need two attributes here - one being the list, another representing the item you select.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTML:OPTIONS
 
Similar Threads
Missing message for key
doubt in Struts application
html:text within Logic:iterate
JspTranslate: End of content reached while more parsing required: tag nesting error?.
server encountered an internal error ;while running application