I use a bean in a jsp file.
The following is the jsp file:
  <html>
  <head>
  <title>Bean Data Display</title>
  </head>
  <%@ page import = "test.DataBean" %>
  <jsp:useBean id="dataBean" class="test.DataBean"    scope="session"
/>
  <body>
  <% dataBean.doQuery(); %>
  <%= dataBean.getProp1() %>
  <%= dataBean.getProp2() %>
  </body>
  </html>

The following is the Bean file:
  package test;

  public class DataBean
  {

   String prop1;
   String prop2;

   public DataBean() {}

   public String getProp1() {return prop1;}
   public String getProp2() {return prop;}

   public void setProp1(String value) {prop1 = value;}
   public void setProp2(String value) {prop2=value;}

   public void doQuery(){
      setProp1("ok1");
      setProp2("ok2");
  }
 }


The following is the error:

  java.lang.NoSuchMethodError: test.DataBean: method doQuery()V not
found
        at
pagecompile.jsp._DisplayData._jspService(_DisplayData.java:94)
        at
com.sun.server.http.pagecompile.jsp.runtime.HttpJspBase.service(Compiled
Code)
        at javax.servlet.http.HttpServlet.service(Compiled Code)
        at
com.sun.server.http.pagecompile.jsp.runtime.JspServlet.runServlet(Compiled
Code)
        at
com.sun.server.http.pagecompile.jsp.runtime.JspServlet.processJspPage(Compiled
Code)
        at
com.sun.server.http.pagecompile.jsp.runtime.JspServlet.service(Compiled
Code)
        at javax.servlet.http.HttpServlet.service(Compiled Code)
        at com.sun.server.ServletState.callService(Compiled Code)
        at com.sun.server.ServletManager.callServletService(Compiled
Code)
        at com.sun.server.ProcessingState.invokeTargetServlet(Compiled
Code)
        at com.sun.server.http.HttpProcessingState.execute(Compiled
Code)
        at com.sun.server.http.stages.Runner.process(Compiled Code)
        at com.sun.server.ProcessingSupport.process(Compiled Code)
        at com.sun.server.Service.process(Compiled Code)
        at
com.sun.server.http.HttpServiceHandler.handleRequest(Compiled Code)
        at
com.sun.server.http.HttpServiceHandler.handleRequest(Compiled Code)
        at com.sun.server.HandlerThread.run(Compiled Code)


What's the matter?

Thanks in advance!
__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to