2009/11/24 Gintare Ragaisiene <[email protected]>
> Hi,
>
> I need to initialize a servlet like
>
> public class TestServlet extends HttpServlet{
>
> @Override
> public void init(ServletConfig config) throws ServletException {
> super.init(config);
>
> System.out.println("TestServlet");
> }
>
> }
>
> on cocoon 2.2 startup.
>
> Some servlets is set up in cocoon_home/target/rct/webapp/WEB-INF/web.xml.
> If I edit that web.xml to add servlet, after server restart input disappear.
>
>
I *think* that you need to make your servlet into a Spring bean. If you add
to your existing META-INF/cocoon/spring/servlet-service-framework.xml file:
<bean name="myservlet" class="com.example.MyServlet">
<servlet:context mount-path="/myBlock1"
context-path="blockcontext:/myBlock1/"/>
</bean>
It may work. I'm not too familiar with the servlet service framework, and I
haven't tested this. :-(
-Dom