java2db

How to integrate Jsp , Struts 2 and hibernate 4 ( Login example )



Jsp , struts 2 example in eclipseJSP (JavaServer Page) :

How to integrate Jsp , Struts 2 and hibernate 4 ( Login example ) JavaServer Page allows programmer to embed java code directly in the HTML code.
How to integrate Jsp , Struts 2 and hibernate 4 ( Login example ) Jsp can call custom java classes (taglibs) with HTML-like tags.
Jsp , struts 2 example in eclipse Separates both dynamic content(java code) and presentation(HTML code) of a Web page.

 

Jsp , struts 2 example in eclipse Struts 2 :

Jsp , struts 2 example in eclipse Apache struts is an open source Java EE framework to develop web applications.It supports modelviewcontroller (MVC) architecture.It is a widely used framework for application development.

Jsp , struts 2 example in eclipse Struts framework comes in the form of jar files , so add struts jar files to the lib folder.

  Hibernate 4 :

How to integrate Jsp , Struts 2 and hibernate 4 ( Login example ) Hibernate is an object-relational mapping (ORM)  framework and it is a free software.

Jsp,Servlet and JDBC integration example Hibernate’s primary feature is mapping from Java classes to database tables (ie From Java data

types to SQL data types) and  it provides data query and retrieval facilities.

Jsp,Servlet and JDBC integration example Hibernate provides an SQL language called Hibernate Query Language (HQL) which allows SQL-like queries to be written against Hibernate’s data objects.

Jsp,Servlet and JDBC integration example Require Java 6 or higher version (building Hibernate from source requires JDK 7 due to a bug in the JDK 6  compiler).

 

How to integrate Jsp , Struts 2 and hibernate 4 ( Login example ) Basic requirements for Jsp , Struts 2 and hibernate 4 example .

 

Softwares :
Java (Download).
MySQL Database (Download).
GlassFish server (Download).
Eclipse IDE (Download).
Struts 2 Jar files: (Download).
commons-fileupload-1.3.1.jar  (Download)
commons-io-2.2.jar  (Download)
commons-lang3-3.1.jar  (Download)
commons-logging-1.1.3.jar  (Download)
commons-logging-api-1.1.jar  (Download)
freemarker-2.3.19.jar  (Download)
javassist-3.11.0.GA.jar  (Download)
ognl-3.0.6.jar  (Download)
struts2-core-2.3.16.3.jar  (Download)
xwork-core-2.3.16.3.jar  (Download)
Hibernate 4 Jar files:
javax.servlet.jar (Download).
javax.servlet.jsp.jar (Download).
antlr-2.7.7.jar (Download).
dom4j-1.6.1.jar (Download).
hibernate-commons-annotations-4.0.5.Final.jar (Download).
hibernate-core-4.3.6.Final.jar (Download).
hibernate-jpa-2.1-api-1.0.0.Final.jar (Download).
jandex-1.1.0.Final.jar (Download).
javassist-3.18.1-GA.jar (Download).
jboss-logging-3.1.3.GA.jar (Download).
jboss-logging-annotations-1.2.0.Beta1.jar (Download).
jboss-transaction-api_1.2_spec-1.0.0.Final.jar (Download).
mysql-connector-java-5.1.6.jar (Download).
Source files :
login.jsp  
UserAuthentication.java  
User.java  
web.xml  
hibernate.cfg.xml  
Mapping.hbm.xml  
struts.xml  
home.jsp  
error.jsp

 

 

 

How to integrate Jsp , Struts 2 and hibernate 4 ( Login example ) Complete Directory Structure in Eclipse :

Create a dynamic web project in any IDE and copy the below source code to appropriate files .
How to integrate Jsp , Struts 2 and hibernate 4 ( Login example )

 

Jsp , struts 2 example in eclipse Source code  for Jsp , Struts 2 and hibernate 4 example :

Jsp,Servlet and JDBC integration example login.jsp

Jsp,Servlet and JDBC integration example UserAuthentication.java :

Jsp,Servlet and JDBC integration example User.java

Jsp,Servlet and JDBC integration example web.xml

Jsp,Servlet and JDBC integration example hibernate.cfg.xml

Jsp,Servlet and JDBC integration example Mapping.hbm.xml

Jsp,Servlet and JDBC integration example struts.xml

Jsp,Servlet and JDBC integration example home.jsp

Jsp,Servlet and JDBC integration example error.jsp

Jsp,Servlet and JDBC integration example Create the table , insert the below data in MySQL database.

Below , we are creating the table under default “mysql ” data base, if you want , you can create an another database(Example : mydb) and change the database name “mysql” to “mydb” .

Jsp,Servlet and JDBC integration example Execution :

Output :

 




Related Posts :
Call database in Jsp (Access Oracle , MySQL , PostgerSQL ,Db2 from Jsp)
How to integrate Struts 2 and Hibernate 5 (Login example)
Jsp , struts 2 example in eclipse (Struts login application )
Jsp Servlet and Hibernate 4 login example in Eclipse
Jsp , Servlet and JDBC login application example in NetBeans
Jsp-Servlet example in Eclipse,NetBeans and MyEclipse
How to send email in java ,jsp and servlet
   [will not be published]



^ <