You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by vj struts <vj...@yahoo.com> on 2002/05/03 15:25:58 UTC

Now how does one do this?

dear all,

how do you share across different web applications useful ActionForms  you have created
say for example a LogonForm?

i'm using tomcat with its class loader hierarchy which i have read something about in
http://husted.com/struts/FAQ/installation.htm.

if i put them in the common "apps" tomcat directory which is where tomcat suggest
i keep common application classes,  i still get a classnotfound error.

i am thinking this is because the common apps classloader which loads common apps
classes cannot locate the inherited parent ActionForm class which is in struts.jar
 that is safely sitting in the web applications's web-inf/lib folder, away from any access
by the "up" class loaders.

there must be some mistake in how i am thinking about deployment, since i imagine 
you all want to be able to do this without copying the shared struts forms to every web 
application.

regards!

vijay

 

 

 

 



---------------------------------
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness

Re: Now how does one do this?

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On 3 May 2002, Jim Crossley wrote:

> Date: 03 May 2002 14:49:28 -0400
> From: Jim Crossley <jc...@ifleet.com>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> To: Struts Users Mailing List <st...@jakarta.apache.org>
> Subject: Re: Now how does one do this?
>
> "Craig R. McClanahan" <cr...@apache.org> writes:
>
> > In the Tomcat 4 distribution, there is an Application Developer's Guide
> > document that describes some "best practices" at organizing your source
> > code repositories for webapp development, and includes a nice prebuilt Ant
> > build.xml file that illustrates these practices.  If you grab the 4.1.0
> > alpha release, it even includes custom Ant tasks that can deploy and
> > undeploy webapps dynamically, without restarting Tomcat.
>
> Is this the document, Craig?
>
> http://jakarta.apache.org/tomcat/tomcat-4.1-doc/appdev/index.html
>

That's the document all right, although I'm not sure the web version is up
to date with the most recent changes (probably not).

> Or is the one you're describing only available in the dist?
>

Best way to get the most up-to-date version would be to grab a
recent nightly build from:

  http://jakarta.apache.org/builds/jakarta-tomcat-4.0/nightly/

Once you unpack and start Tomcat, the doc will be available at:

  http://localhost:8080/tomcat-docs/appdev/

> -- Jim

Craig


>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Now how does one do this?

Posted by Jim Crossley <jc...@ifleet.com>.
"Craig R. McClanahan" <cr...@apache.org> writes:

> In the Tomcat 4 distribution, there is an Application Developer's Guide
> document that describes some "best practices" at organizing your source
> code repositories for webapp development, and includes a nice prebuilt Ant
> build.xml file that illustrates these practices.  If you grab the 4.1.0
> alpha release, it even includes custom Ant tasks that can deploy and
> undeploy webapps dynamically, without restarting Tomcat.

Is this the document, Craig?

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/appdev/index.html

Or is the one you're describing only available in the dist?

-- Jim

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Now how does one do this?

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Fri, 3 May 2002, vj struts wrote:

> Date: Fri, 3 May 2002 06:25:58 -0700 (PDT)
> From: vj struts <vj...@yahoo.com>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> To: struts-user@jakarta.apache.org
> Cc: ted@husted.com
> Subject: Now how does one do this?
>
>
> dear all,
>
> how do you share across different web applications useful ActionForms
> you have created say for example a LogonForm?
>
> i'm using tomcat with its class loader hierarchy which i have read
> something about in http://husted.com/struts/FAQ/installation.htm.
>
> if i put them in the common "apps" tomcat directory which is where
> tomcat suggest i keep common application classes, i still get a
> classnotfound error.
>
> i am thinking this is because the common apps classloader which loads
> common apps classes cannot locate the inherited parent ActionForm class
> which is in struts.jar that is safely sitting in the web applications's
> web-inf/lib folder, away from any access by the "up" class loaders.
>
> there must be some mistake in how i am thinking about deployment, since
> i imagine you all want to be able to do this without copying the shared
> struts forms to every web application.
>

This is *exactly* what I suggest that you do.  The same principle applies
with shared class libraries.

The reasoning for this is straightforward -- you want each individual
webapp to be as self contained as possible, to minimize deployment time
problems.  For example, what if you need version "x" of a shared component
in one webapp, and version "y" in another webapp, at a particular point in
time.  If you put that component in a shared directory, you're stuck --
you can only have one or the other.  Including it in each webapp
individually gives you the flexibility to migrate each application to use
version "y" at its own pace, without impacting the others.

Now, putting the shared components into each webapp does *not* mean that
you should have duplicate copies of the source code.  Instead, I would
suggest organizing your build system so that each shared comonent is
compiled (and built into a JAR or whatever) in its own directory.  Then,
in the build script for each webapp (which should each be in their own
subdirectories), you would have an "assemble" command or something that
reaches out and grabs the desired versions of each external component that
is needed.

In the Tomcat 4 distribution, there is an Application Developer's Guide
document that describes some "best practices" at organizing your source
code repositories for webapp development, and includes a nice prebuilt Ant
build.xml file that illustrates these practices.  If you grab the 4.1.0
alpha release, it even includes custom Ant tasks that can deploy and
undeploy webapps dynamically, without restarting Tomcat.

Even if you are using a different container, it's worth a look.

> regards!
>
> vijay
>

Craig McClanahan



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>