You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mikael Aronsson <mi...@telia.com> on 2003/12/19 13:11:27 UTC

Stupid servlet question...

Hi !

I have an application scope servlet and it works fine, but I would like to
run it all the time as soon as tomcat starts, not just after the first use,
is this possible ?

Mikael


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Stupid servlet question...

Posted by Antony Paul <an...@hotmail.com>.
What is an application scope servlet ?.
You can ask the container to initialize a servlet at container start up by
setting the <load-on-startup>  parameter to 1 in web.xml. like this.
<servlet>
<servlet-name>action</servlet-name>
 <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

Antony Paul

----- Original Message -----
From: "Mikael Aronsson" <mi...@telia.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Friday, December 19, 2003 5:41 PM
Subject: Stupid servlet question...


> Hi !
>
> I have an application scope servlet and it works fine, but I would like to
> run it all the time as soon as tomcat starts, not just after the first
use,
> is this possible ?
>
> Mikael
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Stupid servlet question...

Posted by Ben Souther <bp...@adelphia.net>.
Add that to your servlet node in web.xml




<load-on-startup>1</load-on-startup>




On Friday 19 December 2003 07:11 am, you wrote:
> Hi !
>
> I have an application scope servlet and it works fine, but I would like to
> run it all the time as soon as tomcat starts, not just after the first use,
> is this possible ?
>
> Mikael
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org