试试这样
<jsp:useBean id="testb" class="test.testbean"/>
<% out.println(testb.gettest());%>

解决方案 »

  1.   

    Hello Brother:
    This is javabean property basic rule.such as:
    bean:
    public class testbean
    {
      public String ttt="This is a test.";
      public String gettext() => The text is property name
      {
        return ttt;
      }
      public String gettext() => The text is property name
      {
        return ttt;
      }
    }*.jsp
    <jsp:getProperty name="testb" property="text"/>
    or <jsp:getProperty name="testb" property="text"/>
    property name must the same as settext() => text is the property name
    or property name must the same as gettext() => text is the property name
    if this bean's fisrt alphabet change setText() or getText() into Upper
    ignore Upper case always use lower case with property.
    whatever, jsp peoperty name the same as bean property name, but jsp's property name first alphabet always Upper case.
      

  2.   

    Modify above:
    Hello Brother:
    This is javabean property basic rule.such as:
    bean:
    public class testbean
    {
      public String ttt="This is a test.";
      public String gettext() => The text is property name
      {
        return ttt;
      }
      public String gettext() => The text is property name
      {
        return ttt;
      }
    }*.jsp
    <jsp:getProperty name="testb" property="text"/>
    or <jsp:getProperty name="testb" property="text"/>
    property name must the same as settext() => text is the property name
    or property name must the same as gettext() => text is the property name
    if this bean's fisrt alphabet change setText() or getText() into Upper
    ignore Upper case always use lower case with property.
    whatever, jsp peoperty name the same as bean property name, but jsp's property name first alphabet always lower case.
      

  3.   

    多谢sparkwu(吳府明)
    问题已经解决。