To start with, the bean you show below would not compile. in the
getProp2 methond, it should return prop2, not prop. But I expect that is
just from hand writing it. If that really is your bean though, it would not
have compiled correctly, so the JSWDK may be using an old version of it.
Also make sure you restart the JSWDK every time you cahnge a bean so it
picks up the new version.
Dave
> -----Original Message-----
> From: yueqiao wang [mailto:[EMAIL PROTECTED]]
> Sent: 16 September 1999 10:37
> To: [EMAIL PROTECTED]
> Subject: help?
>
>
> 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.servic
> e(Compiled
> Code)
> at javax.servlet.http.HttpServlet.service(Compiled Code)
> at
> com.sun.server.http.pagecompile.jsp.runtime.JspServlet.runServ
> let(Compiled
> Code)
> at
> com.sun.server.http.pagecompile.jsp.runtime.JspServlet.process
> JspPage(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!
===========================================================================
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