Hello,
I have this simple jsp using the bean (example of a FAQ system), everything works
fine except I can not extract out the property of the bean. Below is my jsp
page. The println statement ("ID number :") shows that I had all the correct
values, however, getProperty() does not return the correct ID and its "question"
property. So the output of this page shows only a list of radio buttons with the
value of zero associated with each button. I would like to see each radio button
has an ID number and its corresponding question (those are properties of a faq
bean). Please tell me what I did wrong. Thanks so much.
TN
<%@ page import="com.taglib.wdjsp.faqtool.*"^M
errorPage="error.jsp" %>^M
<jsp:useBean id="faq" class="com.taglib.wdjsp.faqtool.FaqBean"/>^M
<%^M
FaqBean[] faqs = (FaqBean[])request.getAttribute("faqs");^M
%>^M
<html>^M
<head><title>Update Menu</title></head>^M
<form name="menu" action="/faqtool" method="post">^M
<table border="1" align="center"><tr><td>^M
<table bgcolor="tan" border="1" align="center" cellpadding="10" cellspacing="0">^M
<tr><th colspan="2">FAQ Administration: Update Menu</th></tr>^M
<%^M
for (int i=0; i < faqs.length; i++) {^M
faq = faqs[i];^M
out.println("ID number : " + faq.getID());
%>^M
<tr>^M
<td><input type="radio" name="id"^M
value="<jsp:getProperty name="faq" property="ID"/>">^M
<jsp:getProperty name="faq" property="ID"/></td>^M
<td><jsp:getProperty name="faq" property="question"/></td>^M
</tr>^M
<% } %>^M
<tr><td colspan=2 align="center">^M
<input type="submit" value="Abort Updating">^M
<input type="submit" value="Update Selected FAQ"
onClick="document.menu.cmd.value='update'">^M
</td></tr>^M
</table>^M
</td></tr></table>^M
<input type="hidden" name="cmd" value="abort">^M
</form>^M
</html>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets