try:

package myPackage;
import java.beans.*;
import java.io.*;

public class Test implements java.io.Serializable
{
        private String testquery="";

        public Test()
        {
                System.out.println("Hello World");
        }

        public void queryset(String query)
        {
                testquery=query;
        }
}


In JSP file:

<%@ page import="myPackage.Test" %>
<jsp:useBean class="myPackage.Test" id="testing" scope="session"/>
<%
        String query1="select name from usermaster";
        testing.queryset(query1);
        out.println("query has been set");
%>

-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Muhammad Asim Ajmal
Sent: Tuesday, September 26, 2000 12:49 PM
To: [EMAIL PROTECTED]
Subject: Re: Java Bean's in JSP


I m also facing same probelm,,, plzz help both of us

regards
asim
----- Original Message -----
From: Pranav Bansal <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 25, 2000 5:58 PM
Subject: Java Bean's in JSP


> Hi all,
>           I am using a very simple bean in a jsp page. The bean source is
as
> follows......
>          import java.io.*;
>         public class Test
>       {
>        private String testquery="";
>         public Test()
>             {
>                    System.out.println("Hello World");
>              }
>          public void queryset(String query)
>          {
>                  testquery=query;
>           }
>       }
>
> The jsp file In which I am using this bean as follows........
>    <%@ page info="testing" import="java.io.*" %>
>    <jsp:useBean class="Test" id="testing" scope="session"/>
>     <%
>            String query1="select name from usermaster";
>            testing.queryset(query1);
>            out.println("query has been set");
>      %>
>
> But this gives an error that method queryset(java.lang.String) is not
found.
> Please tell me that why this happening?
> With Regards,
>
> Pranav Kumar
> Software Engineer
> Informica India Pvt. ltd.
> Noida,India
> Phone: -91-118-4514702
> www.informica.com
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to