struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Mitchell" <jmitch...@apache.org>
Subject Re: Fileupload dependency, https://issues.apache.org/struts/browse/WW-2446
Date Sun, 20 Jan 2008 01:40:53 GMT
(I renamed the subject to attract the attention of any devs who would likely
have something to say about increasing the size of the distribution, but are
probably not following this discussion)

I could be wrong (it's happened in the past, rarely :) , but that setting is
not an out-of-the-box configuration.  It is simply a default setting as to
which multipart request impl to use.

If you create a Struts project and you drop in a <s:file> tag so that you can
have file uploading in your app.  To me this means that you have "decided"
to use File Upload functionality which (again, to me) is the same as
"deciding" to use jasper reports or "deciding" to use the jsf plugin.  Just
because the code for JakartaMultiPartRequest  hasn't been pulled out into
a plugin yet doesn't change the fact that it is an optional dependency.

Also, if you change the properties to use 'pell', then you will see a similar
run-time exception.  Seeing the exception, if you add the struts2-pell-multi-
part-plugin.jar you will still not be able use it.  Why?
             ### Here's the important part ###
-- because the dependency on Pell (from the s2 pell plugin) assumes that
you have already added it to your project (<scope>provided</scope>).

Effectively, this means that you have to tell your [whatever-build-tool-
you-use] that you want to use those jars and you also must either download
them auto-matically (via Maven, Ant<get>, Ivy, whatever).


I think the confusion here is because file upload should be pulled into
it's own plugin.

On Jan 19, 2008 11:51 AM, Dave Newton <newton.dave@yahoo.com> wrote:
> You asked that the discussion be moved to struts-dev, so I did.
>
> S2 *does* have an out-of-the-box configuration; it's in default.properties.
> It uses commons-fileupload, and it won't fail until runtime when using
> <s:file.../>.
>
> While your comment added to the upload interceptor is useful, it should be in
> a {note} that says something along the lines of "the S2 <s:file...> tag will
> not work until you've downloaded the default commons-fileupload dependency"
> and added to the "how do we upload files?" FAQ entry.
>
> This isn't a compile-time dependency; I'll get a runtime error as soon as I
> use <s:file.../> with the default stack (that includes the interceptor).
>
> d.
>
>
> --- James Mitchell <jmitchtx@gmail.com> wrote:
>
> > My comments on this can be found here:
> >  https://issues.apache.org/struts/browse/WW-2446
> >
> > On Jan 19, 2008 11:29 AM, Dave Newton <newton.dave@yahoo.com> wrote:
> > > The <s:file.../> tag depends on an upload dependency being in place.
> > >
> > > The default S2 configuration uses commons-fileupload, which won't work
> > with
> > > the standard distribution, because we don't include fileupload.
> > >
> > > If we don't want to ship fileupload, then we should not make the default
> > S2
> > > configuration use it, because anybody using <s:file.../> will experience
> > > failure at run-time because of the missing dependency.
> > >
> > > AFAIK this is the only situation in S2 where something provided in the
> > > standard distro that isn't a plugin simply won't work until another
> > > dependency is satisfied.
> > >
> > > d.
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: dev-help@struts.apache.org
> > >
> > >
> >
> >
> >
> > --
> > James Mitchell
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> > For additional commands, e-mail: dev-help@struts.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>



-- 
James Mitchell

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


Mime
View raw message