RE: [Off Topic] Turn on Logging in Tomcat 4.0.1

2002-01-16 Thread Jenkins, David

All Logs are in the logs directory which is off your tomcat installation
directory.

Dave


-Original Message-
From: Matt Raible [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 17 January 2002 6:10 a.m.
To: [EMAIL PROTECTED]
Subject: [Off Topic] Turn on Logging in Tomcat 4.0.1


I'm hoping someone on this list will know the solution to this.  I'm using
Tomcat 4.0.1 on a Windows platform.

I start Tomcat and run it in a console window on my machine, but I never see
any logging messages.  I *know* they're there, because when I put the same
application on another machine (fresh install of Tomcat) - I get all the
startup messages from my struts app.

My question is - how do I turn on logging, so I get more than just this:

Starting service Tomcat-Standalone
Apache Tomcat/4.0.1
Starting service Tomcat-Apache
Apache Tomcat/4.0.1



__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

--
To unsubscribe, e-mail:

For additional commands, e-mail:



This message contains official information which is intended
for the use of the addressee(s) only.  If you are not the
intended recipient, please notify the sender immediately.
You should not further disseminate or copy this message
in any way.
*

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: How to use Log4j with a startup logging servlet

2002-01-16 Thread Jenkins, David

Hi Eric, here's how use Logging to provide method call logging.

import org.apache.log4j.Category;

public class myclass {

  private static final Category log = Category.getInstance(myclass .class);

  public void mymethod() {
try {
  log.debug("enter mymethod");
}
finally {
  log.debug("exit mymethod");
}
  }
}

Dave

-Original Message-
From: Eric L. Ma [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 16 January 2002 3:58 p.m.
To: 'Struts Users Mailing List'
Subject: RE: How to use Log4j with a startup logging servlet


Thanks, gentlemen.  I start to get the idea but am still fuzzy on how to
issue logging requests in my custom Action classes.  Do I have to
declare a static Category variable in each and every Action class I
write?  Please share some code on how logging is actually done, now that
I know how to set up the startup servlet.

Eric

-Original Message-
From: Eric Ma [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, January 15, 2002 12:33 PM
To: [EMAIL PROTECTED]
Subject: How to use Log4j with a startup logging servlet

I want to use Log4J for logging exceptions thrown in a Struts-based web
app.  After searching through this list, I found 2 common solutions:

1. Extend the Struts ActionServlet and override the init() method to set
up a Log4J Category.  Then in any custom Action class I can just call
servlet.Category.debug() (let's assume Category is a protected or public
variable).

2. Write a separate startup servlet and again set up LOG4J in the init()
method.  But my question is, how do I invoke this servlet from my custom
Action class?  Do I need to do a RequestDispatcher.forward() to the
servlet when an exception is thrown?  Then how do I get back to the page
I am on to display the error message?

Eric Ma


--

This e-mail may contain confidential and/or privileged information. If
you are not the intended recipient (or have received this e-mail in
error) please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.



--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:

For additional commands, e-mail:



This message contains official information which is intended
for the use of the addressee(s) only.  If you are not the
intended recipient, please notify the sender immediately.
You should not further disseminate or copy this message
in any way.
*

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: about connectionPool

2002-01-16 Thread Jenkins, David

I use Tomcat 4.0.x which has connection pooling built in. The pooling jar is
available separately from http://tyrex.exolab.org/. The version bundled with
Tomcat 4.0.1 is missing some configuration options, this may be fixed in the
newer release.

Dave


-Original Message-
From: Struts Newsgroup [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 16 January 2002 9:25 p.m.
To: [EMAIL PROTECTED]
Subject: about connectionPool


Subject: about connectionPool
From: "Gary" <[EMAIL PROTECTED]>
 ===
Since most of u r using Structs, what kind of database connection pool do u
highly recommend to adopt? ( shareware will be better)

Thanks.

--
/**
 * Name: Gary Wang
 * Tele: 010-65546668-8119
 * Mail: [EMAIL PROTECTED]
 */



--
To unsubscribe, e-mail:

For additional commands, e-mail:



This message contains official information which is intended
for the use of the addressee(s) only.  If you are not the
intended recipient, please notify the sender immediately.
You should not further disseminate or copy this message
in any way.
*

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: How to use Log4j with a startup logging servlet

2002-01-15 Thread Jenkins, David

If you're using Tomcat 4.0.x then the documentation shows how to use a
servlet to configure Log4J. Essentially you create a normal servlet, slap it
in your web.xml and configure it to load on startup.
I do this in all my web apps and also use the same method to init Velocity.
Here's a sample web.xml entry

  
log4j-init
Log4jInit

  log4j-init-file
  WEB-INF/classes/log4j.properties

1
  

and the init method from the servlet

  public void init() throws ServletException {
String prefix =  getServletContext().getRealPath("/");
String file = getInitParameter("log4j-init-file");
// if the log4j-init-file is not set, then no point in trying
if(file != null) {
  PropertyConfigurator.configure(prefix+file);
}
getServletContext().log("logging to: "+prefix+file);
  }



-Original Message-
From: Eric Ma [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 16 January 2002 6:33 a.m.
To: [EMAIL PROTECTED]
Subject: How to use Log4j with a startup logging servlet


I want to use Log4J for logging exceptions thrown in a Struts-based web app.
After searching through this list, I found 2 common solutions:

1. Extend the Struts ActionServlet and override the init() method to set up
a Log4J Category.  Then in any custom Action class I can just call
servlet.Category.debug() (let's assume Category is a protected or public
variable).

2. Write a separate startup servlet and again set up LOG4J in the init()
method.  But my question is, how do I invoke this servlet from my custom
Action class?  Do I need to do a RequestDispatcher.forward() to the servlet
when an exception is thrown?  Then how do I get back to the page I am on to
display the error message?

Eric Ma


--

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.



--
To unsubscribe, e-mail:

For additional commands, e-mail:



This message contains official information which is intended
for the use of the addressee(s) only.  If you are not the
intended recipient, please notify the sender immediately.
You should not further disseminate or copy this message
in any way.
*

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: iterate issue

2002-01-09 Thread Jenkins, David

Try declaring the return type as Collection. I had the same problem which
disappeared when I changed type from List to Collection.

Dave


This message contains official information which is intended
for the use of the addressee(s) only.  If you are not the
intended recipient, please notify the sender immediately.
You should not further disseminate or copy this message
in any way.
*

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




struts-user@jakarta.apache.org

2002-01-07 Thread Jenkins, David

Hi all,

First let me say that I know absolutely nothing about HTML. However that
doesn't deter me.
I'm trying to create a wizard framework in struts, you know the sort where
the are a number of pages linked by "next' and 'back' buttons.
So I have these buttons on my forms and need the action bean to determine
which button submitted the form. Looking at the documentation it seems that
I can use a 'property' attribute on my  tags and according to
the manual 'Name of the request parameter that will be included with this
submission, set to the specified value'. However when I examine the request
attributes for all my submit buttons in the action bean after the form has
been submitted, the attributes have no (null) values.
I would be grateful if someone can point me in the right direction.
Dave



This message contains official information which is intended
for the use of the addressee(s) only.  If you are not the
intended recipient, please notify the sender immediately.
You should not further disseminate or copy this message
in any way.
*

--
To unsubscribe, e-mail:   
For additional commands, e-mail: