File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "HTML:OPTIONS " Watch "HTML:OPTIONS " New topic


venkateshwara vellellacheruvu

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>


<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:iterate id="mapID" name="PRODUCTFORM" property="results" >
<html:radio property="results" value='<bean:write name="mapID" property="PRODUCTID"/>' />
<bean:write name="mapID" property="PRODUCTDESCRIPTION"/>

</logic resent>

<logic:greaterThan name="size" value="0"/>
<table border="1">


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

Joined: Jul 06, 2005
Posts: 1518
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.

Stefan Evans

Joined: Jul 06, 2005
Posts: 1518

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:
It's not a secret anymore!