Monday Feb 25, 2008

Localizing field labels in struts 2

A short tip about localizing field labels in your jsp page in struts 2. First off, the message should be present in the message resource bundle. Now how do you read it into the field label?

Here's how:

<s:password label="%{getText('password')}" name="password" />

How does this work?

The framework takes care of this.
In the text filed, the expression %{getText('password')} tells the framework to lookup "password" in the message resources.

Wednesday Feb 20, 2008

Ramblings on Struts 2

Apache Struts is a free open-source framework for creating Java web applications.

Web applications differ from conventional websites in that web applications can create a dynamic response. Many websites deliver only static pages. A web application can interact with databases and business logic engines to customize a response.

One way to separate concerns in a software application is to use a Model-View-Controller (MVC) architecture. The Model represents the business or database code, the View represents the page design code, and the Controller represents the navigational code. The Struts framework is designed to help developers create web applications that utilize a MVC architecture.

The framework provides three key components:

  • A "request" handler provided by the application developer that is mapped to a standard URI.
  • A "response" handler that transfers control to another resource which completes the response.
  • A tag library that helps developers create interactive form-based applications with server pages.

The framework's architecture and tags are buzzword compliant. Struts works well with conventional REST applications.

Here's a really comprehensive set of the underlying and related technologies.

About

manveen

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today