hi vishwa,

It is better to have(not  mandatory) a pakage scope and import the package
into the Jsp file.Make sure the package is in the classpath.

Hope it helps,

with regards,
          rathna.


Vishwa wrote:

> Hi Rathinavel,
>
>   The class is not in any package as such. I have copied the class file
> on to the public_html folder. Should I put the DataManager class in a
> package and import it ?.
>
> Thanks
> vishwa
>
> Rathinavel P wrote:
> >
> > Sorry! just the basic question, have you imported the DataManager class ??
> >
> > with regards,
> >          rathna.
> >
> > Vishwa wrote:
> >
> > > Hello all,
> > >
> > > I am new to JSP, but have been working with servlets. I am trying to
> > > instantiate an object in my jsp page. But I get a page compilation
> > > error,
> > >
> > > code:
> > >
> > > <%@page info="General query jsp"%>
> > > <html>
> > > <body>
> > > <%!     private DataManager dbManager;
> > >         public void init() {
> > >                 dbManager = new DataManager("newTTSource",null,null);
> > >         }
> > > %>
> > > <%=request.getParameter("query")%>
> > > <form name='testForm' action='/query.jsp' method='get'>
> > > <input type=text name='query' size=50></input>
> > > <input type=submit>
> > > </form>
> > > </body>
> > > </html>
> > >
> > > error:
> > >
> > > Error during compilation :
> > >
> > > C:\JavaWebServer2.0\tmpdir\default\pagecompile\jsp\_query.java:25: Class
> > > pagecompile.jsp.DataManager not found in type declaration.
> > >                 private DataManager dbManager;
> > >                                              ^
> > > C:\JavaWebServer2.0\tmpdir\default\pagecompile\jsp\_query.java:27: Class
> > > pagecompile.jsp.DataManager not found in type declaration.
> > >                         dbManager = new
> > > DataManager("newTTSource",null,null);
> > >                                         ^
> > > 2 errors
> > >
> > > regards
> > > vishwa
> > >
> > > ===========================================================================
> > > 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

===========================================================================
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