• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 216
  • Last Modified:

Help me!

I have a class ListBean. Include getMusic() method: get a field in DB:
public Vector getMusic() throws ModuleException
        Vector albums = new Vector();
        Connection con = null;
        Statement stmt = null;
        ResultSet rs = null;
        String sQuery = "";
      con = dataSource.getConnection();  
              //Thuc hien truy van du lieu
              stmt = con.createStatement();
      sQuery = "SELECT a FROM HE";
      rs = stmt.executeQuery(sQuery);
      while (rs.next())
            TourDTO tD=new TourDTO();                        
      catch (SQLException se)
        log.error("Error in retreiving albums.");
        log.error("SQL statement = " + sQuery);
        ModuleException me = new ModuleException("error.db.sql");
       throw me;
I want fill data into combox box over getMusic() method. Following code here:
ListBean lB=new ListBean(getDataSource(request, "HE"));
               Vector someBean= lB.getMusic();
               request.setAttribute("someBean", someBean);
      return mapping.findForward("list");
/*******Code into JSP page*****/
<logic:present name="someBean">
      <html:select property="someBean">
            <html:options collection="someBean" property="value" labelProperty="label"/>
When enter URL: "http://localhost:8080/Loginc/list.do" appear a error: "No getter method available for property value for bean under name someBean"
Althought I am declaring someBean property in ListForm class. I don't know why have this error. Everybody help me, please!Thanks very much.

1 Solution
Use the attribute "name" if you want to refer the bean in store request/session.
      <html:select property="someBean1">
           <logic:present name="someBean">
                <html:options name="someBean"/>

Use attribute "property" if the collection declare in the formbean - ListForm
      <html:select property="someBean1">
            <html:options property="someBean"/>

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now