ISSUE TRACK PROJECT
Issue track is one of the most useful component of your application. This is very needful for you and your users. Using this application you and your users are able to communicate the problems related to the application and you are able to provide the solution according to the queries of the users.
This is my very first project which I have done . When I was developing this project , I face much more problem. Because first time I was using the latest technology to develop this project. And also first time I was using Spring,Hibernate and Stripes. I was not much more comfortable in this technology. But after completing this project I feel that’s easy.
So in the development period of this project I learn much more thing about how to use Spring , Hibernate and stripes. So here I am sharing the details of this project .
Issue Tracking System is a system by which you are able to get the queries of the users and according to the queries your concerning person are able to send the solution to the users. Here I will tell you in details that how to develop Issue Track management System and I will also share with the great moment that I face when I was developing this project.
So first of all create a New Database in your MySql Database. Because in this project I have used Mysql for database. So firstly create a new database name ISSUETRACKSYSTEM.
Now I am writing the steps here which will be more understandable for you .
- Create a New Database in your MySql Databse named IssueTrackSystem
- Create a New Table in your database named IssueTrackInfo.
- Insert some columns in your table Like(IssueID,ClientId,ClientName,IssueQuery,IssueDetails,IssueRaiseDate,IssueStatus, IssueRaiseDate,IssueSolvedDate etc)
Now also make one more table in your database to store the result that what has been change by the users or admin.So to store the all chages information make another table .
- Create a new table in your database names ChangedIssueTrackInfo.
- Insert some cloumns in your new table
Like(ChangedIssueId,ChangedIssueId,IssueDetails,IssueRaiseDate,IssueStatus etc)
Now you completed the database part. Now you are able to store the Issue Related Information in your database . Because the information is very important to store. If you have the information then any time you are able to search and get the details of the issue related to the concerning users. When any issue will be raised by the users , an issue id will be create and we will be the the issue id to the user and for further changes only issue id is needed for me. According to issue id we will be able to get all the details about the issue.
This is very easy steps. Because to make a database and create a table is very easy. So don’t worry Hibernate , spring and stripes are also very easy. So have fun with these technology . Now I will tell you how to configure and integrate these things in your project
Steps are as follows
- Open Your Net Beans Editor. Go to File—->NewProject——-> New Web Application
- Write Your Project Name IssueTrackInfoSytem
- Click Next
- Select Your Server (Apache Tomcat 6.0.18)
- Click Next
- Select the framework to develop this application
- click on Stripes.1.4.3,Spring Web MVC 2.5,Hibernate 3.2.5
- Click Finish
If you don’t have this framework in your netbeans ide you can download the plugin from web and attach the plugin in the netbeans.
Now You have make a new project named IssueTrackinfoSystem. Now first of all configure your WEB.XML. Because for presentation layer we are using Stripes here. So here stripe will control all the Jsp pages . So the configuration of web.xml is compulsory. It is very simple. And using stripes you are free to handle the jsp page. Stripes will handle all the request . So I think this is a big advantage for us.
The one more best advantage of using stripes framework is that stripes automatically generate the web.xml. Only you have to little bit changes in the stripes web.xml. Only in the Filter mapping of the stripes You have to give action resolver class path of your project. I am writing here the sample snippet for this.
—————————————————————————————————————————-
<init-param>
<param-name>ActionResolver.PackageFilters</param-name>
<param-value>com.pkg.action</param-value>
</init-param>
That’s all , now nothing you have to change in the web.xml. Now you are free to write the nay number of Jsp page . Stripes will handle the all action. You need not worry. That is interesting.
Now come to the next step.
- Create a new java package in your source packages of your project
- Give the name com.pkg.entity.
- Now right click on com.pkg.entity and select Entity class from Database(here note that Hibernate will automatically generate the entity class for you)
- Click on Database connection.
- Select New Database Connection.
- Fill all the details like HostName, Port No, Your DataBase Name,UserName,Password, and give the URL .
- Then click Ok.
- Now you have connected to your database. Your Table name will come then select the table name and add the table. Then Click Next ——> Click finish.
When You will finish this step you will see that a new class has been generated in your com.pkg.entity package.
This is the benefit of Hibernate. As we know that Hibernate is based on Object Relational Mapping.
Here Hibernate automatically generate the getter and setter method for all the entities. This is beneficial for us.
Now make a Data Access Object in your project. We make a DAO package to handle the transaction of our project. For Safe transaction we will create a DAO layer in our project.
Steps are like this:
- Create a new java package named com.pkg.dao.
- Create a new interface called IssueTrackInfoDAO.
- Write some method to handle the transaction likefor persist the date for your further use or remove data etc.
When I was developing my project I have declare this method. My method name is like this.
Public IssuetrackInfo getIssueTrackInfo(int id)
public List<IssueTrackInfo> getIssueTrackInfoList()
public void persistIssueTrackInfo(IssueTrackInfo issueTrackInfo)
public void removeIssueTrackInfo(IssueTrackInfo issueTrackInfo)
Now make another class called IssueTrackInfoDAOImpl in your com.pkg.dao to implement this interface.But here you will have to extend the HibernateDaoSupport and implement IssueTrackInfoDAO. Inside the spring framework of ORM ,there is a class called Hibenatetemplate,which has called getHibernateTemplate .Through this method we are able to handle the database transaction.
Now Make a service layer in this project. This layer is also called the business delegate of our project.
This layer handle all the business logic. This is the controller of our project. Whatever the transaction we will do using Dao will be handled by this layer. So this is the business controller of our project.
So steps are as follows:
- Create a new java package in your source package.
- Give the package name called com.pkg.service.
- Create an interface called IssueTrackService.
- Declare some method to handle the DAO.
In my project I have declare this method. You can make your own method also . Its totally depends upon you.
Public IssueTrackinfo getissueTrackInfo(int id)
public List<IssueTrackInfo> getIssueTrackInfoList()
public void persistIssueTrackInfo(IssueTrackInfo issuetrackinfo)
public void removeIssueTrackInfo(IssueTrackInfo issueTrackInfo)
Now implement this all method in you class. In your implementing class make an object of your DAO class . Because your are going to control of your DAO. So make an object of DAO class and use in your service implementing class.
Now you competed the part of hibernate and spring . You have injected your hibernate in spring. But You have have to inject all the things in the spring config also. Because as we know that Spring follow the properties of IOC(Inversion of Control). This is also called DI(Dependency Injection) . In spring every thing is bean. Spring understand that each and every thing is a bean. Spring inject one or more bean inside a bean. So that we will have to make a spring bean and inject all beans inside the spring beans.
So you must have to inject all the classes and intefaces in the spring config.xml inside beans. The format of spring configuration is like this.
<beans
/* Now insert all the beans inside this tag*/
</beans>
First inject your datasource in the spring beans. Here I am providing the format so that you can understand well.
——————————————————————————————————————-
<bean id=”dataSource”class=”org.springframework.jdbc.datasource.DriverManagerDataSource”>
<property name=”driverClassName”>
<value>com.mysql.jdbc.Driver</value>
</property>
<property name=”url”>
<value>jdbc:mysql://localhost:3306/—–</value>
</property>
<property name=”username”>
<value>Give the value of your database username</value>
</property>
<property name=”password”>
<value>Give the value of your database password</value>
</property>
</bean>
Now Inject your Hibernate Session factory and give the description of your Entity bean annotated class .In this bean inject your all entity class inside the annotated class. Here I am giving you the format which will be much understandable for you. Just think easy. This all configuration is very simple.Only think every thing just like spring, means think every thing is a bean.
<bean id=”sessionFactory” class=”org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean”>
<property name=”dataSource”>
<ref local=”dataSource”/>
</property>
<property name=”annotatedClasses”>
<list>
<value>Your class name full path</value>
</list>
</property>
<property name=”hibernateProperties”>
<props>
<prop key=”hibernate.dialect”>org.hibernate.dialect.MySQLDialect</prop>
<prop key=”hibernate.hbm2ddl.auto”>update</prop>
</props>
</property>
</bean>
—————————————————————————————————————————-
Now your entity bean has been mapped in the spring configuration in the session factory. Now inject the transaction manager for a single hibernate session factory. The format is as follows.
<bean id=”transactionManager” class=”org.springframework.orm.hibernate3.HibernateTransactionManager”>
<property name=”sessionFactory”>
<ref local=”sessionFactory”/>
</property>
</bean>
Now inject the hibernate interceptor. Hibernate interceptor is very necessary in the any project . Because this is used to inspect the code. When you some changes in your code this automatically change or update all the thing in your application
—————————————————————————————————————————-
<bean id=”hibernateInterceptor”
class=”org.springframework.orm.hibernate3.HibernateInterceptor” autowire=”byName”>
</bean>
Now inject your DAO in the spring bean. Because spring understand only bean . So it is compulsory to inject all the thing in this configuration. So here you will have to inject the DAO also.
Here I am writing the format also so that you will be able to understand.
<bean id=”Your Dao name Target” class=”Full path of your DAO class” autowire=”byName”>
</bean>
Now set the property of your Dao in the object and initialise the value of your dao using Spring configuration. The format are as follows.
<bean id=”DAo Object name” class=”org.springframework.aop.framework.ProxyFactoryBean”>
<property name=”proxyInterfaces”>
<value>Path of the Dao object</value>
</property>
<property name=”interceptorNames”>
<list>
<value>hibernateInterceptor</value>
<value>name of the DAO Target</value>
</list>
</property>
</bean>
Now you have injected the Dao but you have to inject your business delegate means your business controller also in the spring configuration. So Inject the service package also in the spring config also.
I am writing the format here also for your ease use.
<bean id=”Object of your service ” class=”full class path of your service Implementation”>
<property name=”Your Dao class Object”>
<ref local=”Your Dao class Object”/>
</property>
</bean>
Now mapped your stripes action bean also in the spring configuration. It is very easy. The stripes action bean handle your front end. This handles your all the action means this handles all the request and dispatch the response according to the request. The format of Stripes action bean are as follows.
————————————————————————————————————————–
<bean id=”object of your action bean” class=”full path of your action bean” scope=”prototype”>
<constructor-arg index=”0″ ref=”object of your business controller”/>
</bean>
Now you have done all the configuration all the spring. Now you are free to handle all the transaction , action or request . Spring will handle all the thing. This is the magic of spring. Using Spring your code will be much easier to handle and also much easier to maintain. The main benefit of spring is that it is easy to maintain. Spring MVC separates the Model ,View and controller in a very clean way. Validation is also very easy in spring.
Now come to the benefits of stripes framework. Stripes framework are used as a view controller of your project. Stripes are only used for presentation layer. The best part of stripes is that it needs little bit of configuration. Programmers are not worry to handle the all jsp pages, stripes will automatically all the jsp page. You need not to configure every time of your jsp and servlet page. Feel free if you are using stripes about the jsp and servlet pages.
Validation is also easy in stripes. Stripes also provide annotation for the validation which is very useful and very easy to use.
So for this project write the all jsp page using stripes. The tags of stripes are very similar to html. It is very easy to use. Only you have to add tag library in your jsp page.
<%@ taglib prefix=”stripes” uri=”http://stripes.sourceforge.net/stripes.tld” %>
You will have to add this tag library in every jsp page. Now use the tag of stripes. And have a fun with stripes world also.
So now lets start to develop your Issue tracking Management System using the latest technology. And have fun with Spring ,Hibernate and spring .
For any further enquiries about this project , just send me a mail on
rakeshraushan01@gmail.com
Thanks,