Re: Commons Logging

2002-02-25 Thread David Winterfeldt


--- "Craig R. McClanahan" <[EMAIL PROTECTED]> wrote:
> 
> 
> On Mon, 25 Feb 2002, David Winterfeldt wrote:
> 
> > Date: Mon, 25 Feb 2002 19:49:05 -0800 (PST)
> > From: David Winterfeldt <[EMAIL PROTECTED]>
> > Reply-To: Struts Developers List
> <[EMAIL PROTECTED]>
> > To: Struts Developers List
> <[EMAIL PROTECTED]>
> > Subject: Commons Logging
> >
> > I checked in what I've done so far.  Commons
> Logging
> > issues.
> >
> > 1. Do we want to just add console logging to the
> > example web apps or log to a file?
> 
> I'm adding this for struts-example (along with
> updating the architecture
> to reflect modern Struts design patterns, like using
> a DAO for the
> database access).
> 
> >  Are you still
> > running the nightly build Craig?
> 
> Yes.
> 
> >  Log4J would need to
> > be added to the properties file so it can be
> included
> > in the webapps for the binary distribution.  Or we
> can
> > activate the console logging in the Commons
> Logging
> > pacakge.
> >
> 
> I'm not opposed to including Log4J, but doesn't that
> mean we need to
> preconfigure it as well?  It seems simpler to just
> accept the
> commons-logging defaults and let users configure
> their own environment
> differently if they need it.
I just meant for the web app examples so someone can
see the logging info when they run them and have a
working example.  Your adding this already so it will
be taken care of.

> 
> > 2. I left the log(msg) method in ActionServlet,
> > ActionServletWrapper, and RequestProcessor.  I
> > deprecated the log method to the logWriter in
> > GenericDataSource and switched the class itself to
> use
> > Commons Logging.  MessageResources log method logs
> to
> > Commons Logging.  That method was logging to
> > System.out, but since other people are calling the
> > other log methods and they are at least being
> written
> > to a file I wasn't sure if they should be changed
> to
> > Commons Logging.
> >
> 
> OK, although I don't really think log() needs to be
> deprecated, since it
> just passes the message on to a feature that is part
> of the standard
> Servlet API.
It's late here on the East coast.  I saw PrintWriter
and jumped to conclustions.  Should have known better.
 :)  I removed the deprecation comments.

> 
> > 3. appConfig.getServlet().getDebug()
> >I didn't change this.  I'm not sure how this
> fits
> > in with adding Commons Logging.  I left this as
> the
> > conditional, but change the logging inside to
> > log.debug.
> >
> 
> Part of the same issue.
> 
> > Files updated.
> >
>
src/share/org/apache/struts/action/ActionServlet.java
> >
>
src/share/org/apache/struts/action/RequestProcessor.java
> >
>
src/share/org/apache/struts/actions/DispatchAction.java
> >
>
src/share/org/apache/struts/upload/DiskMultipartRequestHandler.java
> >
>
src/share/org/apache/struts/util/GenericDataSource.java
> >
>
src/share/org/apache/struts/util/MessageResources.java
> >
>
src/share/org/apache/struts/util/MessageResourcesFactory.java
> > src/share/org/apache/struts/util/RequestUtils.java
> >
> > Another sidenote is that commons-services.jar and
> > commons-validator.jar are in the build.xml, but
> not in
> > the build.properties.sample file.  I was going to
> fix
> > this, but I didn't want to break the nightly
> build.
> >
> 
> Go ahead ... build.properties.sample is just that --
> a sample -- it's not
> actually used in the nightly build process.  I've
> got these JAR files
> defined in my ${user.home}/build.properties file
> anyway.
OK.  I wasn't worried about breaking anything.  Just
confusing the issue if this was still a work in
progress.  I checked it in.

David

> 
> > David
> >
> 
> Craig
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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




cvs commit: jakarta-struts build.properties.sample

2002-02-25 Thread dwinterfeldt

dwinterfeldt02/02/25 21:40:56

  Modified:.build.properties.sample
  Log:
  Reference to commons-services.jar and commons-validator.jar.
  
  Revision  ChangesPath
  1.8   +9 -1  jakarta-struts/build.properties.sample
  
  Index: build.properties.sample
  ===
  RCS file: /home/cvs/jakarta-struts/build.properties.sample,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- build.properties.sample   16 Jan 2002 03:05:22 -  1.7
  +++ build.properties.sample   26 Feb 2002 05:40:56 -  1.8
  @@ -6,7 +6,7 @@
   # to "build.properties" in the same directory that contains the Struts
   # "build.xml" file.
   #
  -# $Id: build.properties.sample,v 1.7 2002/01/16 03:05:22 craigmcc Exp $
  +# $Id: build.properties.sample,v 1.8 2002/02/26 05:40:56 dwinterfeldt Exp $
   # -
   
   # WARNING:  The relative paths below assume that the build.xml file is in the
  @@ -43,6 +43,14 @@
   # The JAR file containing version 1.0 (or later) of the POOL package
   # from the Jakarta Commons project.
   commons-pool.jar=/usr/local/commons-pool-1.0/commons-pool.jar
  +
  +# The JAR file containing a recent version of the SERVICES package
  +# from the Jakarta Commons project.
  +commons-services.jar=/usr/local/commons-services/commons-services.jar
  +
  +# The JAR file containing a recent version of the VALIDATOR package
  +# from the Jakarta Commons project.
  +commons-validator.jar=/usr/local/commons-validator/commons-validator.jar
   
   # The JAR file containing the JDBC 2.0 Optional Package extensions API
   # (javax.sql).  This file will automatically be added to your class path
  
  
  

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




Deprecations and custom action mappings

2002-02-25 Thread Martin Cooper

I want to make some changes to the way ActionMapping instances are created,
but I'm a bit puzzled about the various related deprecations. Historical
help would be appreciated! (Craig?)

Here's what I can tell from the CVS history:

1) The 'className' attribute for the  element has been available in
the struts-config.xml file since prior to Struts 1.0. It allows
customisation of action mapping implementation classes at the
per-action-mapping level.

2) At some point prior to Struts 1.0, the 'type' attribute was introduced on
the  element in the struts-config.xml file. This allowed
the specification of the class to be instantiated for all action mappings as
they were parsed from the config file, thus allowing customisation of action
mappings at the config file level.

3) Still prior to Struts 1.0, this 'type' attribute was deprecated. The
preferred means of specifying a custom action mapping class was changed to
the use of a servlet init-param. Although not relevant at that time, in
today's multi-module context, this means that the customisation is now at
the application level rather than at the config file level.

4) As a part of "The BIG Check-In", the use of an init-param to specify a
custom action mapping was deprecated. (In fact, I don't believe this is
actually supported in the current code base.)

As far as I can tell, the only remaining non-deprecated method of
customising the class used for action mappings is to specify the class on a
per-mapping basis - that is, (1) above. I don't think this is what we want.
(Well, it's not what *I* want :)

It seems to me that we should go back to stage (2) above, and allow the
specification of the implementation class at the per-config-file level. This
would fit well with the new multi-module architecture. Bugzilla #6583 also
seems to argue for this.

Before I start making changes in this direction, I'd really like to hear
about how we got to where we are. The last thing I want to do is repeat the
same old mistakes!

Thanks.

--
Martin Cooper



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




cvs commit: jakarta-struts/src/share/org/apache/struts/util GenericDataSource.java

2002-02-25 Thread dwinterfeldt

dwinterfeldt02/02/25 21:21:07

  Modified:src/share/org/apache/struts/util GenericDataSource.java
  Log:
  Removed deprecation from logWriter methods.
  
  Revision  ChangesPath
  1.9   +4 -12 
jakarta-struts/src/share/org/apache/struts/util/GenericDataSource.java
  
  Index: GenericDataSource.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/util/GenericDataSource.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- GenericDataSource.java26 Feb 2002 03:38:57 -  1.8
  +++ GenericDataSource.java26 Feb 2002 05:21:07 -  1.9
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/util/GenericDataSource.java,v 1.8 
2002/02/26 03:38:57 dwinterfeldt Exp $
  - * $Revision: 1.8 $
  - * $Date: 2002/02/26 03:38:57 $
  + * $Header: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/util/GenericDataSource.java,v 1.9 
2002/02/26 05:21:07 dwinterfeldt Exp $
  + * $Revision: 1.9 $
  + * $Date: 2002/02/26 05:21:07 $
*
* 
*
  @@ -180,7 +180,7 @@
*
* @author Craig R. McClanahan
* @author Ted Husted
  - * @version $Revision: 1.8 $ $Date: 2002/02/26 03:38:57 $
  + * @version $Revision: 1.9 $ $Date: 2002/02/26 05:21:07 $
*/
   
   public class GenericDataSource implements DataSource {
  @@ -594,8 +594,6 @@
* Return the log writer for this data source.
*
* @exception SQLException if a database access error occurs
  - *
  - * @deprecated Switched to Commons Logging.
*/
   public PrintWriter getLogWriter() throws SQLException {
   
  @@ -624,8 +622,6 @@
* @param logWriter The new log writer
*
* @exception SQLException if a database access error occurs
  - *
  - * @deprecated Switched to Commons Logging.
*/
   public void setLogWriter(PrintWriter logWriter) throws SQLException {
   
  @@ -769,8 +765,6 @@
* Log the specified message to our log writer, if we have one.
*
* @param message The message to be logged
  - *
  - * @deprecated Switched to Commons Logging.
*/
   protected void log(String message) {
   
  @@ -790,8 +784,6 @@
*
* @param message The message to be logged
* @param throwable The exception to be logged
  - *
  - * @deprecated Switched to Commons Logging.
*/
   protected void log(String message, Throwable throwable) {
   
  
  
  

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




cvs commit: jakarta-struts/contrib/validator/src/share/org/apache/struts/validator/util StrutsValidator.java

2002-02-25 Thread dwinterfeldt

dwinterfeldt02/02/25 21:03:27

  Modified:contrib/validator build.properties.sample build.xml
   contrib/validator/src/example/org/apache/struts/validator/example
MultiRegistrationAction.java
RegistrationAction.java TypeAction.java
   contrib/validator/src/share/org/apache/struts/validator/action
ValidatorActionForm.java ValidatorForm.java
ValidatorServlet.java
   contrib/validator/src/share/org/apache/struts/validator/util
StrutsValidator.java
  Added:   contrib/validator .cvsignore
  Log:
  Switched to Commons Logging.
  
  Revision  ChangesPath
  1.5   +4 -0  jakarta-struts/contrib/validator/build.properties.sample
  
  Index: build.properties.sample
  ===
  RCS file: /home/cvs/jakarta-struts/contrib/validator/build.properties.sample,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- build.properties.sample   15 Jan 2002 06:24:59 -  1.4
  +++ build.properties.sample   26 Feb 2002 05:03:27 -  1.5
  @@ -21,6 +21,10 @@
   # from the Jakarta Commons project.
   commons-logging.jar=e:/software/commons-logging/commons-logging.jar
   
  +# The JAR file containing version 1.1 (or later) of the Logging package
  +# from the Jakarta Log4J core.
  +log4j-core.jar=d:/java/lib/log4j-core.jar
  +
   struts.jar=d:/office/struts/jakarta-struts/target/library/struts.jar
   struts.tlds=d:/office/struts/jakarta-struts/target/library
   
  
  
  
  1.6   +17 -0 jakarta-struts/contrib/validator/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/jakarta-struts/contrib/validator/build.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- build.xml 15 Jan 2002 06:24:59 -  1.5
  +++ build.xml 26 Feb 2002 05:03:27 -  1.6
  @@ -43,6 +43,7 @@



  + 

 
   
  @@ -109,6 +110,7 @@
   
   
   
  +
   
   
   
  @@ -178,6 +180,21 @@

 
   
  +  
  +
  +  
  +  
  + 
  + 
  + 
  + 
  + 
  +
  + 
  + 
  + 
  + 
  + 
 
 
   
  
  
  
  1.1  jakarta-struts/contrib/validator/.cvsignore
  
  Index: .cvsignore
  ===
  build
  lib
  target
  webapps
  build.properties
  dist/docs
  dist/src
  dist/web
  dist/webapps
  dist/struts-validator.jar
  
  
  
  1.2   +10 -26
jakarta-struts/contrib/validator/src/example/org/apache/struts/validator/example/MultiRegistrationAction.java
  
  Index: MultiRegistrationAction.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/contrib/validator/src/example/org/apache/struts/validator/example/MultiRegistrationAction.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MultiRegistrationAction.java  15 Jan 2002 03:48:05 -  1.1
  +++ MultiRegistrationAction.java  26 Feb 2002 05:03:27 -  1.2
  @@ -61,6 +61,8 @@
   import javax.servlet.http.HttpSession;
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   import org.apache.struts.action.Action;
   import org.apache.struts.action.ActionErrors;
   import org.apache.struts.action.ActionForm;
  @@ -77,6 +79,11 @@
   */
   public final class MultiRegistrationAction extends Action {
   
  +/**
  + * Commons Logging instance.
  +*/
  +private Log log = LogSource.getInstance(this.getClass().getName());
  +
   
   /**
* Process the specified HTTP request, and create the corresponding HTTP
  @@ -108,7 +115,9 @@

// Was this transaction cancelled?
if (isCancelled(request)) {
  - log(" " + mapping.getAttribute() + " - Registration transaction was 
cancelled");
  + if (log.isInfoEnabled()) {
  +log.info(" " + mapping.getAttribute() + " - Registration transaction 
was cancelled");
  + }

removeFormBean(mapping, request);
   
  @@ -131,31 +140,6 @@
}

return mapping.findForward("input1");   
  -}
  -
  -/**
  - * Convenience method that call the comparable servlet log method and writes 
  - * an explanatory message and a stack trace for a given Throwable exception to 
the 
  - * servlet log file.
  - *
  - * @parammessage String that describes the error or exception
  -*/
  -protected void log(String message) {
  -   if (servlet.getDebug() >=

Re: Commons Logging

2002-02-25 Thread Craig R. McClanahan



On Mon, 25 Feb 2002, David Winterfeldt wrote:

> Date: Mon, 25 Feb 2002 19:49:05 -0800 (PST)
> From: David Winterfeldt <[EMAIL PROTECTED]>
> Reply-To: Struts Developers List <[EMAIL PROTECTED]>
> To: Struts Developers List <[EMAIL PROTECTED]>
> Subject: Commons Logging
>
> I checked in what I've done so far.  Commons Logging
> issues.
>
> 1. Do we want to just add console logging to the
> example web apps or log to a file?

I'm adding this for struts-example (along with updating the architecture
to reflect modern Struts design patterns, like using a DAO for the
database access).

>  Are you still
> running the nightly build Craig?

Yes.

>  Log4J would need to
> be added to the properties file so it can be included
> in the webapps for the binary distribution.  Or we can
> activate the console logging in the Commons Logging
> pacakge.
>

I'm not opposed to including Log4J, but doesn't that mean we need to
preconfigure it as well?  It seems simpler to just accept the
commons-logging defaults and let users configure their own environment
differently if they need it.

> 2. I left the log(msg) method in ActionServlet,
> ActionServletWrapper, and RequestProcessor.  I
> deprecated the log method to the logWriter in
> GenericDataSource and switched the class itself to use
> Commons Logging.  MessageResources log method logs to
> Commons Logging.  That method was logging to
> System.out, but since other people are calling the
> other log methods and they are at least being written
> to a file I wasn't sure if they should be changed to
> Commons Logging.
>

OK, although I don't really think log() needs to be deprecated, since it
just passes the message on to a feature that is part of the standard
Servlet API.

> 3. appConfig.getServlet().getDebug()
>I didn't change this.  I'm not sure how this fits
> in with adding Commons Logging.  I left this as the
> conditional, but change the logging inside to
> log.debug.
>

Part of the same issue.

> Files updated.
> src/share/org/apache/struts/action/ActionServlet.java
> src/share/org/apache/struts/action/RequestProcessor.java
> src/share/org/apache/struts/actions/DispatchAction.java
> src/share/org/apache/struts/upload/DiskMultipartRequestHandler.java
> src/share/org/apache/struts/util/GenericDataSource.java
> src/share/org/apache/struts/util/MessageResources.java
> src/share/org/apache/struts/util/MessageResourcesFactory.java
> src/share/org/apache/struts/util/RequestUtils.java
>
> Another sidenote is that commons-services.jar and
> commons-validator.jar are in the build.xml, but not in
> the build.properties.sample file.  I was going to fix
> this, but I didn't want to break the nightly build.
>

Go ahead ... build.properties.sample is just that -- a sample -- it's not
actually used in the nightly build process.  I've got these JAR files
defined in my ${user.home}/build.properties file anyway.

> David
>

Craig


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




Re: why is iterate tag final?

2002-02-25 Thread Arron Bates

It's not a final class in the nightly builds.
None of the tags in cvs are final.

A legacy detail.


Arron.


Jeff Goke wrote:

>I am curious why the iterate tag is declared as final?  I was writing a wrapper tag 
>to simplify the process of showing "pages" of information (since this is an extremely 
>common requirement) but quickly realized I cannot extend the iterate tag.  Right now 
>I am resorting to taking the source from the class and just implementing the new 
>class using the source, however, this hardly is an ideal solution.
>
>Does anyone know why this is a final class?  
>
>Thanks,
>
>-Jeff
>
>



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




why is iterate tag final?

2002-02-25 Thread Jeff Goke

I am curious why the iterate tag is declared as final?  I was writing a wrapper tag to 
simplify the process of showing "pages" of information (since this is an extremely 
common requirement) but quickly realized I cannot extend the iterate tag.  Right now I 
am resorting to taking the source from the class and just implementing the new class 
using the source, however, this hardly is an ideal solution.

Does anyone know why this is a final class?  

Thanks,

-Jeff




Commons Logging

2002-02-25 Thread David Winterfeldt

I checked in what I've done so far.  Commons Logging
issues.

1. Do we want to just add console logging to the
example web apps or log to a file?  Are you still
running the nightly build Craig?  Log4J would need to
be added to the properties file so it can be included
in the webapps for the binary distribution.  Or we can
activate the console logging in the Commons Logging
pacakge.

2. I left the log(msg) method in ActionServlet,
ActionServletWrapper, and RequestProcessor.  I
deprecated the log method to the logWriter in
GenericDataSource and switched the class itself to use
Commons Logging.  MessageResources log method logs to
Commons Logging.  That method was logging to
System.out, but since other people are calling the
other log methods and they are at least being written
to a file I wasn't sure if they should be changed to
Commons Logging.

3. appConfig.getServlet().getDebug()
   I didn't change this.  I'm not sure how this fits
in with adding Commons Logging.  I left this as the
conditional, but change the logging inside to
log.debug.

Files updated.
src/share/org/apache/struts/action/ActionServlet.java
src/share/org/apache/struts/action/RequestProcessor.java
src/share/org/apache/struts/actions/DispatchAction.java
src/share/org/apache/struts/upload/DiskMultipartRequestHandler.java
src/share/org/apache/struts/util/GenericDataSource.java
src/share/org/apache/struts/util/MessageResources.java
src/share/org/apache/struts/util/MessageResourcesFactory.java
src/share/org/apache/struts/util/RequestUtils.java

Another sidenote is that commons-services.jar and
commons-validator.jar are in the build.xml, but not in
the build.properties.sample file.  I was going to fix
this, but I didn't want to break the nightly build.

David

__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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




cvs commit: jakarta-struts/src/share/org/apache/struts/util GenericDataSource.java MessageResources.java MessageResourcesFactory.java RequestUtils.java

2002-02-25 Thread dwinterfeldt

dwinterfeldt02/02/25 19:38:57

  Modified:src/share/org/apache/struts/action ActionServlet.java
RequestProcessor.java
   src/share/org/apache/struts/actions DispatchAction.java
   src/share/org/apache/struts/upload
DiskMultipartRequestHandler.java
   src/share/org/apache/struts/util GenericDataSource.java
MessageResources.java MessageResourcesFactory.java
RequestUtils.java
  Log:
  Changed logging to use Commons Logging package.
  
  Revision  ChangesPath
  1.93  +48 -35
jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java
  
  Index: ActionServlet.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java,v
  retrieving revision 1.92
  retrieving revision 1.93
  diff -u -r1.92 -r1.93
  --- ActionServlet.java23 Feb 2002 22:54:17 -  1.92
  +++ ActionServlet.java26 Feb 2002 03:38:56 -  1.93
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java,v 1.92 
2002/02/23 22:54:17 craigmcc Exp $
  - * $Revision: 1.92 $
  - * $Date: 2002/02/23 22:54:17 $
  + * $Header: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java,v 1.93 
2002/02/26 03:38:56 dwinterfeldt Exp $
  + * $Revision: 1.93 $
  + * $Date: 2002/02/26 03:38:56 $
*
* 
*
  @@ -86,6 +86,8 @@
   import org.apache.commons.collections.FastHashMap;
   import org.apache.commons.digester.Digester;
   import org.apache.commons.digester.Rule;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   import org.apache.struts.config.ActionConfig;
   import org.apache.struts.config.ApplicationConfig;
   import org.apache.struts.config.ConfigRuleSet;
  @@ -267,7 +269,7 @@
*
* @author Craig R. McClanahan
* @author Ted Husted
  - * @version $Revision: 1.92 $ $Date: 2002/02/23 22:54:17 $
  + * @version $Revision: 1.93 $ $Date: 2002/02/26 03:38:56 $
*/
   
   public class ActionServlet
  @@ -276,7 +278,11 @@
   
   // - Instance Variables
   
  -
  +/**
  + * Commons Logging instance.
  +*/
  +private Log log = LogSource.getInstance(this.getClass().getName());
  +
   /**
* The context-relative path to our configuration resource for the
* default sub-application.
  @@ -377,8 +383,8 @@
*/
   public void destroy() {
   
  -if (debug >= 1) {
  -log(internal.getMessage("finalizing"));
  +if (log.isDebugEnabled()) {
  +log.debug(internal.getMessage("finalizing"));
   }
   
   destroyApplications();
  @@ -476,13 +482,16 @@
*/
   public void addServletMapping(String servletName, String urlPattern) {
   
  -if (debug >= 1)
  -log("Process servletName=" + servletName +
  -", urlPattern=" + urlPattern);
  -if (servletName == null)
  +if (log.isDebugEnabled()) {
  +log.debug("Process servletName=" + servletName +
  +  ", urlPattern=" + urlPattern);
  +}
  +if (servletName == null) {
   return;
  -if (servletName.equals(this.servletName))
  +}
  +if (servletName.equals(this.servletName)) {
   this.servletMapping = urlPattern;
  +}
   
   }
   
  @@ -612,8 +621,9 @@
*/
   public void log(String message, int level) {
   
  -if (debug >= level)
  +if (debug >= level) {
   log(message);
  +}
   
   }
   
  @@ -679,12 +689,13 @@
   getServletContext().removeAttribute(key);
   DataSource dataSource = findDataSource(key);
   if (dataSource instanceof GenericDataSource) {
  -if (debug >= 1)
  -log(internal.getMessage("dataSource.destroy", key));
  +if (log.isDebugEnabled()) {
  +log.debug(internal.getMessage("dataSource.destroy", key));
  +}
   try {
   ((GenericDataSource) dataSource).close();
   } catch (SQLException e) {
  -log(internal.getMessage("destroyDataSource", key), e);
  +log.error(internal.getMessage("destroyDataSource", key), e);
   }
   }
   }
  @@ -737,8 +748,8 @@
   protected ApplicationConfig initApplicationConfig
   (String prefix, String path) throws ServletException {
   
  -if (debug >= 1) {
  -log("Initializing application path '

Struts presenters wanted for "Struts in San Fran, for JavaOne" on March 28th

2002-02-25 Thread Vic Cekvenich

( I plan to have a new version of my class at JavaOne, and have booked a 
hotel.You can sign up by end of week if you'd like).

I will have open mike panel presenter, so if you would like to present 
to the Struts audience, please let me know.
I prefer presentation that can show some Struts applications techniques 
that made it to production or operations. You should send me PowerPoint 
slides 2 weeks before (your copyright is OK).
Do you have a Struts application in production that you can discuss or 
show parts of? Great.
Also, if you have "Struts tools" or extensions, I would also look at it, 
or any frequent poster could present on anything Struts really.

We can also discuss any other topics of interest, related to Struts 
depending on the turn out.

Details to follow, not sure about format or how to sign up yet I hope 
by end of week.
It will definitely happen, since I have a few paid students already, I 
am just adding other presenters.

Vic at baseBeans.com
Please send me a personal e-mail if you are interested


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




cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/bean DefineTag.java

2002-02-25 Thread oalexeev

oalexeev02/02/25 13:02:04

  Modified:src/share/org/apache/struts/taglib/bean DefineTag.java
  Log:
  Fix typing error.
  
  Revision  ChangesPath
  1.15  +5 -5  
jakarta-struts/src/share/org/apache/struts/taglib/bean/DefineTag.java
  
  Index: DefineTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/bean/DefineTag.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- DefineTag.java25 Feb 2002 20:56:53 -  1.14
  +++ DefineTag.java25 Feb 2002 21:02:04 -  1.15
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/bean/DefineTag.java,v 1.14 
2002/02/25 20:56:53 oalexeev Exp $
  - * $Revision: 1.14 $
  - * $Date: 2002/02/25 20:56:53 $
  + * $Header: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/bean/DefineTag.java,v 1.15 
2002/02/25 21:02:04 oalexeev Exp $
  + * $Revision: 1.15 $
  + * $Date: 2002/02/25 21:02:04 $
*
* 
*
  @@ -77,7 +77,7 @@
* bean property.
*
* @author Craig R. McClanahan
  - * @version $Revision: 1.14 $ $Date: 2002/02/25 20:56:53 $
  + * @version $Revision: 1.15 $ $Date: 2002/02/25 21:02:04 $
*/
   
   public class DefineTag extends BodyTagSupport {
  @@ -206,7 +206,7 @@
   if( this.name!=null || this.value!=null )
   return (SKIP_BODY);
   else
  -return (EVAL_BODY_BUFFERED);
  +return (EVAL_BODY_TAG);
   }
   
   /**
  
  
  

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




cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/bean DefineTag.java LocalStrings.properties

2002-02-25 Thread oalexeev

oalexeev02/02/25 12:56:53

  Modified:src/share/org/apache/struts/taglib/bean DefineTag.java
LocalStrings.properties
  Log:
  Patch for tag body processing.
  Source - "Robson Miranda" <[EMAIL PROTECTED]>
  
  Revision  ChangesPath
  1.14  +23 -7 
jakarta-struts/src/share/org/apache/struts/taglib/bean/DefineTag.java
  
  Index: DefineTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/bean/DefineTag.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- DefineTag.java21 Feb 2002 17:48:14 -  1.13
  +++ DefineTag.java25 Feb 2002 20:56:53 -  1.14
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/bean/DefineTag.java,v 1.13 
2002/02/21 17:48:14 oalexeev Exp $
  - * $Revision: 1.13 $
  - * $Date: 2002/02/21 17:48:14 $
  + * $Header: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/bean/DefineTag.java,v 1.14 
2002/02/25 20:56:53 oalexeev Exp $
  + * $Revision: 1.14 $
  + * $Date: 2002/02/25 20:56:53 $
*
* 
*
  @@ -77,7 +77,7 @@
* bean property.
*
* @author Craig R. McClanahan
  - * @version $Revision: 1.13 $ $Date: 2002/02/21 17:48:14 $
  + * @version $Revision: 1.14 $ $Date: 2002/02/25 20:56:53 $
*/
   
   public class DefineTag extends BodyTagSupport {
  @@ -196,21 +196,37 @@
   // - Public Methods
   
   /**
  +*
  +* Check if we need to evaluate the body of the tag
  +*
  +* @exception JspException if a JSP exception has occurred
  +*/
  +public int doStartTag() throws JspException {
  +   
  +if( this.name!=null || this.value!=null )
  +return (SKIP_BODY);
  +else
  +return (EVAL_BODY_BUFFERED);
  +}
  +
  +/**
* Retrieve the required property and expose it as a scripting variable.
*
* @exception JspException if a JSP exception has occurred
*/
   public int doEndTag() throws JspException {
   
  -if( this.value!=null && bodyContent!=null )
  +if( ( this.value!=null || 
  +  this.name!=null ) && 
  +bodyContent!=null )
   throw new JspException( messages.getMessage("define.value", name) );
   
   // Retrieve the required property value
   Object value = this.value;
  +if (value == null && name!=null) 
  +value = RequestUtils.lookup(pageContext, name, property, scope);
   if (value == null) 
   value = bodyContent.getString();
  -if (value == null) 
  -value = RequestUtils.lookup(pageContext, name, property, scope);
   
   // Expose this value as a scripting variable
   int inScope = PageContext.PAGE_SCOPE;
  
  
  
  1.16  +1 -1  
jakarta-struts/src/share/org/apache/struts/taglib/bean/LocalStrings.properties
  
  Index: LocalStrings.properties
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/bean/LocalStrings.properties,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- LocalStrings.properties   21 Feb 2002 17:48:14 -  1.15
  +++ LocalStrings.properties   25 Feb 2002 20:56:53 -  1.16
  @@ -17,4 +17,4 @@
   struts.missing=No Struts internal object named {0} is available
   struts.selector=You must specify exactly one of formBean, forward, or mapping
   write.format=Wrong format string: '{0}'
  -define.value=Define tag can contain value attribute or body - both can not be 
processed.
  \ No newline at end of file
  +define.value=Define tag can contain value/name attributes or body.
  \ No newline at end of file
  
  
  

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




Session and workflow control

2002-02-25 Thread RODRIGO CARVALHO DOS SANTOS



Hello,

I´m designing a Struts based web application that will be hosted in a
Websphere J2EE App Server. What´s the best approach for session and
transactions workflow: Should I put the execution of the action Workflow and
session data in the Web Container (Servlet Context) or EJB container
(Session beans) ?

Thanks,
Rodrigo

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




Re: i18n Forwards

2002-02-25 Thread Dmitri Valdin

I just don't want to get this thread die especially considering the fact,
that beta 1.1 will be released soon. There were several proposals, but there
is still no decision how should struts resolve this problem.
Or perhaps I have missed something.

Dmitri Valdin

> > What I was thinking of originally was an approach to creating dynamic
> > forwards, which could help with several things, including i18n, browser
> > detection, multiple platforms, et cetera.
>
> * What about using a request parameter in {} directly instead of {0}, {1},
> etc ?
> {locale} can be handled in particular way. I can hardly believe that
> directory order
> would be different for different languages.
>
> * If we "misuse" parameter (parameter="forward") we can introduce some
> general
> action for handle cases, similar to one described by Ted.
>
>  path="/search/Name"
> type="app.Parameter"
> name="searchForm"
> scope="request"
> validate="false"
> parameter="forward">
>  path="/do/prospect/SearchName?fullName={name}"/>
>
> * Yet another idea. What do you think about introducing a default basis
> handler
> for forwards (similar as it is done for exceptions), which can be
overridden
> and specified in config file ?
>
>  path="/do/{locale}/prospect/SearchName?fullName={name}"
> handler=org.apache.struts.action.ForwardHandler"/>
>
> * In order to avoid specifying {locale} in every forward, some kind of
> global pattern can be introduced:
>
> "do/{locale}/forward"
>
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>
>



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




RE: Struts & Turbine

2002-02-25 Thread Mathieu Frenette

I've used Struts with Torque (a subset of Turbine which allows to generate
an object model that maps to a relational database) and I've found that the
two worked quite nicely together.  The beans generated for the object model
are compatible with Struts with little or no effort.  However, I found that
primary and foreign keys (NumberKey) are not easy to convert for form beans.
For this purpose I decided to use a PropertyEditor.  However PropertyUtils
doesn't support PropertyEditor correctly, so I had to fix my own version of
PropertyUtils.  Once this was done, it was much simpler to convert
NumberKeys back and forth from Strings.

Let me know if you need help with this particular aspect.

HTH

-- Mathieu

-Original Message-
From: Hai Hoang [mailto:[EMAIL PROTECTED]]
Sent: February 22, 2002 12:40 PM
To: [EMAIL PROTECTED]
Subject: Struts & Turbine


Have any of you out there using Struts & Turbine
framework together? Can share the experience with us?

__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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


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




DO NOT REPLY [Bug 6646] New: - Problem in ConfigRuleSet.java in Nightly Build for 1.1

2002-02-25 Thread bugzilla

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6646

Problem in ConfigRuleSet.java in Nightly Build for 1.1

   Summary: Problem in ConfigRuleSet.java in Nightly Build for 1.1
   Product: Struts
   Version: Nightly Build
  Platform: All
OS/Version: Other
Status: NEW
  Severity: Major
  Priority: Other
 Component: Utilities
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]


I've been working on getting everything working on 1.1 and I think I found 
something wrong in the ConfigRuleSet as it relates to the message-resources 
element. Here is a section of the file starting around line 245:

digester.addSetNext
("struts-config/messageResources",
"setMessageResourcesConfig",
"org.apache.struts.config.MessageResourcesConfig");

I think there are two problems with this. First, shouldn't messageResources be 
message-resources and second, there is no method called 
setMessageResourcesConfig on the ApplicationConfig class that I can see. It's 
called addMessageResourcesConfig, since it can take multiple message resource 
config objects. When I change these two things and recompile, everything works 
like it should. If I don't make these changes, the parameter value that I 
specify in the message-resource element never gets put into the 
MessageResourcesConfig object. 

Chuck Cavaness

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




Bug report for Struts [2002/02/25]

2002-02-25 Thread bugzilla

+---+
| Bugzilla Bug ID   |
| +-+
| | Status: UNC=Unconfirmed NEW=New ASS=Assigned|
| | OPN=ReopenedVER=Verified(Skipped Closed/Resolved)   |
| |   +-+
| |   | Severity: BLK=Blocker CRI=CriticalMAJ=Major |
| |   |   MIN=Minor   NOR=Normal  EHN=Ehnancement   |
| |   |   +-+
| |   |   | Date Posted |
| |   |   |  +--+
| |   |   |  | Description  |
| |   |   |  |  |
|  866|New|Enh|2001-03-06|Clean Way to Add Parameters to Redirecting Forward|
|  905|New|Enh|2001-03-08|Need new mode for html:options for single Collecti|
|  931|New|Enh|2001-03-11|Struts needs to cleanly support running multiple c|
| 1481|New|Enh|2001-04-24|Enhanced resolution of collection property in html|
| 1586|Opn|Nor|2001-05-01|The  tag generates incorrect focus java|
| 1683|New|Enh|2001-05-09|Change Struts tags to be more granular in their de|
| 1797|New|Enh|2001-05-17|Add a way to write out   if data is null |
| 1826|New|Enh|2001-05-20|Dynamic Properties (instead of using the Reflectio|
| 1871|New|Enh|2001-05-23|tag that displays iterate tag index value |
| 1895|New|Enh|2001-05-24|Provide a way to specify xerces and xalan in build|
| 1896|New|Enh|2001-05-24|Store copies of the TLD files in CVS  |
| 2017|Ass|Maj|2001-06-05|Text entered in forms using multi-part/formdata ca|
| 2046|Opn|Enh|2001-06-07|a struts tag within another struts tag|
| 2096|New|Enh|2001-06-09|Change  to use a collection like  calls method to populate se|
| 3212|New|Enh|2001-08-21|Somehow encrypting the data-source password   |
| 3239|New|Nor|2001-08-22|tag properties not exposed to iterator index  |
| 3251|New|Nor|2001-08-23|Struts  on AIX   (Websphere 3.5.3)|
| 3281|New|Nor|2001-08-27|rewrite uses responseUtils.filter |
| 3283|New|Enh|2001-08-27|Adding Multiple Match Logic Equal/notEqual Tags   |
| 3353|New|Enh|2001-08-29|Need More Flexibility Setting/Getting ActionForm P|
| 3465|New|Nor|2001-09-06|FormFile.destroy() doesn't work for temporary file|
| 3485|New|Enh|2001-09-07|How to Chain action   |
| 3783|Unc|Nor|2001-09-23|Uploading MacIntosh files |
| 3789|New|Enh|2001-09-24|ID= attribute |
| 3849|New|Enh|2001-09-26|Enhance template tag to conditionally get contents|
| 4028|New|Nor|2001-10-08|html:radio current value should be converted to st|
| 4095|New|Nor|2001-10-11|html:select should take default value from the pro|
| 4132|New|Enh|2001-10-12|possible problem with GenericDataSource.close |
| 4170|New|Nor|2001-10-15|MaxLengthExceeded doesn't stop file upload|
| |Opn|Enh|2001-10-26|Feature to display errors against individual input|
| 4505|New|Nor|2001-10-29|README doesn't mention necessity of xalan.jar |
| 4744|New|Enh|2001-11-08|Allow Secure Form Submittal with  tag  |
| 4775|New|Nor|2001-11-09|Systemic error in struts - no HTML encoding is per|
| 4776|New|Nor|2001-11-09|ResponseUtils.filter() does not encode the apostro|
| 4792|New|Maj|2001-11-10|logic:messagesPresent tag |
| 4868|New|Min|2001-11-14|FormTag.java styleId attribute conflicting with XH|
| 4929|New|Enh|2001-11-16|nested NullPointerException not defented with igno|
| 4974|New|Nor|2001-11-20|Link to struts-blank.war broken   |
| 5008|New|Min|2001-11-21|GenericeDataSource.getConnection not thread safe  |
| 5023|New|Blk|2001-11-21|html:form does not handle "action" attribute corre|
| 5101|New|Maj|2001-11-26|org.apache.struts.upload.MultipartIterator|
| 5157|New|Min|2001-11-28|logic:iterate attributes inconsistent with rest of|
| 5244|New|Enh|2001-12-03|Declaritive Exception Handling|
| 5263|New|Cri|2001-12-04|Can't build Struts WorkFlow component |
| 5274|New|Maj|2001-12-04|OutOfMemoryError when uploading big files |
| 5286|New|Nor|2001-12-05|struts logic:redirect tag not working |
| 5292|New|Cri|2001-12-05|page attribute in LinkTag does not compute a full |
| 5303|New|Nor|2001-12-06|BaseTag when there is a web server acting as proxy|
| 5342|Unc|Nor|2001-12-10|html:errors tag currently requires errors.header &|
| 5373|New|Enh|2001-12-11|ActionServlet Refactoring |
| 5395|New|Nor|2001-12-12|ActionContext class   |
| 5407|New|Cri|2001-12