Powered by Blogger.

DownLoad Struts materials..

>> Thursday, December 31, 2009

Download and run in your system...The given examples are not having library files you have to include all the files in your lib folder given in each of the folder or you can copy the files in your server library folder as globally ...not like in each folder in your system..
download library files here

+ Lib files







7. Tiles









16. Loginform

17. PaginationandSortingusingDisplaytag



20. ClientSideValidations



23. flow






AutomatedBallotVote Project on Java

>> Monday, November 16, 2009

Software Engineering Methodology:
Object Oriented Analysis and Design (OOAD Standards)

Software requirements:

           Operating System                 : Windows
           Technology                            : Java/J2EE (JDBC, Servlets, JSP)
           Web Technologies               : Html, JavaScript, CSS
           Web Server                            : Tomcat
           Database                                : Oracle
           Software’s                              : J2SDK1.5, Tomcat 5.5, Oracle 9i

164 Java Interview Questions by Nageswara Rao

>> Friday, August 14, 2009

Dr.R.Nageswara Rao has given some of the Java interview questions in his Core Java Integrated Approach book. These are the questions frequently asked in Java interviews.Go throught these Questions this would be helpful to you..
164 Core Java Interview Questions by Nageswara Rao_JavabynataraJ
If you are already attended any interviews on java you might have faced most of the questions given below. Please leave a comment if you have any queries.

4.6.Example on FormBean Class

>> Friday, July 3, 2009

package p1;
public class RegisterForm extends org.apache.struts.action.ActionForm
String uname,pwd; //FormBean properties
public void setUname(String un)
uname = un;
public string getName()
return uname;
public void setPwd(String pass)
public String getPwd()
return pwd;

4.5.Struts configuration file

>> Sunday, June 21, 2009

The struts-config.xml  file is heart of the struts-application containing FormBean classes,Action classes configuration , the entries in this xml file will be read by framework software.
  • Reading entries of web.xml is the responsibility of under laying web server or application server, application servers are using sax api, sax parser to read and process web.xml file.
  • Struts framework software uses SAX parser, SAX api to read and process struts configuration file.
  • Any "filename.xml" can become struts configuration file but it must be specified as input value to ActionServlet by using its init parameter 'config'.

4.4. Value Objects/Data transfer object class.

>> Wednesday, June 17, 2009

In order to send multiple values from one layer to another layer, it is recommended to combine multiple values into single object and send that object ot destination layer. It is not recommended to send multiple values between two layers foe multiple number of times. The class whose object combines multiple values into single object is called ValueObject class or DataTransferOject class.

  • The implementation of this design pattern reduces round trips between two layers and it also makes easy to receive values only for one time in the destination layer.
  • In struts application FormBean class acts as ValueObject class or DataTransgerObject class. Because multiple values given by form(data means form data) or stored into single object called FormBean class object and this FormBean class object is implicitly visible in the action class execute(). The business logic of execute() uses form data as input values by reading them form FormBean class object.
  • In struts applications Form data of the view layer is visible Action class of modellayer. In the form of FormBean class object.

How ActionServlet acting as a FrontController.in Struts

>> Sunday, June 14, 2009

A special web resource of web application that traps request comming to other web application to execute common and global pre request processing logic by username and password is called "Front Controller".

Servlet acting as a Front-controller , then it is called Front-controller servlet. If JSP is acting as Front-controller then it is called Front-controller JSP.
Action Servlet acting as Front Controller_JavabynataraJ

4.2. Design Patterns

>> Monday, June 8, 2009

Design patterns are set of rules which come as best solutions for reoccurring problems of application development.
Design patterns are the best practices to use software technologies in application development.
Design Patterns:

1.Singleton java class:
Java class that allows to create only one object per JVM is called Singleton java class.
  • Instead of creating multiple objects of a java class having same data. It is recommended to create one object per JVM and using for multiple number of times. This process reduces memory wastage.
  • In MVC architecture based application there must be only one servlet class object acting as Controller. So ActionServlet which is built in ControllerServlet of struts based web applications is given as Singleton java class.
  • Every servlet is a single instance multiple threads components.That means when multiple requests are given to servlet class only one object of Servlet class will be created and multiple threads will be started on that object representing multiple requests.
Q: Servlet(ActionServlet) is a single instance, multiple threads component. Then what is the need of designing ActionServlet as Singleton Java class.?

A: ActionServlet is a built in servlet given by struts Framework spftware as singleton java class.

  • Some web containers of webservers/application servers are violating servlet api-specification principles by creating multiple objects for servlet class in some special situations.
Ex: If a servlet deployed in weblogic server gets more than 300 requests at a time or simultaneously, the web container of weblogic creates second object of servlet class. This i simply violation of servlet specification rule called that servlet is a single instance multiple thread component.

When struts application is deployed in these special servers in order to see only one object of ActionServlet is given as singleton java class.

A Servlet is identified through its url-pattern. We can use one of the three approaches to provide url-pattern for a Servlet.

1.Exact match:
other matchings:


Example url : (valid)
  • http://localhost:8080/wa1/first/xyz
Example url : (invalid)
  • http://localhost:8080/wa1/xyz/first
  • http://localhost:8080/wa1/xyz
  • http://localhost:8080/wa1/first
  • http://localhost:8080/wa1/abc
  • http://localhost:8080/wa1/first/xyz/abc
Note: In Exact match url-pattern * (star) symbol will not be there.

2.Direct match:
  • Direct match url pattern ends with * symbol.
  • url-pattern is to provide the secrecy to servlet by hiding their names.
Example urls(valid):

Example urls(invalid):


3.Extension match:
Extension match url-pattern starts with '*' symbol.

Example urls (valid) :


Example urls (invalid) :


Any extension will be given but it has to match the given URL pattern extension.

We can't frame URL-pattern by mixing up extension match and directly match.Because the underlying web server does not recognize this kind of URL-pattern . Because it is against servlet specification.

Struts Flow and Architecture

>> Saturday, June 6, 2009

Before going to know about Struts Flow and Architecture we get to know What is Struts Frame work? As per simple definition "Struts is an open Source framework, given by Apache Software Foundation, which is used develop MVC2 based web applications in java". Struts contains Validations, I18N(Internationalization and Exception handling features. Because of these three Struts became very popular.

Web.xml entries will be read by WebContainer of WebServer or Application Server software. Struts configuration file entry is will be read by ActionServlet.

WebContainer creates Actionservlet object where as FormBean class object, ActionClass object will be created by ActionServlet.
Struts Flow and Architecture_001

4) . Inner Communication in Struts

>> Friday, May 29, 2009

The communication between files or modules.

1. ActionServlet
2. JSP's
3. Web.xml
4. ActionBeans / FormBean
5. ActionClass
6. ActionForward
7. Struts Configuration file
Inner Communication in Struts will happen_JavabynataraJ

3. Introduction to Struts.

>> Thursday, May 28, 2009


  • TYPE : FrameWork Software to develop web application
  • VERSION : Struts 1.x(1.38) compatable with J2SDK 1.4 , 2.x(2.0.11) compatable with J2SDK 1.5.
  • VENDOR : Apache Foundation
  • Open Source Software
  • Download Software as Zip file from www.apache.org
  • For Help : www.struts.apache.org
  • For FAQs : www.forum.apache.org
  • Author: Craig mccallam
  • Online Tutorials : www.roseindia.com
  • Books : struts 1.x , Jakarta books(O'rielly press)
  • Complet reference of Struts(O'rielly press
  • Struts 2.x, Black Book
Struts 1.x Software.
  • Base Framework Software
  • Puugins
Validator plugins
Tiles plugins
  • Documentaiton
  • JSP Taglibraries
  • Example Applications
Installing Struts software but extracting zip file .(Struts 1.3.8-all.zip)file to a folder.
--> A plugin is a readymade solution configurable with applications.
--> JSP tag library is a library that contains set of readily available JSP tags. Struts 1.x Softwares gives six numberof JSP tag libraries. And these tags are JSP tag libraries are useful to make JSPs of webg applications as java codeless JSPs.
--> To make JSP as Java code less JSPs avoid scripting tags(scriptlet,expression,declaration),tags in JSP programming.

Note 1: Opensource software means not only free softwares , all the sources used to design and devolop a software will be given along with software installation.
Note 2: In strts based webapplications controller servlet is built in servlet and its name is action servlet. ActionServlet is given as HttpServlet.
  • According to java language API is nothing but set of classes and interfaces which come in the form of packages.
  • Struts API means working with classes and interfaces of org.apache.struts.package, and its subpackages.
  • To get help regarding struts-api,JSP tag libraries and XML files of struts use struts-home/docs/index.html file.
// The API given by thirdparty organization(other than sun microsystems) will come as jar files.
  • Struts software is always given by apache foundation, so it is giving struts API in the form of strutshome/lib/struts-core-version.jar file and this jar file is having multiple dependent jar files in the same tag.
  • Struts software installation gives example web application in strutshome/apps folder. The directory where struts software is installed(zip file is extraced) is called struts home directory.
//Setup required for Struts 1.x based application is nothing but developing normal web application by adding struts api support.

2. Introduction to FrameWork

In MVC architecture based webapplication we use JSPs in view Laer servlet in controller Layer. JavaBean, EJB, Spring with Hibernate technologies in model layer.
Q. What happens if interchange technologies of these layers.?
A. We can change rolls of these technologies , but it is not recommended to do.

Reasons: If servlet is taken as view layer component

  • preesntation Logic of the webapplication changes at regulat intervals.
  • If source code of servlet is modified we need to recompile the servlet and we need to reload the webapplication.
  • If Source code of JSP is modified these is no need of recompiling JSP and reloading the webapplication.
  • Since presentation logic of webapplication changes regularly it is recommended to take JSP s as View components.
If JSP is taken as Controller
  • Integration Logic of controller is always java code.
  • Keeping Java Code in JSP is not industry standard.
  • It is always recommended to develop JSP as java codeless JSP.
  • If JSP is taken as controller it will be forced to have java code,representing integration logic which is not a recommended operation.So always prefer taking servlet as controller.
Note.:Only webComponents(Servlets, JSPs) can acts as controller Because they only can take Http request given by browser. So we can't see JavaBean, EJB, Hibernate and spring applications as controller because they can't take Http request.
These application can't act as view Layer application because they are not capable of generating web-pages.
  • If Seperates or another Servlet/JSP is taken as model layer components.
  • Business Logic placed in Servlet/JSP gives following limitations.
  • Allow only HttpClients(browsers) to access the business logic.
  • Business Logic becomes specific to one webapplication(businessLogic is not reusable).
  • Middleware services must be implemented manually.
  • To overcome these problems use EJB, Spring with hibernate to develop business logic of model layer,and take the advantage of reuability of business logic built in middle ware services under capability of allowing all types of java applications as clients(Both Http & Http Clients).
Note: Browsers are called HttpClients. Java application, awt, spring applications are called non HttpClients.

Framework is a special software that is capable of developing applications based on certain architectuere havingg ability to generate common logics of applications devolopment dynamically.
Due to framework software program need not to develop of all the logic of application. He just need to concentrate only on the logics that are specific to our applications.
Strut is a web based frame work software to develop MVC architecture based webapplication having capability of generating integration logic of controller Servlet dynamic calls.
In Struct based webbased application controller servlet is built in servlet and its integration logic will be generated dynamically By struct framework software . So programmer needs to develop only presentation , business logics.
  • Struts framework Software is designed by using servlet JSP technologies has underlaying technologies.
  • In strut based web application, MVC priciple will not be violated , because it experts source code files to programmer according to MVC principles.
  • By using struts frame work software complex operation of web application can be done easily with the support of built in wizards and (Phonics).
  • If web application developed manually with out using framework softwares are based on MVC architecture programmer needs to develop all the applications manually.
  • Compare to mannual implementation of MVC architecture(with out framework software) to develop web applications the framework software based web applications can be developed fastly.
Struts ----> Apache
JSF ----> Sun MicroSystems
Cocoon ----> Adobe
Webwork ----> OpenSymphony
Spring MVC----> Interface21.
TapStray ----> OpenCommunity
ASP.net ----> MicroSoft

Note : All java based webframe work softwares are given based on servlet JSP technologies.

Disadvantages of MVC Architecture

>> Wednesday, May 27, 2009

In the development of MVC architecture based web application not only we need to use multiple technologies , but we also need to use(follow) set of rules in the development of web application. Also for parallel development of application more programmers with knowledge on multiple technologies is required.
Disadvantages of MVC Architecture_JavabynataraJ

Advantages of MVC Architecture

Currently most of the developers are working on MVC (Model,View,Controller) design pattern to develop web applications. Before going to the key points of Advantages of MVC architecture, just recollect the Structure of MVC .Model,View and Controller are the three components to separate logic to reuse entire the application. Developer role will become specific on particular layer and development of application will become easy.
Advantages of MVC Architecture_JavabynataraJ 

1.3. MVC Architecture Layers

In MVC architecture based web-application development multiple layers will be involved like
  • Model layer
  • View layer
  • Controller layer

1.2. Limitations Of Model 1 Architecture

>> Tuesday, May 26, 2009

Since multiple logic's are mixed up in every web resources of web application there are no clean separation of logic's/rolls.

  • Modification done in one logic disturbs other logic of the web application parallel development is not possible due to this productivity is very poor.
  • Maintenance and enhancement of the project is always complex.
  • Programmer will be overburdens because he has to implement middle-ware services along with main logic's.
Advantages : Knowledge servlets of JSP is enough to develop the web-application.
  • Model 1 architecture is not a industry standard to develop the web-application.
  • To overcome the problem of Model 2 architecture use MVC architecture Model 3 architecture to develop the web-application.

1.Web Application introduction.

WebApplication is a collection of web resources like HTML files, JavaScript files, image files Servlets, jsps and etc.

Related Posts Plugin for WordPress, Blogger...
© javabynataraj.blogspot.com from 2009 - 2014. All rights reserved.