Upload an image/file in Struts2,
October 21, 2009 at 10:01 PM
It become easier and much simpler in struts2. Keep a member in your action as class MyAction { File myImage; getMyImage(File myImage) { this.myImage = myImage; }
getMyImage() return myImage; }
In your JSP <s:form action="imageLoader" method="post" enctype="multipart/for-data"> <s:file name="myImage" label="Upload your image: " /> <s:submit /> </s:form>
View All Comments
| View Tutorial