You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by yitzle <yi...@users.sourceforge.net> on 2007/08/09 18:23:09 UTC

MultiPartRequest bean for File Upload missing?

I'm trying to add a file upload to my web app.
When I submit the file, I get:

java.lang.RuntimeException: Unable to load bean
org.apache.struts2.dispatcher.multipart.MultiPartRequest (jakarta) -
[unknown location]

Is there a line I'm missing from my JSP or a lib/jar I need to add or
a setting that needs changing?
Thanks!

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


Re: MultiPartRequest bean for File Upload missing?

Posted by yitzle <yi...@users.sourceforge.net>.
On 8/10/07, Dave Newton <ne...@yahoo.com> wrote:
> --- yitzle <yi...@users.sourceforge.net> wrote:
> > On 8/9/07, Dave Newton <ne...@yahoo.com>
> > wrote:
> > > --- yitzle <yi...@users.sourceforge.net> wrote:
> > > > I had
> > > > <s:form action="CertificateImport" method="POST"
> > > > enctype="multipart/form-data" >
> > > > and tried with
> > > > <form action="CertificateImport.action"
> > > > method="POST"
> > > > enctype="multipart/form-data" >
> > > > When I tried
> > > > <html:form ... > I got
> > > > No tag "form" defined in tag library imported
> > with
> > > > prefix "html"
> > > > even though I have
> > > > <%@ taglib prefix="html" tagdir="/WEB-INF/tags"
> > %>
> > >
> > > I can't imagine that mixing S1 tags into an S2 app
> > > would work particularly well. Perhaps
> extrapolating
> > > from the response as using the enctype in the S2
> > > form tag would be a better idea.
> > Ah... would you mind repeating that in more words?
>
> I personally cannot begin to imagine that the proposed
> solution consisting of the intermixing of custom tags
> from the Struts 1 web application framework within
> your existing Struts 2 application would lead to
> anything resembling success. Instead I would consider
> taking the audacious step of applying common sense to
> the problem and recognize that the original answer to
> your question assumed (incorrectly) the existence of a
> Struts 1 app thereby misrepresenting a potential
> solution to your original question. However, the
> general idea of the (again, incorrect) answer is also
> applicable to your current application environment,
> namely, Struts 2. The application of the spirit of the
> original answer may lead you to a potential solution
> (although I hasten to add that you did indeed find the
> solution regardless of the initially-proposed (albeit
> lacking) solution and my verbosity-lacking response
> which, apparently, instead of being taken as the
> "um... don't just read the answer, think about it"
> reminder as was intended, was instead used as a poor
> launchpad for an ill-conceived attempt at poking fun
> of what was a fairly concise interpretation of my
> feelings at the time.
>
> d.

My response was in no way an attempt to poke fun at you. Due to the
concise nature of your response, I had trouble understanding exactly
what you meant. While brevity is often a good thing, brevity to the
point of ambiguity can be counter productive. My response was simply a
request for a more verbose version of your reply, so that I would
better be able to apply your suggestion.

PS After reviewing your original post and the subsequent post, I think
I understand what you were trying to say in the first post. If you
look at the post of mine to which you replied, you will find that I
already had the enctype which you suggested I add.

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


Re: MultiPartRequest bean for File Upload missing?

Posted by yitzle <yi...@users.sourceforge.net>.
Solved. Found it here:
http://www.jroller.com/yokeping/entry/file_upload_with_struts_2

I had to add two libraries:
commons-fileupload-1.2.jar and commons-io-1.3.jar

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


Re: MultiPartRequest bean for File Upload missing?

Posted by Dave Newton <ne...@yahoo.com>.
--- yitzle <yi...@users.sourceforge.net> wrote:
> On 8/9/07, Dave Newton <ne...@yahoo.com>
> wrote:
> > --- yitzle <yi...@users.sourceforge.net> wrote:
> > > I had
> > > <s:form action="CertificateImport" method="POST"
> > > enctype="multipart/form-data" >
> > > and tried with
> > > <form action="CertificateImport.action"
> > > method="POST"
> > > enctype="multipart/form-data" >
> > > When I tried
> > > <html:form ... > I got
> > > No tag "form" defined in tag library imported
> with
> > > prefix "html"
> > > even though I have
> > > <%@ taglib prefix="html" tagdir="/WEB-INF/tags"
> %>
> >
> > I can't imagine that mixing S1 tags into an S2 app
> > would work particularly well. Perhaps
extrapolating
> > from the response as using the enctype in the S2
> > form tag would be a better idea.
> Ah... would you mind repeating that in more words?

I personally cannot begin to imagine that the proposed
solution consisting of the intermixing of custom tags
from the Struts 1 web application framework within
your existing Struts 2 application would lead to
anything resembling success. Instead I would consider
taking the audacious step of applying common sense to
the problem and recognize that the original answer to
your question assumed (incorrectly) the existence of a
Struts 1 app thereby misrepresenting a potential
solution to your original question. However, the
general idea of the (again, incorrect) answer is also
applicable to your current application environment,
namely, Struts 2. The application of the spirit of the
original answer may lead you to a potential solution
(although I hasten to add that you did indeed find the
solution regardless of the initially-proposed (albeit
lacking) solution and my verbosity-lacking response
which, apparently, instead of being taken as the
"um... don't just read the answer, think about it"
reminder as was intended, was instead used as a poor
launchpad for an ill-conceived attempt at poking fun
of what was a fairly concise interpretation of my
feelings at the time.

d.



      ____________________________________________________________________________________
Park yourself in front of a world of choices in alternative vehicles. Visit the Yahoo! Auto Green Center.
http://autos.yahoo.com/green_center/ 

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


Re: MultiPartRequest bean for File Upload missing?

Posted by yitzle <yi...@users.sourceforge.net>.
On 8/9/07, Dave Newton <ne...@yahoo.com> wrote:
> --- yitzle <yi...@users.sourceforge.net> wrote:
> > I had
> > <s:form action="CertificateImport" method="POST"
> > enctype="multipart/form-data" >
> > and tried with
> > <form action="CertificateImport.action"
> > method="POST"
> > enctype="multipart/form-data" >
> > When I tried
> > <html:form ... > I got
> > No tag "form" defined in tag library imported with
> > prefix "html"
> > even though I have
> > <%@ taglib prefix="html" tagdir="/WEB-INF/tags" %>
>
> I can't imagine that mixing S1 tags into an S2 app
> would work particularly well. Perhaps extrapolating
> from the response as using the enctype in the S2 form
> tag would be a better idea.
>
> d.

Ah... would you mind repeating that in more words?

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


Re: MultiPartRequest bean for File Upload missing?

Posted by Dave Newton <ne...@yahoo.com>.
--- yitzle <yi...@users.sourceforge.net> wrote:
> I had
> <s:form action="CertificateImport" method="POST"
> enctype="multipart/form-data" >
> and tried with
> <form action="CertificateImport.action"
> method="POST"
> enctype="multipart/form-data" >
> When I tried
> <html:form ... > I got
> No tag "form" defined in tag library imported with
> prefix "html"
> even though I have
> <%@ taglib prefix="html" tagdir="/WEB-INF/tags" %>

I can't imagine that mixing S1 tags into an S2 app
would work particularly well. Perhaps extrapolating
from the response as using the enctype in the S2 form
tag would be a better idea.

d.



       
____________________________________________________________________________________
Be a better Globetrotter. Get better travel answers from someone who knows. Yahoo! Answers - Check it out.
http://answers.yahoo.com/dir/?link=list&sid=396545469

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


Re: MultiPartRequest bean for File Upload missing?

Posted by yitzle <yi...@users.sourceforge.net>.
On 8/9/07, Hafeez-ur Rehman <ha...@numetrics.com> wrote:
> Hi,
>
> Add enctype property as form attribute
> <html:form action="someAction.do " enctype="multipart/form-data" >
>
> Hafeez
> -----Original Message-----
> From: anexpert@gmail.com [mailto:anexpert@gmail.com] On Behalf Of yitzle
> Sent: Thursday, August 09, 2007 8:23 AM
> To: Struts Users Mailing List
> Subject: MultiPartRequest bean for File Upload missing?
>
> I'm trying to add a file upload to my web app.
> When I submit the file, I get:
>
> java.lang.RuntimeException: Unable to load bean
> org.apache.struts2.dispatcher.multipart.MultiPartRequest (jakarta) -
> [unknown location]
>
> Is there a line I'm missing from my JSP or a lib/jar I need to add or
> a setting that needs changing?
> Thanks!
>

Thanks for the reply!

I had
<s:form action="CertificateImport" method="POST" enctype="multipart/form-data" >
and tried with
<form action="CertificateImport.action" method="POST"
enctype="multipart/form-data" >
When I tried
<html:form ... > I got
No tag "form" defined in tag library imported with prefix "html"
even though I have
<%@ taglib prefix="html" tagdir="/WEB-INF/tags" %>

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


RE: MultiPartRequest bean for File Upload missing?

Posted by Hafeez-ur Rehman <ha...@numetrics.com>.
Hi,

Add enctype property as form attribute
<html:form action="someAction.do " enctype="multipart/form-data" >

Hafeez
-----Original Message-----
From: anexpert@gmail.com [mailto:anexpert@gmail.com] On Behalf Of yitzle
Sent: Thursday, August 09, 2007 8:23 AM
To: Struts Users Mailing List
Subject: MultiPartRequest bean for File Upload missing?

I'm trying to add a file upload to my web app.
When I submit the file, I get:

java.lang.RuntimeException: Unable to load bean
org.apache.struts2.dispatcher.multipart.MultiPartRequest (jakarta) -
[unknown location]

Is there a line I'm missing from my JSP or a lib/jar I need to add or
a setting that needs changing?
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