|
|
Login and User Registration Application

In this tutorial we will learn how to develop login application based on
Struts, Hibernate and Spring Framework. We will be using MySQL database to store
the user information, and then authenticate the user at the login time. You can
easily use this Login application to quick start your application development.
- Simplified Application Development
This tutorial provides an outlook of the alternative lightweight approaches
for building J2EE enterprise based web application by combining all the
three mentioned frameworks e.g. Struts, Hibernate and Spring.
- About this Login Application
This tutorial provides some simple steps for creating a website login
application that can be used later in any big Struts Hibernate and Spring
based application.
=> Login Form
Login Screen our web application allows the user the registered user to
logon to the system.
=> Update Profile
The Update Profile page allows the logged in user to update his/her profile.
Form allows user to change his/her password.
=> Forgot Password
The Forgot Password for allows the retrieve their forgotten password.
- Designing and creating database
Database designing is considered as crucial stage in the development
lifecycle of the web application. The database is finally responsible for
storing the data in the database for retrieval in future.
- Downloading the required software and integration into web application
In this section you will learn how to download required software for our
Login and Registration Application. In this tutorial we are using one of the
best technologies (Struts, Hibernate and Spring).
- Writing POJO and configuration files
We have only one table into the database and we need one POJO class and the
hibernate mapping file to map the login object to the database table.
- Writing Spring Application Context
definition xml
In this section we will wire up the components by defining the Application
context definition file (applicationContext-hibernate.xml). This file is
used by context loader servlet to initialize the Spring application context.
- Configuring the Spring
Context Loader Servlet
In this section we will learn about Spring's Context loader servlet and then
see how to add the required configuration in the web.xml file to load the
Spring Context.
- Understanding Spring Struts
Hibernate DAO Layer
In this section we will understand how Spring Hibernate and Struts will work
together to provide best solution for any web based application.
- DAO Layer explained
In this section we will explain you the DAO Layer of our application.
- Send Mail Bean
In our application we have developed mailer bean that sends welcome email
when a new user is registered to the system. Mail Bean also used when user
asks for the forgotten password.
- Developing User Registration
Form
In this section we will develop user registration form code.
- User Registration Action Class
and DAO code
In this section we will explain how to write code for action class and code
for saving data into database.
- Login Form
In this section we will develop Login Form code for our application.
- Developing Login Action Class
In this section we will explain how to write code for login action class and
database code for validating the user against database.
- Developing Forgot Password Form
In this section we will develop Forgot Password Form code for our
application.
- Developing Forgot Password
Action Class
In this section we will explain how to write code for Forgot Password and
code for emailing the password.
- Update Profile form and action
class
In this section we will learn about update profile logic.
- Compiling and testing the
application
In this application we will compile and deploy the application on tomcat.
- Download Full Source Code
You can download the full source code of the application from here.

|
|
Facing Programming Problem?
|
| Add This
Tutorial To: |
Del.icio.us |
Digg |
Google |
Spurl |
Blink |
Furl |
Simpy |
Y! MyWeb |
|
|
Current Comments
4 comments so far (post your own) View All Comments Latest 10 Comments:can u help me to send the j2ee coding for online examination test and displaying the total score marks
Posted by Anu on Monday, 11.5.07 @ 19:24pm | #35633
Hey BayyannaGoud,
Have u got the idea of how to create getter and setter methods without using ActionForm?? I want to implement the code in ActionClass itself.
Posted by irreversible1983 on Thursday, 10.18.07 @ 14:40pm | #34326
hai
i tried to deploy the file
but we get in jboss these Exceptions
11:58:14,373 INFO [EARDeployer] Init J2EE application: file:/D:/jboss-4.0.5.GA/
server/default/deploy/project.ear
11:58:14,842 ERROR [MainDeployer] Could not initialise deployment: file:/D:/jbos
s-4.0.5.GA/server/default/deploy/project.ear
org.jboss.deployment.DeploymentException: No META-INF/application.xml found
at org.jboss.deployment.EARDeployer.init(EARDeployer.java:133)
at org.jboss.deployment.MainDeployer.init(MainDeployer.java:872)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:809)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
er.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractIntercept
or.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelM
BeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy8.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
tScanner.java:421)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
canner.java:634)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
doScan(AbstractDeploymentScanner.java:263)
at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(A
bstractDeploymentScanner.java:336)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanS
upport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMB
eanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
er.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
ler.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
er.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
er.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractIntercept
or.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelM
BeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
at org.jboss.Main.boot(Main.java:200)
at org.jboss.Main$1.run(Main.java:490)
at java.lang.Thread.run(Thread.java:619)
11:58:14,967 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
--- Incompletely deployed packages ---
org.jboss.deployment.DeploymentInfo@1120aaea { url=file:/D:/jboss-4.0.5.GA/serve
r/default/deploy/project.ear }
deployer: org.jboss.deployment.EARDeployer@8e4805
status: null
state: FAILED
watch: file:/D:/jboss-4.0.5.GA/server/default/deploy/project.ear
altDD: null
lastDeployed: 1187245694842
lastModified: 1187245694373
mbeans:
11:58:15,076 INFO [Http11BaseProtocol] Starting Coyote HTTP/1.1 on http-0.0.0.0
-8080
11:58:15,154 INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009
11:58:15,170 INFO [JkMain] Jk running ID=0 time=0/32 config=null
11:58:15,185 INFO [Server] JBoss (MX MicroKernel) [4.0.5.GA (build: CVSTag=Bran
ch_4_0 date=200610162339)] Started in 23s:931ms
please help in deployment
thank u
Posted by Raghavendra Kumar B on Thursday, 08.16.07 @ 11:58am | #23494
Dear all,
I heard that without using the actionForm still we cal also create the setter and getter method. Is that true? if so how?
I would like to implement the code in ActionClass only without to touch the ActionForm
Posted by BayyannaGOud on Thursday, 07.26.07 @ 13:11pm | #21977