• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

HTML:OPTIONS

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<!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]
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1845
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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.

 
Don't count your weasels before they've popped. And now for a mulberry bush related tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!