Everyone knows that webwork is simple, flexible and powerful. It is a standard Command pattern framework implementation, and completely separate from the web layer, dedicated to componentization and code reuse of the J2EE Web framework, but you don't know its other A good role, that is, you can also use WEBWORK to achieve file upload, the following will tell you how to use WEBWORK to achieve file upload method.
Webwork data binding using ognl is a very useful function , can avoid the cumbersome call request.getParameter, object setter, do not need any redundant configuration files, plus the function of the converter, we can use a business object, from the front desk to the background, no longer need to consider String Conversion, no DTO, no need for FormBean.
The ability to upload common files on web applications is also done with data binding, so it's perfect: action no longer needs to know any web information. Need to operate on a specific Object, call getObject, you need to operate on the file uploaded by the user, call getFile.
Before webwork 2.1.5, there was a detailed introduction to this problem. After 2.1.5, this interceptor was added to the official release version: com.opensymphony.webwork.interceptor.FileUploadInterceptor
our Action:
Code
we can see that this Action is quite simple, as long as the definition of a File type of property and setter, we can use the File object to any things are a
page and ordinary upload page is no different:
Code
Note that the field names and attributes of the same name Action on it, and the rest The thing is to configure the interceptor: Previous page12Next page Total 2 pages
DirectDraw is part of the DirectX Software Development Kit (SDK) from Microsoft. Because all graphic
After the WinXP system computer starts, prompt to select Start Windows normally or Last time correct
With the increase in the number of days of close contact with the computer, you may encounter such a
After a user installs the Win8.1 system, copying the file to the C drive will resul
Advice for learning - seven tips for learning Linux
How to change WinXP boot screen with third-party software
How can WinXP not display hidden files?
WinXP tracking IP address method
Experts teach you how to use VBA code to quickly enter Excel data
How to quickly fill in IP parameters with WinXP
Easily recover files that were completely deleted with easyRecovery
Printer cannot share the problem under Windows XP
Restore corrupted XP system files
Windows hypervisor command to run a large inventory
Solution for server errors in the "/" application (two cases)
Ways to view and set DNS addresses in Win7 system
Windows 10 desktop and mobile Build 14361 released
Win8 system external screen setting skills
How to use Terminal Services Resources to redirect Windows
Win10 how to cancel "you have installed a new application that can open such files" prompt
Eliminate accidents Remove Win8 login interface power button