tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William Kaufman <WKauf...@viquity.com>
Subject RE: How can I make tomcat to instantiate a class
Date Thu, 14 Jun 2001 20:05:03 GMT
Dunno about JSPs, but for servlets, add a <load-on-startup> element to your
servlet's web.xml file.  Look at the servlet spec for more info.

                                        -- Bill K. 

-----Original Message-----
From: Debashis Ghosh [mailto:debashis@ibusinesshub.com]
Sent: Thursday, June 14, 2001 11:30 AM
To: tomcat-user@jakarta.apache.org
Subject: Re: How can I make tomcat to instantiate a class


Hi Luba,
Thanks for this . But actually my problem was to instantiate a class when 
tomcat boots up...so that i can use that object across sessions.Can u
suggest 
something towarsd this.
Thanks
debashis
On Thursday 14 June 2001 08:18 am, you wrote:
> JSP will do it for you.  Example:
>
> <html>
> <body>
>
> <%@ page language="java" %>
> <%@ page import="javabean.Counter" %>
>
> <!-- page, request, session, application  -->
>
> <jsp:useBean id="counter" scope="page" class="javabean.Counter" />
>
> <%
>  out.println("Count from scriplet = " + counter.getCount());
> %>
>
> <br>
>
> Count from jsp:getProperty=
>  <jsp:getProperty name="counter" property="count" />
>
> </body>
> </html>
>
>
> ----- Original Message -----
> From: "Debashis Ghosh" <debashis@ibusinesshub.com>
> To: <tomcat-user@jakarta.apache.org>
> Sent: Wednesday, June 13, 2001 9:57 PM
> Subject: How can I make tomcat to instantiate a class
>
> > Hi,
> > Can anyone suggest How can I make tomcat to instantiate a class so that
i
>
> can
>
> > access it from my
> > jsp or servlet as an application level variable.Basically i want to
> > instatiate one connection pool class so
> > that i can access it from my servlet to get an connection object out of
>
> it.
>
> > On Wednesday 13 June 2001 06:47 pm, you wrote:
> > > Below is good advice. If the login page does not
> > > come up (btw, what happens does it just take you
> > > direct to the protected resource?) the first place I would
> > > look is the tomcat config files. So basically I would
> > > double-check server.xml and the web-xml for your app.
> > > If you are sure they are correct and you still have a problem
> > > you might want to try posting the relevant sections to the list.
> > >
> > > If you do get JDBCRealm working with tomcat standalone then
> > > to integrate with apache you need to add
> > >
> > > JkMount /examples/jsp/security/login/j_security_check ajp13
> > > (or ajp12 if using mod_jserv) to httpd.conf to tell apache
> > > to delegate the handling of this bit of magic to tomcat.
> > >
> > > andrew
> > >
> > > On Wed, 13 Jun 2001, you wrote:
> > > > > Mark, I appreciate your help.   I have tried
> > > > > to adapt the examples and I believe I have everything
> > > > > in place.  However, apache just wont bring the login
> > > > > form when I try to access a protected resource.
> > > > > Would you have any idea where to look at for this problem?
> > > >
> > > > You might want to check and see if you can get a
> > > > JDBCRealm to work with tomcat standalone(i.e. accessing
> > > > you site as http://localhost:8080/... directly).
> > > > If this doesn't work get this working first and
> > > > that's a good place to start from.  Once you have
> > > > JDBCRealm working correctly then you can deal with
> > > > making sure it works when passed through apache.
> > > >
> > > >
> > > > ---
> > > > Michael Wentzel
> > > > Software Developer
> > > > Software As We Think - http://www.aswethink.com

Mime
View raw message