Tech Info Source
The information resources latest technologies
Sunday, January 28, 2018
Tuesday, February 18, 2014
Struts 1.x Basic Flow
Struts Flow-How Struts Works?
Struts Flow start with ActionServlet then call to process() method of RequestProcessor.
Step 1. Load ActionServlet using load-on-startup and do the following tasks.
Any struts web application contain the ActionServlet configuration in web.xml file.
On load-on-startup the servlet container Instantiate the ActionServlet .
First Task by ActionServlet : The ActionServlet takes the Struts Config file name as an init-param.
At startup, in the init() method, the ActionServlet reads the Struts Config file and load into memory.
Second Task by ActionServlet : If the user types http://localhost:8080/app/submitForm.do in the browser URL bar, the URL will be intercepted and processed by the ActionServlet since the URL has a pattern *.do, with a suffix of "do". Because servlet-mapping is
action
*.do
On load-on-startup the servlet container Instantiate the ActionServlet .
First Task by ActionServlet : The ActionServlet takes the Struts Config file name as an init-param.
At startup, in the init() method, the ActionServlet reads the Struts Config file and load into memory.
Second Task by ActionServlet : If the user types http://localhost:8080/app/submitForm.do in the browser URL bar, the URL will be intercepted and processed by the ActionServlet since the URL has a pattern *.do, with a suffix of "do". Because servlet-mapping is
Third Task by ActionServlet : Then ActionServlet delegates the request handling to another class calledRequestProcessor by invoking its process() method.
Step 2. ActionServlet calls process() method of RequestProcessor.
The RequestProcessor does the following in its process() method:
a) The RequestProcessor looks up the configuration file for the URL pattern /submitForm (if the URL is http://localhost:8080/app/submitForm.do). and and finds the XML block (ActionMapping).
a) The RequestProcessor looks up the configuration file for the URL pattern /submitForm (if the URL is http://localhost:8080/app/submitForm.do). and and finds the XML block (ActionMapping).
ActionMapping from struts-config.xml
name="EmpForm" scope="request" validate="true" input="EmpForm.jsp"> |
b) The RequestProcessor instantiates the EmpForm and puts it in appropriate scope – either session or request.
The RequestProcessor determines the appropriate scope by looking at the scope attribute in the same ActionMapping.
c) RequestProcessor iterates through the HTTP request parameters and populates the EmpForm.
d) the RequestProcessor checks for the validateattribute in the ActionMapping.
If the validate is set to true, the RequestProcessor invokes the validate() method on the EmpForm instance.
This is the method where you can put all the html form data validations.
If Validate fail the RequestProcessor looks for the input attribute and return to JSP page mentioned in input tag.
If Validate pass goto next step.
e) The RequestProcessor instantiates the Action class specified in the ActionMapping (EmpAction) and invokes the execute() method on the EmpAction instance.
The RequestProcessor determines the appropriate scope by looking at the scope attribute in the same ActionMapping.
c) RequestProcessor iterates through the HTTP request parameters and populates the EmpForm.
d) the RequestProcessor checks for the validateattribute in the ActionMapping.
If the validate is set to true, the RequestProcessor invokes the validate() method on the EmpForm instance.
This is the method where you can put all the html form data validations.
If Validate fail the RequestProcessor looks for the input attribute and return to JSP page mentioned in input tag.
If Validate pass goto next step.
e) The RequestProcessor instantiates the Action class specified in the ActionMapping (EmpAction) and invokes the execute() method on the EmpAction instance.
signature of the execute method is
public ActionForward execute(ActionMapping mapping, |
f) In return mapping.findForward("success")
RequestProcessor looks for the success attribute and forward to JSP page mentioned in success tag. i.e success.jsp.
In return mapping.findForward("failure")
RequestProcessor looks for the failure attribute and forward to JSP page mentioned in failure tag. i.e. failure.jsp
RequestProcessor looks for the success attribute and forward to JSP page mentioned in success tag. i.e success.jsp.
In return mapping.findForward("failure")
RequestProcessor looks for the failure attribute and forward to JSP page mentioned in failure tag. i.e. failure.jsp
Saturday, June 22, 2013
Using URL Resources WAS
If one needs to dynamically update the resources on a running applications the below link would definitely help in how to achieve this effect.
http://www.ibm.com/developerworks/websphere/library/techarticles/0502_botzum/0502_botzum.html
Sunday, April 14, 2013
Java- J2EE Design Patterns
Definition of Design Patterns
A design pattern is a general reusable solution to a commonly occurring problem within a given context in software design. A design pattern is not a finished design that can be transformed directly into source or machine code. It is a description or template for how to solve a problem that can be used in many different situations. Patterns are formalized best practices that the programmer must implement themselves in the application.
Extracts of the exact classification of Design Patterns
Design patterns were originally grouped into the categories: creational patterns, structural patterns, and behavioral patterns, and described using the concepts of delegation, aggregation, and consultation. For further background on object-oriented design, see coupling and cohesion, inheritance, interface, and polymorphism. Another classification has also introduced the notion of architectural design pattern that may be applied at the architecture level of the software such as the Model–View–Controller pattern.
Link of important design patterns with examples http://www.javacamp.org/designPattern/index.html
Design patterns reside in the domain of modules and interconnections. At a higher level there are architectural patterns that are larger in scope, usually describing an overall pattern followed by an entire system.
Wednesday, April 11, 2012
Friday, August 6, 2010
Increasing RAD 7.5 performance
An interesting link for fastening the RAD 7.5 startup process ....
https://www.ibm.com/developerworks/wikis/download/attachments/113606723/radtipsv754.pdf?version=1
https://www.ibm.com/developerworks/wikis/download/attachments/113606723/radtipsv754.pdf?version=1
Wednesday, July 21, 2010
Horizontal Scaling Topology
Horizontal scaling topology
Horizontal scaling exists when there are members of an application server cluster on multiple physical machines. Having cluster members on several machines lets a single application span the machines, yet still present a single system image.
The following figure shows an example of horizontal scaling.
In this example, the Web server on Machine B distributes requests to clustered Application Servers on Machines C and D. Cluster members on Machines C and D are created in the same cluster.
You can combine a load balancer to distribute client HTTP requests with clustering, to reap the benefits of both types of horizontal scaling. The Load Balancer topology topic describes this system configuration.
Typical use
Horizontal scaling provides the increased throughput of vertical scaling topologies but also provides failover support. This topology lets you handle Application Server process failure and hardware failure without significant interruption to client service. You can also use horizontal scaling to optimize the distribution of client requests through mechanisms, such as workload management or remote HTTP transport
WAS concepts : node, cell ,cluster
A good explanation of cell node and cluster is provided in the below given link https://itdevworld.wordpress.com/2009/05/03/websphere-c...
-
Liferay Performance Tweaks The aim of this article is to collect performance enhancing tweaks,tips and techniques. ##Lucene Search #Set the ...
-
A good explanation of cell node and cluster is provided in the below given link https://itdevworld.wordpress.com/2009/05/03/websphere-c...