Options - No getter method available?!
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Michael_Decker
Posted On:   Thursday, September 30, 2004 07:27 AM

Hi! I've read that FAQ: tag help Hi, I get a result set from a query which has id and description, now I have to show the it in select tag some thing like this, desc1 desc2 I think that i can use tag which will do my work, but i m not sure how to use it, how do to define the bean, and also how to set the properties, does anyone have sample code of the bean and the tag for that bean, it will help me alot.. Thanx Ashish And use org.apache.struts.util.LabelValueBean ... If I use this code: <%@ page import = "java.util.*,org.apache.struts.util.LabelValueBean" %> <% LabelValueBean[] c   More>>

Hi!


I've read that FAQ: tag help Hi,
I get a result set from a query which has id and description, now I have to show the it in select tag some thing like this, I think that i can use tag which will do my work, but i m not sure how to use it, how do to define the bean, and also how to set the properties, does anyone have sample code of the bean and the tag for that bean, it will help me alot..
Thanx
Ashish


And use org.apache.struts.util.LabelValueBean ...

If I use this code:

			<%@ page import = "java.util.*,org.apache.struts.util.LabelValueBean" %>
			
<%
LabelValueBean[] col= new LabelValueBean[2];

col[0] = new LabelValueBean("GIF", "gif");
col[1] = new LabelValueBean("JPEG", "jpg");

request.setAttribute("myCol",col);

%>
..............................
			




I get this error message:"[ServletException in:../common/body_search_image.jsp] No getter method available for property value for bean under name myCol' "

What kind of fault I've done?

   <<Less

Re: Options - No getter method available?!

Posted By:   Michael_Decker  
Posted On:   Friday, October 1, 2004 01:28 AM

So I've test this


<%
//LabelValueBean col= new LabelValueBean("GIF","gifs");
LabelValueBean[] col= new LabelValueBean[2];
col[0] = new LabelValueBean("GIF", "gif");
col[1] = new LabelValueBean("JPEG", "jpg");

//Collection col = new ArrayList();
// ArrayList col = new ArrayList();

// col.add(new LabelValueBean("GIF", "gif"));
// col.add(new LabelValueBean("JPEG", "jpg"));

request.setAttribute("myCol",col);

%>
.........................
<%-- html:select property="imageType" --%>





<%--

--%>
<%-- /html:select --%>


That works... Without any problem, but why

bean:options
tells me, that there is no Getter?!
About | Sitemap | Contact