Tuesday, February 7, 2012 9:11

‘Web MVC’ News

Subscribe to RSS feed
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 ...

Tagged with:

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 ...

Tagged with:

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(...

Tagged with: