RE: OT: Best practice for access to file from multiple web apps

2004-07-21 Thread Jim Barrows

> -Original Message-
> From: Craig McClanahan [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 20, 2004 4:39 PM
> To: Struts Users Mailing List
> Subject: Re: OT: Best practice for access to file from 
> multiple web apps
> 
> 
> On Tue, 20 Jul 2004 15:35:51 -0700, Jim Barrows 
> <[EMAIL PROTECTED]> wrote:
> 
> > We have PDF's that can be created by one webapp, but must 
> also be served by other webapps. 
> 

 

> 
> Is it really any harder than this?  If it is, I must be 
> missing something.

I dunno.. maybe I am  my initial problem with your suggestion was writing the web 
apps to a common directory, however, I had a duh moment from reading the code in the 
tomcat 5 classpath problem thread, and can now solve that.

What you're saying is that if I do something like:
/ear/producerWar creates a pdf and puts it in /ear/producerWar/pdfLoc so it can be 
gotten to using the relative url /producerWar/pdfLoc/pdfIWant/pdf.
Then /ear/consumerWar would use a linke like /producerWar/pdfLoc/pdf, just making sure 
that struts doesn't append /consumerWar to the URL?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: OT: Best practice for access to file from multiple web apps

2004-07-21 Thread Jim Barrows


> -Original Message-
> From: Craig McClanahan [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 20, 2004 4:39 PM
> To: Struts Users Mailing List
> Subject: Re: OT: Best practice for access to file from 
> multiple web apps
> 
> 
> On Tue, 20 Jul 2004 15:35:51 -0700, Jim Barrows 
> <[EMAIL PROTECTED]> wrote:
> 
 

> 
> Is it really any harder than this?  If it is, I must be 
> missing something.

The url part is easy. it's where the file itself gets stored.
/ear/war1
/ear/war2
/ear/pdfStorage

Wars can't see outside their context, so you can't really do what your saying, without 
putting the pdf's in each location.  Given the number and size of the PDF's, this is 
prohibitive.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: OT: Best practice for access to file from multiple web apps

2004-07-20 Thread Craig McClanahan
On Tue, 20 Jul 2004 15:35:51 -0700, Jim Barrows <[EMAIL PROTECTED]> wrote:

> We have PDF's that can be created by one webapp, but must also be served by other 
> webapps. 

Forgive me for coming in late, but it's not obvious to me how big a
problem the "other webapps" part of this really is.  Lets use the term
"consumer webapp" to be the webapp that wants to return the PDF in
response to a request, while the "producer webapp" is the one that
generates it on demand.  (Note that, in a properly designed
environment, no consumer should ever be able to tell whether the PDF
was actually generated on the fly, read from a BLOB, or read from a
file -- all the consumer knows is a URL, and it is up to the producer
to decide what to do.)

The first rule is that the consuming webapp has to know the name of
the PDF that it wants.  You could look this up in a database, if you
wanted it to be dynamic -- but it will typically be a simple relative
URL like "bar.pdf", right?

Next, lets assume the consuming and producing webapps are on the same
server, but distinct from each other.  If the producing webapp has a
context path of "/foo", then the relative URL for this pdf becomes
"/foo/bar.pdf" instead of "bar.pdf" -- again, the host is implicit, so
this URL should work in development, test, and production environments
with no changes as long as producer and consumer are guaranteed to be
on the same machine.

The most general case is where producer and consumer webapps might be
on different servers.  An easy way to generalize this would be to
configure the "root" part of the path (http://myhost/foo) in a context
init parameter (or a JNDI environment variable), and make the consumer
webapp glue that together with the relative path of the pdf in
question on demand.  Then, at most, you have to change one
configuration setting as you migrate from development to test to
production -- and, if you use a JNDI environment variable, the change
is totally external to the WAR file that you're deploying, because you
can configure it using the server's admin tool.

Is it really any harder than this?  If it is, I must be missing something.

Craig

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: OT: Best practice for access to file from multiple web apps

2004-07-20 Thread Andrew Close
well, depending on your build process (and who is in control), setting
up ANT really isn't all that difficult.  and then you can have a
config file for each platform you build to.
i haven't had a chance (or taken the time) to play with Maven yet. 
it's built on top of ANT and apparently adds a lot of other cool
features.
you should check them out.
sorry i don't have more specific help. 

:)


On Tue, 20 Jul 2004 15:47:24 -0700, Jim Barrows <[EMAIL PROTECTED]> wrote:
> 
> 
> > -Original Message-
> > From: Andrew Close [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, July 20, 2004 3:44 PM
> > To: Struts Users Mailing List
> > Subject: Re: OT: Best practice for access to file from
> > multiple web apps
> >
> >
> > Jim,
> >
> > do you use ANT or Maven to build/deploy your projects?  if so you can
> > have them set up a config file for you based on the environment you're
> > building to.
> 
> Nope.. not at the moment.  *SIGH*
> 
> Somewhere in this search for a better way is a rant about doing things that standard 
> way rather then roll your own. but that's for another time and a lot more 
> Guiness..
> 
> 
> 
> >
> > andy
> >
> > On Tue, 20 Jul 2004 15:35:51 -0700, Jim Barrows
> > <[EMAIL PROTECTED]> wrote:
> > > We have PDF's that can be created by one webapp, but must
> > also be served by other webapps.  Obviously, fun is ensuing
> > in trying to figure out the best to avoid hard coding paths,
> > even in a configuration file.  Dev, Test and Production are
> > of course different enought that each environment requires a
> > different configuraion file.
> > > We don't want to take the performance hit of storing the
> > pdf as a blob.  Can't build them on the fly for readonly
> > (these are supposed to be immutable).  can't do cool unix
> > linking tricks ( not on unix, running on AS400s).
> > >
> > >
> > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: OT: Best practice for access to file from multiple web apps

2004-07-20 Thread Jim Barrows


> -Original Message-
> From: Andrew Close [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 20, 2004 3:44 PM
> To: Struts Users Mailing List
> Subject: Re: OT: Best practice for access to file from 
> multiple web apps
> 
> 
> Jim,
> 
> do you use ANT or Maven to build/deploy your projects?  if so you can
> have them set up a config file for you based on the environment you're
> building to.

Nope.. not at the moment.  *SIGH*  

Somewhere in this search for a better way is a rant about doing things that standard 
way rather then roll your own. but that's for another time and a lot more 
Guiness..

> 
> andy
> 
> On Tue, 20 Jul 2004 15:35:51 -0700, Jim Barrows 
> <[EMAIL PROTECTED]> wrote:
> > We have PDF's that can be created by one webapp, but must 
> also be served by other webapps.  Obviously, fun is ensuing 
> in trying to figure out the best to avoid hard coding paths, 
> even in a configuration file.  Dev, Test and Production are 
> of course different enought that each environment requires a 
> different configuraion file.
> > We don't want to take the performance hit of storing the 
> pdf as a blob.  Can't build them on the fly for readonly 
> (these are supposed to be immutable).  can't do cool unix 
> linking tricks ( not on unix, running on AS400s).
> > 
> > 
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: OT: Best practice for access to file from multiple web apps

2004-07-20 Thread Andrew Close
Jim,

do you use ANT or Maven to build/deploy your projects?  if so you can
have them set up a config file for you based on the environment you're
building to.

andy

On Tue, 20 Jul 2004 15:35:51 -0700, Jim Barrows <[EMAIL PROTECTED]> wrote:
> We have PDF's that can be created by one webapp, but must also be served by other 
> webapps.  Obviously, fun is ensuing in trying to figure out the best to avoid hard 
> coding paths, even in a configuration file.  Dev, Test and Production are of course 
> different enought that each environment requires a different configuraion file.
> We don't want to take the performance hit of storing the pdf as a blob.  Can't build 
> them on the fly for readonly (these are supposed to be immutable).  can't do cool 
> unix linking tricks ( not on unix, running on AS400s).
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]