开发者

File uploading issue in struts 2

开发者 https://www.devze.com 2023-03-19 20:06 出处:网络
I have an issue when uploading afile in struts 2. I used The encoding type of the jsp form as follows likemultipart/form-data. When I upload a file and click submit button ,struts.xml returns action b

I have an issue when uploading a file in struts 2. I used The encoding type of the jsp form as follows like multipart/form-data. When I upload a file and click submit button ,struts.xml returns action but does not reach the method in action class. This issue comes whether a file upload or not but when using encoding type as multipart/form-开发者_如何学JAVAdata in jsp form.

<form action="createTemp" id="registration" 
name="registration" validate="true" method="post" enctype="multipart/form-data">

Can you please pay your attention to this issue and provide a solution.


All I get from what you say is that the required File variables are missing on the action side i.e. you are having an interceptor issue(not necessarily fileUpload interceptor).

Here is working example on how to upload a file in struts2.

0

精彩评论

暂无评论...
验证码 换一张
取 消