File Upload in struts 2 – Java2Blog

 

<?

xml

version

=

“1.0”

encoding

=

“UTF-8”

?>

<

!

DOCTYPE

struts

PUBLIC

   

“-//Apache Software Foundation//DTD Struts Configuration 2.0//EN”

   

“http://struts.apache.org/dtds/struts-2.0.dtd”

>

<

struts

>

   

<

package

name

=

“default”

extends

=

“struts-default”

namespace

=

“/”

>

   

   

<

action

name

=

“fileUpload”

class

=

“org.arpit.javaPostsForLearning.FileUploadAction”

>

   

   

   

<

interceptor

ref

name

=

“fileUpload”

>

   

   

   

   

<

param

name

=

“maximumSize”

>

1048576

<

/

param

>

   

   

   

   

<

param

name

=

“allowedTypes”

>

   

   

   

   

   

image

/

png

,

image

/

gif

,

image

/

jpeg

,

image

/

pjpeg

       

<

/

param

>

   

   

   

<

/

interceptor

ref

>

   

   

   

<

interceptor

ref

name

=

“defaultStack”

>

<

/

interceptor

ref

>

   

   

   

<

result

name

=

“success”

>

uploadSucceed

.

jsp

<

/

result

>

   

   

   

<

result

name

=

“input”

>

fileUpload

.

jsp

<

/

result

>

   

   

<

/

action

>

   

<

/

package

>

<

/

struts

>