You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dan Allen <da...@gmail.com> on 2004/09/03 18:16:57 UTC

[general] managing common files

I want to get some feedback on how other developers handle the
management of certain common files across multiple project trees.

I am developing about a dozen different web modules right now, each
with its own project tree.  However, certain resources are used in all
of the projects, such as build.xml and build.properties.  I would like
to keep these files in CVS, but I don't want the files duplicated in
every single CVS module because a change to one would still require a
syncronization across all the projects.  At the same time, I want the
project tree to be able to stand alone so that it isn't dependent on a
"common" folder.  My question is, where do I store it and how do I get
the most recent version?

The response I most anticipate is to have a target in build.xml that
reaches out to a common directory and pulls the newest version into
the project tree.  Then the common folder will have its own CVS module
and all updates to such common files should occur only in the common
folder and not on the file inside of the particular project which uses
it.  Running the target allows a project tree to be brought "up to
date" ready for export as a standalone project tree.

Am I on the money or is there a better way to handle such resources?

Dan
 
-- 
Open Source Advocacy
http://www.mojavelinux.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Simple log4j.properties HELP

Posted by "David G. Friedman" <hu...@ix.netcom.com>.
>From your log4j.properties file, you should
find more information in the log file 
named under the "rolling" appender which
your .properties file listed as being at:
${catalina.home}/logs/webcontact.log

Regards,
David

-----Original Message-----
From: struts Dude [mailto:scea@slingshot.co.nz]
Sent: Sunday, September 12, 2004 10:34 PM
To: Struts Users Mailing List
Subject: Re: Simple log4j.properties HELP


Hi David,

I don't have this file, no idea where that is supposed to be. I just
drop a log4j.properties file in /WEB-INF/classes of my web app.

Thanks

----- Original Message ----- 
From: "David G. Friedman" <hu...@ix.netcom.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Tuesday, September 07, 2004 2:42 PM
Subject: RE: Simple log4j.properties HELP


> Can you show us your commons-logging.properties file, which should set up
> the sending of log messages to log4j?
>
> Regards,
> David
>
> -----Original Message-----
> From: struts Dude [mailto:scea@slingshot.co.nz]
> Sent: Monday, September 06, 2004 7:31 AM
> To: Struts Users Mailing List
> Subject: Simple log4j.properties HELP
>
>
> Hi guys
> I can't seem to get the following simple log4j.properties file
> to work. I have log4j-1.2.8.jar and commons-logging-1-0-3.jar
> in WEB-INF/lib of my web app.
>
> Also the following log4j.properties in class folder of web app.
>
> ---------
>
> log4j.rootCategory=info, stdout
> log4j.logger.com.template=debug, rolling
>
> log4j.additivity.com.template=false
>
> log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
>
> log4j.appender.stdout.layout.ConversionPattern=%-5p [%t] %c %M- %m%n
>
> log4j.appender.rolling=org.apache.log4j.RollingFileAppender
> log4j.appender.rolling.File=${catalina.home}/logs/webcontact.log
> log4j.appender.rolling.MaxFileSize=300kb
> log4j.appender.rolling.MaxBackupIndex=9
> log4j.appender.rolling.layout=org.apache.log4j.PatternLayout
> log4j.appender.rolling.layout.ConversionPattern=%d{MM/dd/yy hh:mm:ss a}
%-5p
> %C %M- %m%n
>
> ------------
>
> stdout logger seems to work fine but I can't output anything
> to rolling logger. I did create an empty webcontact.log file
> in ${catalina.home}/logs though.
>
> I use tomcat-5.0.27.
>
> Thanks
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Simple log4j.properties HELP

Posted by struts Dude <sc...@slingshot.co.nz>.
Hi David,

I don't have this file, no idea where that is supposed to be. I just
drop a log4j.properties file in /WEB-INF/classes of my web app.

Thanks

----- Original Message ----- 
From: "David G. Friedman" <hu...@ix.netcom.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Tuesday, September 07, 2004 2:42 PM
Subject: RE: Simple log4j.properties HELP


> Can you show us your commons-logging.properties file, which should set up
> the sending of log messages to log4j?
>
> Regards,
> David
>
> -----Original Message-----
> From: struts Dude [mailto:scea@slingshot.co.nz]
> Sent: Monday, September 06, 2004 7:31 AM
> To: Struts Users Mailing List
> Subject: Simple log4j.properties HELP
>
>
> Hi guys
> I can't seem to get the following simple log4j.properties file
> to work. I have log4j-1.2.8.jar and commons-logging-1-0-3.jar
> in WEB-INF/lib of my web app.
>
> Also the following log4j.properties in class folder of web app.
>
> ---------
>
> log4j.rootCategory=info, stdout
> log4j.logger.com.template=debug, rolling
>
> log4j.additivity.com.template=false
>
> log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
>
> log4j.appender.stdout.layout.ConversionPattern=%-5p [%t] %c %M- %m%n
>
> log4j.appender.rolling=org.apache.log4j.RollingFileAppender
> log4j.appender.rolling.File=${catalina.home}/logs/webcontact.log
> log4j.appender.rolling.MaxFileSize=300kb
> log4j.appender.rolling.MaxBackupIndex=9
> log4j.appender.rolling.layout=org.apache.log4j.PatternLayout
> log4j.appender.rolling.layout.ConversionPattern=%d{MM/dd/yy hh:mm:ss a}
%-5p
> %C %M- %m%n
>
> ------------
>
> stdout logger seems to work fine but I can't output anything
> to rolling logger. I did create an empty webcontact.log file
> in ${catalina.home}/logs though.
>
> I use tomcat-5.0.27.
>
> Thanks
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Simple log4j.properties HELP

Posted by "David G. Friedman" <hu...@ix.netcom.com>.
Can you show us your commons-logging.properties file, which should set up
the sending of log messages to log4j?

Regards,
David

-----Original Message-----
From: struts Dude [mailto:scea@slingshot.co.nz]
Sent: Monday, September 06, 2004 7:31 AM
To: Struts Users Mailing List
Subject: Simple log4j.properties HELP


Hi guys
I can't seem to get the following simple log4j.properties file
to work. I have log4j-1.2.8.jar and commons-logging-1-0-3.jar
in WEB-INF/lib of my web app.

Also the following log4j.properties in class folder of web app.

---------

log4j.rootCategory=info, stdout
log4j.logger.com.template=debug, rolling

log4j.additivity.com.template=false

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

log4j.appender.stdout.layout.ConversionPattern=%-5p [%t] %c %M- %m%n

log4j.appender.rolling=org.apache.log4j.RollingFileAppender
log4j.appender.rolling.File=${catalina.home}/logs/webcontact.log
log4j.appender.rolling.MaxFileSize=300kb
log4j.appender.rolling.MaxBackupIndex=9
log4j.appender.rolling.layout=org.apache.log4j.PatternLayout
log4j.appender.rolling.layout.ConversionPattern=%d{MM/dd/yy hh:mm:ss a} %-5p
%C %M- %m%n

------------

stdout logger seems to work fine but I can't output anything
to rolling logger. I did create an empty webcontact.log file
in ${catalina.home}/logs though.

I use tomcat-5.0.27.

Thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Simple log4j.properties HELP

Posted by struts Dude <sc...@slingshot.co.nz>.
Hi guys
I can't seem to get the following simple log4j.properties file
to work. I have log4j-1.2.8.jar and commons-logging-1-0-3.jar
in WEB-INF/lib of my web app.

Also the following log4j.properties in class folder of web app.

---------

log4j.rootCategory=info, stdout
log4j.logger.com.template=debug, rolling

log4j.additivity.com.template=false

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

log4j.appender.stdout.layout.ConversionPattern=%-5p [%t] %c %M- %m%n

log4j.appender.rolling=org.apache.log4j.RollingFileAppender
log4j.appender.rolling.File=${catalina.home}/logs/webcontact.log
log4j.appender.rolling.MaxFileSize=300kb
log4j.appender.rolling.MaxBackupIndex=9
log4j.appender.rolling.layout=org.apache.log4j.PatternLayout
log4j.appender.rolling.layout.ConversionPattern=%d{MM/dd/yy hh:mm:ss a} %-5p
%C %M- %m%n

------------

stdout logger seems to work fine but I can't output anything
to rolling logger. I did create an empty webcontact.log file
in ${catalina.home}/logs though.

I use tomcat-5.0.27.

Thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Ibatis and cocurrent user management questions

Posted by struts Dude <sc...@slingshot.co.nz>.
Hi,
Ok I really shud ask this at ibatis forum but since
many here seem to work with ibatis, i give it a shot 
here.

How do I register some kind of listener with ibatis
so that if data in a table, say, Users, change, 
ibatis will notify struts application?

The scenario I am trying to solve is when a logged
in admin is managing users, I wud like my application
to be notified of changes made by other also logged
in admin, so my struts code can issue a new call
to ibatis to get fresh data to show the admin.

I guess the other way of solving this problem is to
deny other admin trying to change table when another admin has
logged in before him. Can I do this kind of thing
with ibatis or is this something I have to do on
Struts code?

What's the usual practice of showing the number of
users and who is currently logged in a Struts 
application?

I can think of writing a class with public static
int variable and a List variable, whenever a user logged 
in, +1 to int var, add username to List. Doing opposite
if user log out, dunno if that's how u ppl do it.

Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [general] managing common files

Posted by Craig McClanahan <cr...@gmail.com>.
On Fri, 3 Sep 2004 12:16:57 -0400, Dan Allen <da...@gmail.com> wrote:
> I want to get some feedback on how other developers handle the
> management of certain common files across multiple project trees.
> 
> I am developing about a dozen different web modules right now, each
> with its own project tree.  However, certain resources are used in all
> of the projects, such as build.xml and build.properties.  I would like
> to keep these files in CVS, but I don't want the files duplicated in
> every single CVS module because a change to one would still require a
> syncronization across all the projects.  At the same time, I want the
> project tree to be able to stand alone so that it isn't dependent on a
> "common" folder.  My question is, where do I store it and how do I get
> the most recent version?
> 
> The response I most anticipate is to have a target in build.xml that
> reaches out to a common directory and pulls the newest version into
> the project tree.  Then the common folder will have its own CVS module
> and all updates to such common files should occur only in the common
> folder and not on the file inside of the particular project which uses
> it.  Running the target allows a project tree to be brought "up to
> date" ready for export as a standalone project tree.
> 
> Am I on the money or is there a better way to handle such resources?
> 
> Dan

One approach I've seen to this issue lets you have the primary
benefits of sharing common resource files like this, but also allows
limited forms of customization in a way that feels like subclassing a
Java class.

Instead of sharing the build.xml file itself, the idea is to share
subordinate build scripts that contain common targets ... say
"build-common.xml".  Then, for each project that needs to share the
common targets, you'd provide a "starter" version of build.xml (as
part of a project template or something) that included the code to
pull over the build-common.xml file (in an "init" target of some
sort), and had prebuilt versions of all the targets which simply
delegate to the common version:

    <target name="compile" depends="...">
        <ant antfile="build-common.xml" target="compile" inheritAll="true"/>
    </target>

Now, by default, individual projects are sharing all the guts of the
common tasks, but you are free to customize a little if needed ...
either by setting properties in the project's own file (the inheritAll
setting passes them on), or by inserting Ant tasks before and/or after
the call to the delegated target -- or, in rare cases, you might need
to completely replace the common target with different logic, and skip
the delegation call.

If you've ever glanced at Maven, you'll probably recognize this as the
fundamental design pattern Maven encourages - a common repository for
all the targets (although Maven calls them goals), with the ability to
decorate using preGoal and postGoal settings.  You have to buy into
Maven as a whole if you want to use it, though; but it's possible to
emulate this particular concept by carefully crafted Ant build.xml
files that use delegation.

Craig

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org