Shrisha Radhakrishna wrote:
>
> Hi All,
>     I have a very strange/painful problem.  Ok, here I go.  I use Weblogic
> 4.5.1 to host my JSPs.  The compiler adds a "package jsp_servlet;" to all my
> JSP's when they are converted into servlets.  So, in other words all my JSPs
> are in jsp_servlet package.  Now, I want to instantiate a user-defined
> class, say x, (that is not in ANY package) from within my servlet.  So, a
> statement in my JSP would be something like:
>
> x temp=new x();
>
> The compiler throws a error that says jsp_servlet.x not found in import.
> Obviously, its looking for x within the jsp_servlet package.  How do I
> access the default package from within my servlet?

This is the way Java works when you use a class in the unnamed package
in another class in a named package. To solve it you must use an import
statement for the class in the unnamed package, i.e.

  <%@ page import="x" %>

Hans
--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.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

Reply via email to