Logics of Typical Java Based Web Application – Struts Tutorial

Logics of typical java based web application:-

  • Request data gathering logic
  • Form validation logic
  • Business logic or request processing logic
  • Persistence logic
  • Session management logic
  • Presentation logic
  • Middle ware services

Request data gathering logic:-

    It gathers various details from the client generated request being from web resource program like request parameter values (from data) request header values and other miscellaneous details.

  • The process of verifying format and pattern of the form data by using java code / java script code is called as “form validation logic”.

Example– checking whether email id is having not, @symbols or not

  • The main logic of the applications that process the request & generates the results is called as “business logic”.
  • The logic that interacts with d/b s/w and manipulates data base table data  is called as “persistence logic”(ex- jdbc code, hibernate code)
  • The logic that remembers client data across the multiple requests during a session like sign to sign out is called as “session management logic”.

Use session tracking technique for this.

  • Hidden form fields
  • Cookies
  • Http session with cookies
  • Http session with url rewriting.
  • The logic that generate user interface, formats the results given by business logic is called as “presentation logic” (html code).
  •  The additional services that is configurable on the applications to make app. Is perfect & manipulate in all the situations are called as “middle ware services”

Example: – jdbc connection pooling, transaction management, security etc.

Sample Servlet / JSP Program:-

  • Read value 1, value 2 from the page as req param values.(req. data gathering logic)
  • Check whether they are typed as numeric values or not(form validation logic)
  • Int result = value 1 + value 2;(business logic)
  • Store result in D-B s/w(persistence logic)
  • Apply security service(middle ware service )
  • Store form data in cookies(session management)
  • Display result on browser window as table content. (presentation logic)

Java Based Web Application Development & Execution Setup – Struts Tutorial

Java based web application development & execution setup:- 

1) Web server is required to manage & execute web resource programs dynamically and automatically without having any human being support when they are requested by clients. (Browser windows).
2) Based on the place where the web resource programs of web application execute there are two types of web resource programs.

  1. Client side web resource program: comes to browser window from web server for execution.

Example: – html program, JavaScript program, Ajax program.

  1. Server side web resource program: Executes in the web server

Example: – Servelt program, JSP program.

Note: – Decide whether web resource program is client side program or server side program based on the place where it executes not based on the place where it resides.

Java web application development model

  1. Model-I architecture use only servlet/only jsp as server side programs to develop the web application.
  2. Model-II architecture(MVC architecture), This Model divided in to two types 1) MVC 1 architecture, 2) MVC2 architecture
  • While developing MVC1, MVC2 architecture based web application we take the support of multiple technologies in multiple layers of the web application. 
  • MVC2 is industry defecto architecture to develop java based web application architecture gives plan and flow of execution to the programmer to develop the applications.

Java Struts Introduction – Struts Tutorial

J2EE Course – Java Struts Introduction 

Part1 (S.S.H):-

  • Struts 1.x/2.x (pre-requisites: Servlet and JSP)
  • Spring 2.5/3.5 (pre-requisites: Servlet and JSP)
  • Hibernate 3.2/43.4 (pre-requisites: JDBC)

Part2 (RMI-EJB):-

  • RMI
  • JNDI
  • EJB
  • JMS
  • And other j2ee module topics

Part3 (xml-webservices):-

  • Xml (prerequisites: core java)
  • Web Services (prerequisites:  servlets & jsp) & misc

Tools:-

      Ajax, Log4j, ant, cus, Junit, debugging, jasper, reports etc.

A web application is a collection of web resource program and each web resource program generates one web page.
The web application i.e. placed on internet network by purchasing space & domain name (like www.gmail.com) is called as website.
Based on the content generated in the web pages there are two types of web resource programs.

       1. Static web resource programs: generate static web pages (fixed content).

Example: html programs

      2. Dynamic web resource program: generates dynamic web pages.

Example: – Servlet program, JSP program etc.