Friday, March 12, 2010 13:03

Posts Tagged ‘Struts2’

Upload files by using Struts2

Monday, December 29, 2008 15:23

The Struts 2 framework provides built-in support for processing file uploads that conform to RFC 1867, "Form-based File Upload in HTML". When correctly configured the framework will pass uploaded file(s) into your Action class. Support ...

This was posted under category: Web MVC  |  Read Full Story  |  0 Comments
Interceptors of Struts 2

Interceptors of Struts 2

Monday, December 29, 2008 15:18

Many Actions share common concerns. Some Actions need input validated. Other Actions may need a file upload to be pre-processed. Another Action might need protection from a double submit. Many Actions need drop-down lists and other controls pre-populated before the ...

This was posted under category: Web MVC  |  Read Full Story  |  0 Comments

Formatting Dates and Numbers in Struts2

Friday, December 19, 2008 8:32

Defining Formats Struts2 supports localization (l10n) aware formatting of dates, times and numbers very easily, utilizing Java's built-in date formatting features. As seen in the Localization chapter, it is quite easy to define hierarchical resource bundles with Struts2, giving the developer the opportunity to define locale dependent message formats. This ...

This was posted under category: Web MVC  |  Read Full Story  |  0 Comments

Accessing application, session, request objects in Struts2

Friday, December 19, 2008 8:29

The framework provides several access helpers to access Session, Application, Request scopes. Accessing from Java All the JEE scope attribute maps can be accessed via ActionContext. Accessing servlet scopes Map attr = (Map) ActionContext.getContext().get("attr"); attr.put("myId",myProp); Map application = (Map) ActionContext.getContext().get("application"); application.put("myId",myProp); Map session = (Map) ActionContext.getContext().get("session"); session.put(...

This was posted under category: Web MVC  |  Read Full Story  |  0 Comments