Which is best practice for stowing objects, request or session context?

2005-06-04 Thread Adrian Beech
Hi all,

A work colleague mentioned on Friday it would be better to place objects
(beans and the like) which had been created in a servlet into the request
context when exposing them to the JSP.  To date all the code I've written
stores beans and the like in the session context and all has appeared to be
fine thus far.  I understand the nature of the various contexts and how they
relate to the process life cycle, etc.

Can someone please shed some light on this and possibly explain the merits
of placing the objects in either context?  For example, what are the
pitfalls of using the request context?  Is there any material around which
adequately details when or when not to use the specific contexts?

Cheers.
AB


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Passing init params to a listener?

2004-03-14 Thread Adrian Beech
G'day all,

Can someone please advise how to pass init params to a listener?  For
example, in my web.xml file I have the following listener currently defined
as:-

  listener
listener-classczone.db.InitConnectionPool/listener-class
  /listener

At the moment all parameters are hard coded in the listener.  If I want to
extend the flexibility of the code by adding init parameters to the listener
definition do I merely do this:-

  listener
listener-classczone.db.InitConnectionPool/listener-class

init-param
  param-namejdbcConnectionString/param-name
  param-value.../param-value
/init-param
  /listener

If this is correct then what Java code is required in the
contextInitialized(...) method to pull the init parameter name and value so
the listener can use it?

I really don't have a clue what I'm doing so some guideance on this matter
would be greatly appreciated!

Thanks if you can help.

AB



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Passing init params to a listener?

2004-03-14 Thread Adrian Beech
G'day,

I assume from this that init parameters can only be accessed by a listener
if they have been declared globally within the applications context and not
from within the scope of the listener itself?  

Hm

AB


-Original Message-
From: Frank Burns [mailto:[EMAIL PROTECTED] 
Sent: Monday, 15 March 2004 12:30 AM
To: Tomcat Users List; [EMAIL PROTECTED]
Subject: Re: Passing init params to a listener?


For each parameter you need your listener to read, place name/value pairs in
your web.xml. Here's an example for two parameters (mySQLServerName and
mySQLPort):

 context-param
  param-name
   mySQLServerName
  /param-name
  param-value
   localhost
  /param-value
 /context-param

 context-param
  param-name
   mySQLPort
  /param-name
  param-value
   3306
  /param-value
 /context-param

Then, in your listener class, read them like this:

String serverName = application.getInitParameter(mySQLServerName);
String mySQLPort = application.getInitParameter(mySQLPort);


- Original Message - 
From: Adrian Beech [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, March 11, 2004 2:07 PM
Subject: Passing init params to a listener?


G'day all,

Can someone please advise how to pass init params to a listener?  For
example, in my web.xml file I have the following listener currently defined
as:-

  listener
listener-classczone.db.InitConnectionPool/listener-class
  /listener

At the moment all parameters are hard coded in the listener.  If I want to
extend the flexibility of the code by adding init parameters to the listener
definition do I merely do this:-

  listener
listener-classczone.db.InitConnectionPool/listener-class

init-param
  param-namejdbcConnectionString/param-name
  param-value.../param-value
/init-param
  /listener

If this is correct then what Java code is required in the
contextInitialized(...) method to pull the init parameter name and value so
the listener can use it?

I really don't have a clue what I'm doing so some guideance on this matter
would be greatly appreciated!

Thanks if you can help.

AB



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Where is the source code that processes the server.xml file?

2004-02-21 Thread Adrian Beech
G'day all,

Can someone please tell me where I might find the Java code in the Tomcat
5.0 source tree which is responsible for processing the server.xml file?
I'm particularly looking for the code that is employed to handle the
resource ... elements in the server.xml file.

I would greatly appreciate any help in finding the code.

Thanks.
AB



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Terminating or suspending an application if a on start up servlet throws an exception?

2004-01-18 Thread Adrian Beech
G'day,

Is it possible to have Tomcat 4.1.x terminate or suspend access to an
application if a servlet which is fired at start up throws an exception?
For example, we have two servlets which are loaded on start up.  The
first one sets up the database connection pool and the second one does
various other application initialisation type actions.  If either one
throws an exception then I'd like the application to be unavailable.

Can this be done?  If so then how?

AB



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Setting up a data source resource reference using a JNDI property file

2003-11-12 Thread Adrian Beech
G'day folks,
 
I was wondering if it is possible to set up a data source resource
reference using a JNDI property file?  If this is possible then does
anyone have a sample sort of file that will show how to set up a
connection pool to an Oracle DB?  
 
I have been successful thus far whilst developing with setting up the
connection pool using the required tags elements in my local dev
server.xml file but... sigh,  alas I do not have access to the
production platforms server.xml file to implement the necessary do
dads... don't ask me why the boffins see fit to restrict this sort of
thing here... it's a damn mystery :(  So I'm sort of hand tied for the
time being until some one here can give me a nod or two in the right
direction!
 
BTW, I am assuming that the JNDI property file can be app independant?
 
Any help in this matter will be greatly appreciated!
 
AB
[EMAIL PROTECTED]
 


Has there been a stable (non beta) rlease of Tomcat 5 yet?

2003-10-29 Thread Adrian Beech
G'day folks,

Well the subject line really says it all!  Just wondering if there has
been a Tomcat 5.0 release yet?  So far I've only spotted 5.0.12 beta
mentioned on the Apache (Jakarta section) web site.

AB



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Blowing away objects that have been stored in the session context

2003-10-05 Thread Adrian Beech
G'day all,

Does Tomcat release all the resources used by an object if the object
has been stored in the session context and a call to
session.removeAttribute(objName) is made?  I'd like to blow away
several beans that are used throughout the processing of a transaction
once the confirmation page is called.

At this stage the only two ways I can think of doing this is to call
session.removeAttribute(...) or retrieve the object from the session
context and then assigning null to it, i.e. myObj = (MyObj)
session.getAttribute(myObjName); myObj = null;.

Can someone please shed some light on what is best?  Or are these two
possible ways totally off the track?

Thanks if you can help.

AB



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat version 3 certificates?

2003-09-19 Thread Adrian Beech
G'day all,

Earlier today we were advised by a bod from another section in our
organisation that there is a known compatibility issue with Tomcat and
version 3 certificates.  Apparently he had been advised of this from
someone at Verisign.  

Does such an issue really exist and if so is it solely a Tomcat issue or
is it a result of something not quite working correctly in a particular
JDK version?

I find it a bit hard to believe that this claim is true.  However as I'm
no expert in the area I thought I'd pose the question before dismissing
it out of hand.  If such issues do exist I'd like to know where to find
further information relating to the situation, scenario and/or
workarounds.

Thanks if you can shed some light on this one!

AB



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



JSP seems to be executing twice and we are getting duplicate records in our database

2003-08-04 Thread Adrian Beech
Hi folks,

We have a weird problem where a JSP seems to be executing twice and we are
getting duplicate records in our database.  The data is coming from a HTML
form and upon submit a subsequent JSP page is called that performs the SQL
insert, etc.  We are also getting duplicate log messages so our initial
conclusion is that it's a Tomcat related issue.

We have tested this with Tomcat 3.3.1, J2SE 1.3.1 and from the client side
using both IE 5.5 and 6.0 and it happens intermittently.

At this stage we have absolutely no idea of what is going on.  Alas I didn't
write the code so I'm not up to speed with its structure, flow or
functionality.

I've searched the list archive and there appears to be several references to
similar problems.  However I am unable to find any real answer to what might
be causing this problem.

Hoping someone out yonder can help.

AB



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: JSP seems to be executing twice and we are getting duplicaterecords in our database

2003-08-04 Thread Adrian Beech
Hi Bill,

Would I be right in assuming that you're inferring  a user is submitting the
form multiple times by clicking the submit button/link more than once?  Or
are you perhaps suggesting the browser is sending multiple requests without
user intervention to the server hence the reason why the responding JSP is
processing duplicate requests to insert the data twice?

I understand your suggestions and points.  I don't however understand why
the problem is occuring as in our case the additional execution of the JSP
doesn't appear to be initiated by the user -- i.e. multiple clicks on a
submit button, etc.  I've triggered the submit using keyboard control which
should initiate only one instance of the form data being sent to the server
and the problem still occurs.

It also seems a bit kludgy to first determine if a session ID associated
with a specific record already exists prior to inserting a new row.

AB


-Original Message-
From: Bill Lunnon [mailto:[EMAIL PROTECTED] 
Sent: Monday, 4 August 2003 9:27 PM
To: Tomcat Users List; [EMAIL PROTECTED]
Subject: RE: JSP seems to be executing twice and we are getting duplicate
records in our database


Adrian,

If you do not want anothe rows created every time the page is submitted,
then you are going to have to implement something to stop this. TOMCAT will
not do this for you.

Without knowing the requirements for the form, stopping multiple rows being
generated could be as simple as:
- Assign a session to the user (clients browser).
- When the form is submitted, capture the sessionId in the database with the
record.
- If there is no row with the sessionId in the database, create a new record
with an insert. If there is a existing session, use an update to modify the
record.


Hope this helps

Bill

-Original Message-
From: Adrian Beech [mailto:[EMAIL PROTECTED]
Sent: Monday, 4 August 2003 8:45 PM
To: [EMAIL PROTECTED]
Subject: JSP seems to be executing twice and we are getting duplicate
records in our database


Hi folks,

We have a weird problem where a JSP seems to be executing twice and we are
getting duplicate records in our database.  The data is coming from a HTML
form and upon submit a subsequent JSP page is called that performs the SQL
insert, etc.  We are also getting duplicate log messages so our initial
conclusion is that it's a Tomcat related issue.

We have tested this with Tomcat 3.3.1, J2SE 1.3.1 and from the client side
using both IE 5.5 and 6.0 and it happens intermittently.

At this stage we have absolutely no idea of what is going on.  Alas I didn't
write the code so I'm not up to speed with its structure, flow or
functionality.

I've searched the list archive and there appears to be several references to
similar problems.  However I am unable to find any real answer to what might
be causing this problem.

Hoping someone out yonder can help.

AB



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Servlets JSPs log to different files

2003-08-01 Thread Adrian Beech
G'day,

Can anyone expand on this further and explain how to use a Log4j logger
reference in beans that do not have a notion of what the underlying servlet
context is?  The only way I can see how to get this to work is to pass the
logger reference as an argument in the bean's constructor.  

My query does seem to be out of context for this list so my apologies in
advance.

AB

-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED] 
Sent: Saturday, 2 August 2003 3:24 AM
To: Tomcat Users List
Subject: RE: Servlets  JSPs log to different files



Howdy,
Then use log4j.

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: Rick Roberts [mailto:[EMAIL PROTECTED]
Sent: Friday, August 01, 2003 1:18 PM
To: Tomcat Users List
Subject: Re: Servlets  JSPs log to different files



 How are you logging in your servlets?  Are you using 
 System.out/System.err?  If so, don't use them, and instead use the
 ServletContext#log(..) methods.

Actually, they are mostly beans with no ServletContext :(

--
***
* Rick Roberts*
* Advanced Information Technologies, Inc. *
***


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential, proprietary
and/or privileged.  This e-mail is intended only for the individual(s) to
whom it is addressed, and may not be saved, copied, printed, disclosed or
used by anyone else.  If you are not the(an) intended recipient, please
immediately delete this e-mail from your computer system and notify the
sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Combining Jboss Tomcat?

2003-07-12 Thread Adrian Beech
G'day folks,

I currently have an existing Tomcat 4.1.24 and J2SE 1.4.2 set up under
Windows XP Pro and all seems to be sweet.  Now I'd like to extend things a
bit and add Jboss into the loop for EJB support.  Are there HOWTO's floating
around which describe the installation and configuration of Tomcat and Jboss
in fairly easy to understand step by step instructions?

I see that Jboss 3.2.1 and 4.0 come bundled with Tomcat 4.1.24.  How would
this effect an existing Tomcat set up?

I am assuming (from what I've read thus far) that Tomcat 4.1.24 does not
support EJB... Or have I missed something?  Furthermore I'd assume that I
would need J2EE as opposed to J2SE?

AB



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Resolving scriptlets when using a client side SCRIPT ... tag?

2003-07-05 Thread Adrian Beech
G'day folks,

Is it possible to get Tomcat to process a include file and resolve embedded
scriptlets if the file is referenced from a client side SCRIPT ... tag?
In the two .js files I'm trying to work with there are several scriptlets
that need to be resolved by Tomcat prior to sending the content along to the
browser.

I can use %@ include file=... % server side which works just dandy,
however the resulting content is easily visible to the user if they happen
to view the source of the currently displayed page.  My preference is to use
SCRIPT TYPE=text/javascript LANGUAGE=JavaScript
SRC=Includes/InboundContact_Form.js/SCRIPT client side so that the code
is not part of the displayable source on the client's browser.

The problem I've run into is that when using a SCRIPT ... tag the
scriptlets are not resolved by Tomcat and what I end up with is something
like 'var orgName = %= orgReference.getOrganisationName() %;' instead of
'var orgName = Brisbane City Council;' on the client's side.

Can anyone please help?

AB




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



What sort of servlet is required when using it with auto load?

2002-08-13 Thread Adrian Beech

Hi folks,

I would like to put together a servlet that will be used solely for
setting up such things as connection pools, etc.  This servlet will be
auto loaded when Tomcat is started with the appropriate entries in the
web.xml file.  The connection pools will be saved as an application
scoped object for use by various JSP's.  The servlet will not serve up
web content except, I guess, appropriate error messages, etc.  My query
is that what sort of servlet do I need to achieve this?  For example, is
the class an extension of httpServlet, or can it be a simple class that
does not inherit objects from another higher level class?

Are there any examples of this sort of thing floating out yonder?

I am probably the rawest of raw novices when it comes to this sort of
stuff!

Thanks for your patience.

Adrian
[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Is Tomcat/MySQL a suitable combination in a production environment under Windows 2000 Pro?

2002-04-21 Thread Adrian Beech

Hi folks,

Is Tomcat/MySQL stable enough to deploy as a production platform under Windows 2000 
Pro?  I'm looking for a suitable platform to publish data driven web pages in a local 
Intranet environment.  At present we are using PWS/MS Access  under Windows 95.  I'd 
like to move onto something which is slightly more robust solution that doesn't cost 
the earth... actually if it doesn't cost nothing then much the better!

Adrian
[EMAIL PROTECTED]




Is Tomcat/MySQL suitable to deploy as a production platform under Windows 2000 Pro?

2002-04-21 Thread Adrian Beech

Hi folks,

Is Tomcat/MySQL stable enough to deploy as a production platform under
Windows 2000 Pro?  I'm looking for a suitable platform to publish data
driven web
pages in a local Intranet environment.  At present we are using PWS/MS
Access  under Windows 95.  I'd like to move onto something which is slightly
more
robust solution that doesn't cost the earth... actually if it doesn't cost
nothing then much the better!

Adrian
[EMAIL PROTECTED]


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: Adobe Acrobat

2002-04-09 Thread Adrian Beech

Huh, there is a printer driver that produces PDF files?  Tell me more... oh
please tell me more!  This could be an answer to an issue I have with trying
to read reports generated in Crystal reports within a browser, h...

Adrian
[EMAIL PROTECTED]

- Original Message -
From: John Burgess [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Tuesday, April 09, 2002 6:55 PM
Subject: RE: Adobe Acrobat


 Or alternatively use a printer driver that produces pdf files (Adobe
Acrobat
 or Xeon Docucom are two) and print to file from the servlet, then return
the
 file produced.  The other suggestions are probably neater and open source
 but this does definitely work :-)

 Best Wishes
 John Burgess
 [EMAIL PROTECTED]
 Tel: 01865 718666
 Fax: 01865 718600


 -Original Message-
 From: Ravindra K. Bhat [mailto:[EMAIL PROTECTED]]
 Sent: Monday, April 08, 2002 10:39 PM
 To: Tomcat Users List
 Subject: Adobe Acrobat


 Hi:
 How do I render my html pages to pdf for printing.  My servelet generated
 html table is too wide and columns get cut off if I print directly using
 the print icon on the browser...

 Thanks



 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]

 ---
 Incoming mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.343 / Virus Database: 190 - Release Date: 22/03/02


 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.343 / Virus Database: 190 - Release Date: 22/03/02


 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]



--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Is there a native JDBC driver for MS Access?

2002-04-06 Thread Adrian Beech

G'day all,

Is there a native JDBC driver for MS Access?  A few postings I've seen in the list 
archive make mentioned that the JDBC/ODBC bridge is a bit dodgy.

I have Tomcat 4.03 running as a standalone on a Win 2k pro box with JDK 1.3.1 
installed.

I'm rather new to Tomcat, JSP, JDBC, etc...

Any help would be appreciated.

Adrian Beech
[EMAIL PROTECTED]




Re: Is there a native JDBC driver for MS Access?

2002-04-06 Thread Adrian Beech

Um, okay then how stable is the JDBC/ODBC bridge?  As I previously
mentioned in my initial posting some bits and peices that I've read suggest
that this method of connecting to a DB back end is, or can be, a little
dodgy.  The comments basically revolved around the premise that the bridge
is not capable of being threaded and it is considered by Sun to still be
experimental.  I got the impression that there is potential for data loss or
corruption along with performance related issues.

I guess I really need to know if it is reasonable to use Tomcat to host an
environment that relies on this sort of DB connectivity.

Adrian
[EMAIL PROTECTED]


- Original Message -
From: Matt Gregory [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Saturday, April 06, 2002 11:06 PM
Subject: Re: Is there a native JDBC driver for MS Access?


 No, you are forced to use the JDBC/ODBC bridge or purchase one of the
 proprietary drivers available.  I know there are Paradox, FoxPro and dBase
 IV drivers but I have not seen any for Access.

 - Original Message -
 From: Adrian Beech [EMAIL PROTECTED]
 To: 'Tomcat Users List' [EMAIL PROTECTED]
 Sent: Sunday, April 07, 2002 6:47 AM
 Subject: Is there a native JDBC driver for MS Access?


 G'day all,

 Is there a native JDBC driver for MS Access?  A few postings I've seen in
 the list archive make mentioned that the JDBC/ODBC bridge is a bit dodgy.

 I have Tomcat 4.03 running as a standalone on a Win 2k pro box with JDK
 1.3.1 installed.

 I'm rather new to Tomcat, JSP, JDBC, etc...

 Any help would be appreciated.

 Adrian Beech
 [EMAIL PROTECTED]




 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]



--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]