RE: Modules and common files
I am doing the same with ant/build process, is there any aother way? Is there a way to keep these files in a acommon place? -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED] Sent: , 1 2003 6:15 To: 'Struts Users Mailing List' Subject: RE: Modules and common files Thanks Wendy, but the situation is a little different. They are common resources, not necessarily static resources. Hmmm... in that case, I'd maintain them in one place in the source tree and use the build process to put copies everywhere they're needed. Disk space is cheaper than maintaining custom code, I think. -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management
Re: Modules and common files
I have not done it, but there are definitions in each request processor that can tell whether or not paths are relative. So the struts-config for the module has a request processor element that has global configuration info for the module. sandeep --- [EMAIL PROTECTED] wrote: Hi, We have just started using modules and have run into a problem when it comes to common files between the modules (eg: javascript, stylesheets, images). It appears that all files required for a module must be in that module's directory. Which means that if all modules used the same stylesheet, I would have to duplicate it across each module. I have experimented a little and found that I could make a bunch of context relative global forwards in each module config, but I don't want to have to do that for all the files!! Has anyone else had this problem? If so, what did you do? Regards, Geoff Bennett __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Modules and common files
There were some discussions in the developer list about sharing common properties in modules. A *root* module carries common properties while child modules *inherit* these properties. Wish that could address your problems in the future. It is quite painful to have so many common files. In our product, the common images are placed in one module, and web forms in other modules could use the images by using a term we called module path + file path. The module path is '/' + module prefix + action path in our demos. For strict Struts solutions, you might consider set src attribute in the img tags or use page URL patterns without $M for common files. Jing Netspread Carrier http://www.netspread.com - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 30, 2003 2:32 AM Subject: Modules and common files Hi, We have just started using modules and have run into a problem when it comes to common files between the modules (eg: javascript, stylesheets, images). It appears that all files required for a module must be in that module's directory. Which means that if all modules used the same stylesheet, I would have to duplicate it across each module. I have experimented a little and found that I could make a bunch of context relative global forwards in each module config, but I don't want to have to do that for all the files!! Has anyone else had this problem? If so, what did you do? Regards, Geoff Bennett - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Modules and common files
Geoff wrote: We have just started using modules and have run into a problem when it comes to common files between the modules (eg: javascript, stylesheets, images). Has anyone else had this problem? If so, what did you do? I have Apache serve these static resources. For example, off the main server root there is an 'images' directory. In the Struts app, these links are done as /images/picture.jpg. The leading slash backs up all the way to the server root, and Apache will serve up the .jpg from the images directory. For development, I use Tomcat alone on my desktop. To imitate the Apache/Tomcat setup on the production server, I have placed 'images' in the ROOT webapp. That way no changes are required when I deploy to the Apache/Tomcat setup. If you have many different apps that need their own common files, you could create a directory structure under Apache's document root (or Tomcat's ROOT webapp), maybe /common/thiswebapp/images, or whatever works. This does make deployment a bit more work than just dropping in a .war file, but it could be automated with a script to move the static resources where they belong. HTH, -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University, PA, IRM
RE: Modules and common files
Thanks Wendy, but the situation is a little different. They are common resources, not necessarily static resources. For example: script language=JavaScript src=html:rewrite page= /scripts/utilScript.jsp //script When this line is processed on a jsp we get '/web-context/module-name/scripts/utilScript.jsp' as the src element, but the file actually exists at '/web-context/scripts/utilScript.jsp' for EVERY module. Is there some way to do this besides create our own tag or modify an existing one? Thanks, Geoff Bennett Wendy Smoak [EMAIL PROTECTED] 01/07/2003 07:46 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To 'Struts Users Mailing List' [EMAIL PROTECTED] cc Subject RE: Modules and common files Geoff wrote: We have just started using modules and have run into a problem when it comes to common files between the modules (eg: javascript, stylesheets, images). Has anyone else had this problem? If so, what did you do? I have Apache serve these static resources. For example, off the main server root there is an 'images' directory. In the Struts app, these links are done as /images/picture.jpg. The leading slash backs up all the way to the server root, and Apache will serve up the .jpg from the images directory. For development, I use Tomcat alone on my desktop. To imitate the Apache/Tomcat setup on the production server, I have placed 'images' in the ROOT webapp. That way no changes are required when I deploy to the Apache/Tomcat setup. If you have many different apps that need their own common files, you could create a directory structure under Apache's document root (or Tomcat's ROOT webapp), maybe /common/thiswebapp/images, or whatever works. This does make deployment a bit more work than just dropping in a .war file, but it could be automated with a script to move the static resources where they belong. HTH, -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University, PA, IRM
RE: Modules and common files
Thanks Wendy, but the situation is a little different. They are common resources, not necessarily static resources. Hmmm... in that case, I'd maintain them in one place in the source tree and use the build process to put copies everywhere they're needed. Disk space is cheaper than maintaining custom code, I think. -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management