Can some one can get out off me from this error which i'm gettin' when i am tryin' to add new method to a bean after one successful execution.

The error i am gettin' is...
com.sun.jsp.JspException: getProperty(beanname): cant find method to read{1} at com.sun,jsp.compiler....
sample...

Let me explain in better way with example...

Test.jsp
-------

<jsp:useBean id="testbean" scope="session" class="test2.testBean"/>
<jsp:setProperty name="testbean" property="*"/>

<form method="get">

  <input type=text name="test"><br>
  <input type=text name="test1"><br>
  <input type=text name="test2"><br>

  <input type=submit value="Submit">
  <input type=reset value="Reset">
</form>

<% if (request.getParameter("test")!=null) {%>
Output : <br>
         First Field is  <jsp:getProperty name ="testbean" property="test"/><br>
         Second Field is <jsp:getProperty name ="testbean" property="test1"/><br>
         Third Field is  <jsp:getProperty name ="testbean" property="test2"/>
<%}%>
 

TestBean.
----------
 
package test2;

import java.util.*;

public class testBean
{
   String test;
   String test1;
   String test2;

   public testBean()
   {
     test=null;
     test1=null;
     test2=null;
   }

   public void setTest(String name)
   {
      test=name;
      System.out.println(" Output of setTest " +test);
   }

   public String getTest()
   {
      return test;
   }

   public void setTest1(String name)
   {
      test1=name;
      System.out.println("  Output of setTest 1" +test1);
   }

   public String getTest1()
   {
      return test1;
   }

   public void setTest2(String name)
   {
      test2=name;
      System.out.println("  Output of setTest 2" +test2);
   }
   public String getTest2()
   {
      return test2;
   }
}

This program was workin' ok with setTest, getTest, setTest1 and getTest1, but  this is started givin' problems after i added  setTest2 and getTest2...

Can some one can advice me the changes to be done to access the new properties test2 form the browser.

Thanks in advance.
-Suresh.
 

Reply via email to