Ed Park wrote:
>
> I have made a custom class of my own, let's call it
> MyClass. When I try to forward it to a jsp page from
> my servlet (called TestServlet) with the following
> invocation:
>
> MyClass sendClass = new MyClass();
>
> request.setAttribute("myclass", MyClass);
>
>getServletConfig().getServletContext().getRequestDispatcher("/test.jsp").forward(request,
> response);
>
> I get this exception thrown:
> java.lang.IllegalAccessError: try to access class
> MyClass from class TestServlet
>
> What the heck's going on??
Most likely you have not declared your class as public, or do not have a
public constructor:
public class MyClass {
public MyClass() {
...
}
...
}
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