Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
JSP - A mailing list about Java Server Pages specification and reference
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Subject: Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Subject: Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
running! a servlet at tomcat startup

running! a servlet at tomcat startup

2007-11-05       - By Johnny Kewl

 Back
Reply:     1     2     3     4     5     6     7     8     9     10     >>  


-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
HARBOR: http://coolharbor.100free.com/index.htm
Now Tomcat is also a cool pojo application server
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
-- -- Original Message -- --
From: "Grzegorz Borkowski" <grzegorzborkowski@(protected)>
To: "Tomcat Users List" <users@(protected)>
Sent: Monday, November 05, 2007 12:52 PM
Subject: Re: running! a servlet at tomcat startup


>
>
> Johnny Kewl wrote:
>>
>> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
>>
>> HARBOR: http://coolharbor.100free.com/index.htm
>> Now Tomcat is also a cool pojo application server
>> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
>>
>> -- -- Original Message -- -- From: "Johnny Kewl" <john@(protected)>
>> To: "Tomcat Users List" <users@(protected)>
>> Sent: Monday, November 05, 2007 12:18 PM
>> Subject: Re: running! a servlet at tomcat startup
>>
>>
>>>
>>> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
>>>
>>> HARBOR: http://coolharbor.100free.com/index.htm
>>> Now Tomcat is also a cool pojo application server
>>> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
>>>
>>> -- -- Original Message -- -- From: "loredana loredana"
>>> <loredana888888@(protected)>
>>> To: "Tomcat Users List" <users@(protected)>
>>> Sent: Monday, November 05, 2007 11:48 AM
>>> Subject: Re: running! a servlet at tomcat startup
>>>
>>>
>>> thanks for the response johnny. That's probably the only way it can be
>>> done.. Unfortunatelly for me, I need variables like
>>> request.getContextPath() and from init() method i can't "retrieve" those
>>> values. 10x a lot anyway.
>>> ===================================
>>> Ah, I see now...
>>> Yes parsing context.xml is too much hassle..
>>>
>>> Heres an idea...
>>> When someone drops a WAR in, the context always takes on the webapp
>>> name.
>>> ie for most apps... webapp name = context
>>> So try this...
>>>        ServletContext context = getServletContext();
>>>        String sWebBase = context.getRealPath("/");
>>
>> MEL just told me that    context.getServletContextName()
>>
>> is easier ;)
>
> Be careful! AFAIK, getServletContextName() returns "display-name" value,
> not real context name - please check API!
Thanks.... MEL is blushing ;)

Yes and the way I suggested will give you an extra context/build/web
in the dev environment... so parsing gets a little tricky... unless of
course all you really looking for in the web base folder.

OK, now I'm officially wondering... if one cant get at Request... is there a
better way
to find the name of the web-app/context?


>>>
>>> Than last folder is the context name...
>>> Some String parsing and you got it ;)
>>>
>>> Good luck
>>>
>>> ===================================
>>>
>>>
>>>
>>> -- -- Original Message ----
>>> From: Johnny Kewl <john@(protected)>
>>> To: Tomcat Users List <users@(protected)>
>>> Sent: Monday, November 5, 2007 10:58:54 AM
>>> Subject: Re: running! a servlet at tomcat startup
>>>
>>>
>>>
>>> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
>>>
>>> HARBOR: http://coolharbor.100free.com/index.htm
>>> Now Tomcat is also a cool pojo application server
>>> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
>>>
>>> -- -- Original Message -- -- From: "loredana loredana"
>>> <loredana888888@(protected)>
>>> To: <users@(protected)>
>>> Sent: Monday, November 05, 2007 10:32 AM
>>> Subject: running! a servlet at tomcat startup
>>>
>>>
>>> This issue is a classic one already I think. I've googled it and
>>> haven't
>>> found anything that could help solving this problem. I'm probably not
>>> the
>>> one to think about this but...if you would add the
>>> <load-on-startup>1</load-on-startup> to a servlet, and from the init()
>>> method you would somehow try to call the doGet() method, wouldn't that
>>> do
>>> it? wouldn't that run the servlet at startup?  did anybody try this
>>> already?
>>> I am trying to do this but I'm having some problem creating
>>> HttpServletRequest and Response objects so I can call doGet(). So if
>>> anyone
>>> did this already, pls let me know how this issue can be fixed! 10x a
>>> lot!
>>> =======================
>>> Hi  loredana,
>>> Not sure if you asking or answering ;)
>>>
>>> Yes, <load-on-startup> and then do stuff in the INIT method.
>>> No, why try call doGet().... just init the functions that need initing,
>>> like
>>> the dBPool, or image processing.
>>> The doGet implies you want to return info to a browser.... there isnt
>>> one?
>>> The Init method runs just once.... thats the idea.
>>> <load-on-startup> just lets you get the INIT out of the way, otherwise
>>> it
>>> will happen on the first browser request, and if it takes a long time
>>> the
>>> browser will seem very slow to the user... but that only happens once
>>> anyway.
>>> ????????
>>> ========================
>>>
>>>
>>>
>>> __ ____ ____ ____ ____ ____ ____ ____ ____ ____ __
>>> Do You Yahoo!?
>>> Tired of spam?  Yahoo! Mail has the best spam protection around
>>> http://mail.yahoo.com
>>>
>>>
>>> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
>>> To start a new topic, e-mail: users@(protected)
>>> To unsubscribe, e-mail: users-unsubscribe@(protected)
>>> For additional commands, e-mail: users-help@(protected)
>>>
>>>
>>>
>>> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
>>> To start a new topic, e-mail: users@(protected)
>>> To unsubscribe, e-mail: users-unsubscribe@(protected)
>>> For additional commands, e-mail: users-help@(protected)
>>>
>>>
>>>
>>>
>>>
>>> __ ____ ____ ____ ____ ____ ____ ____ ____ ____ __
>>> Do You Yahoo!?
>>> Tired of spam?  Yahoo! Mail has the best spam protection around
>>> http://mail.yahoo.com
>>>
>>>
>>> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
>>> To start a new topic, e-mail: users@(protected)
>>> To unsubscribe, e-mail: users-unsubscribe@(protected)
>>> For additional commands, e-mail: users-help@(protected)
>>>
>>>
>>>
>>> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
>>> To start a new topic, e-mail: users@(protected)
>>> To unsubscribe, e-mail: users-unsubscribe@(protected)
>>> For additional commands, e-mail: users-help@(protected)
>>>
>>>
>>
>>
>> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
>> To start a new topic, e-mail: users@(protected)
>> To unsubscribe, e-mail: users-unsubscribe@(protected)
>> For additional commands, e-mail: users-help@(protected)
>>
>>
>
>
> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
> To start a new topic, e-mail: users@(protected)
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
>


-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To start a new topic, e-mail: users@(protected)
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)


©2008 junlu.com - Jax Systems, LLC, U.S.A.