Monday, April 2, 2012

Bridge Design Pattern in java

Decouple implentation from interface and hiding implementation details from client is the essense of bridge design pattern Abstraction – core of the bridge design pattern and defines the crux. Contains a reference to the implementer. Refined Abstraction – Extends the abstraction takes the finer detail one level below. Hides the finer elements from implemetors. Implementer - This interface is the higer level than abstraction. Just defines the basic operations. Concrete Implementation – Implements the above implementer by providing concrete implementation

Friday, March 23, 2012

How the data moves through the struts2 framework

Two most important places this occurs are on the incoming form and the outgoing result page. In the case of the incoming request, the form field name attribute is interpreted as an OGNL expression. The expression is used to target a property on the ValueStack.In this case, the name property from our action. The value from the form field is automatically moved onto that property by the framework. On the other end,the result JSP pulls data off the name property by likewise using an OGNL expression, inside a tag, to reference a property on the ValueStack.

Wednesday, March 21, 2012

JSP Data Caching

For static data generation, this means using the _jspInit() method to generate the content only once, and then calling it back up using _jspService(), rather than using out.print() every time the page is requested. Data generated with _jspInit() will last for the full lifetime of the servlet. You can cache dynamic data using one of the 5 state persistence mechanisms available in JSP - Tomcat's native session persistence mechanism, cookies, URL rewriting, hidden fields, or a JDBC-based session persistence mechanism of your own design. Of these, Tomcat's native session support is easily the highest performer (although it has trouble scaling), followed by hidden fields. A good solution to balance the load between client and server for scalable, secure caching is to use Tomcat's session persistence support to store secure data, and handle everything else with hidden fields.

Saturday, February 11, 2012

Surveying the domain

Six Primary Task A Web Application do While processing requests.These are

■ Binding request parameters to Java types
■ Validating data
■ Making calls to business logic
■ Making calls to the data layer
■ Rendering presentation layer (HTML, and so on)
■ Providing internationalization and localization