You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Juan Carlos Fernández Galante <ju...@upcnet.es> on 2001/11/26 17:56:04 UTC
You can help me ....
Hi,
I want to load a jsp file on a org.apache.catalina.core.StandardWrapper (of
Catalina API), but this fragment of code not make it, Can someone Help me?
StandardWrapper theStandardWrapper = new StandardWrapper();
theStandardWrapper.setJspFile("file://C:/proyectos/varios/jasper/bak/hello.j
sp");
theStandardWrapper.setServletName("hello.jsp");
theStandardWrapper.setServletClass("jsp.hello");
StandardContext theStandardContext = new StandardContext();
theStandardContext.addChild(theStandardWrapper);
theStandardWrapper.setParent(theStandardContext);
try
{
//Sets the loader
WebappLoader theWebappLoader = new WebappLoader();
theStandardWrapper.setLoader(theWebappLoader);
Servlet theServlet = theStandardWrapper.allocate();
}catch (Exception e)
{
e.printStackTrace();
}
}
The exception throws is :
--------------------------------------------------------
javax.servlet.ServletException: Servlet.init() for servlet hello.jsp threw
exception
void org.apache.catalina.core.StandardWrapper.load()
StandardWrapper.java:871
javax.servlet.Servlet org.apache.catalina.core.StandardWrapper.allocate()
StandardWrapper.java:615
void jsp.Prueba1.<init>()
Prueba1.java:39
void jsp.Prueba1.main(java.lang.String[])
Prueba1.java:73
----------------------------------------------------------------------------
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>