File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes javax.servlet.jsp.JspException: No getter method available for property label for bean undername Sc1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "javax.servlet.jsp.JspException: No getter method available for property label for bean undername Sc1" Watch "javax.servlet.jsp.JspException: No getter method available for property label for bean undername Sc1" New topic
Author

javax.servlet.jsp.JspException: No getter method available for property label for bean undername Sc1

Eshwin Sukhdeve
Ranch Hand

Joined: Mar 15, 2012
Posts: 79
Hi,
I am getting the above Exception.I have checked in coderanch but I didn't get the solution.(Sc1 is value which I am adding in ArrayList)
JSP Page

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html>
<head>
<script type="text/javascript">

function populateValue()
{
document.forms[0].action = "opsPath.do?method=getDropDownValue";
document.forms[0].submit();
}

function submitForm()
{
document.forms[0].action = "opsPath.do?method=authWorkFlow";
document.forms[0].submit();
}

</script>
</head>
<body onload="populateValue()">
<html:form action="/opsPath">
<table width=100%>
<tr>
<td align="right">
Select Script
</td>
<td align="left">
<html:select property="select1" size="">
<htmlptionsCollection name="OpsForm" property="scriptlist"/>

</html:select>
</td>
<tr>
<td align="right">
Enter argumnets
</td>
<td align="left">
<html:text property="text1"></html:text>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<html:submit value="Submit" onclick="submitForm()"/>
</td>
</tr>
<tr align="center">
<td>
High Level Log details
</td>
<td>
Low Level Log Details
</td>
</tr>
<tr align="center">
<td>
<html:textarea property="highLog" value="">
</html:textarea>
</td>
<td>
<html:textarea property="lowLog" value="">
</html:textarea>
</td>
</tr>
</table>
</html:form>
</body>
</html>



Struts-config.xml


<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
"http://struts.apache.org/dtds/struts-config_1_3.dtd">

<struts-config>
<form-beans>
<form-bean name="OpsForm" type="org.apache.struts.action.DynaActionForm">
<form-property name="select1" type="java.lang.String" />
<form-property name="text1" type="java.lang.String" />
<form-property name="highLog" type="java.lang.String"/>
<form-property name="lowLog" type="java.lang.String"/>
<form-property name="scriptlist" type="java.util.ArrayList"/>

</form-bean>
</form-beans>



<global-forwards>

<forward name="opsPath" path="/opsPath.do"/>
</global-forwards>

<action-mappings>
<action path="/opsPath" type="com.verizon.uis.TestAction" name="OpsForm" parameter="method" scope="request">
<forward name="success1" path="/Ops.jsp" />
<forward name="success2" path="/Ops.jsp" />
<forward name="success3" path="/Ops.jsp" />
<forward name="success4" path="/Ops.jsp" />


</action>
</action-mappings>
</struts-config>

Action class


package com.verizon.uis;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.DynaActionForm;
import org.apache.struts.actions.DispatchAction;

public class TestAction extends DispatchAction {

public ActionForward authWorkFlow(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {

return mapping.findForward("success1");

}

public ActionForward GenWorkFlow(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {

return mapping.findForward("success2");

}

public ActionForward testFlow(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {

return mapping.findForward("success3");
}

public ActionForward getDropDownValue(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
{

DynaActionForm dy=(DynaActionForm)form;
ArrayList list=new ArrayList();
list.add("Sc1");
list.add("Sc2");
System.out.print("hi--------------------------------------------");
dy.set("scriptlist",list);
// request.setAttribute("scriptList",list);
return mapping.findForward("success4");
}

}
jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 296

Hi Eshwin,

It seems the tag you have used htmloptionscollection is not proper as there should be lable attribute .
Good Explanation is given here http://www.coderanch.com/t/52918/Struts/html-select-html-options
Another recent post is http://www.coderanch.com/t/589313/Struts/HashMap-Display-Default-value

Try using:

<s:select list="searchEngine" name="" value="" />

Regards
jatan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: javax.servlet.jsp.JspException: No getter method available for property label for bean undername Sc1
 
Similar Threads
Problem in SessionManagement in Struts
Map the action form object
ServletException in:/pages/logon.jsp] Cannot retrieve definition for form bean null'
how do i use html:select to forward to different pages?
DispatchAction problem