Saturday, March 5, 2011

Struts2, Tiles2, Spring, Hibernate, JQuery plugin - General Considerations

Struts2, Tiles2, Spring, Hibernate, JQuery plugin - General Considerations

Disclaimer:
All the software applications that appear below represent trademarks and they are the property of their respective owners.
Use and implement my notes in this article at your own risk.

The following topics are discussed:
1. General Considerations - overview of the subject;
2. Prerequisites - what you need to setup a JEE MVC app;
3. Installation - installation of the tools needed (platforms, IDEs, aso);
4. Assembly librairies - setting up the used JEE librairies;
5. Configuration - setting up the JEE app;
6. MySQL database - database description;
7. Considerations;

1. General Considerations:
This section gives you some hints in how to setup a JEE application that uses Struts2, Tiles2, Spring, Hibernate and JQuery plugin for Struts2 as a MVC (Model View Controller) web app.
It is also used as a basis configuration for the next samples posted on this blog, namely:
"Struts2, Tiles2, Spring, Hibernate, JQuery plugin - Linked Autocompleters",
"Struts2, Tiles2, Spring, Hibernate, JQuery plugin - Using TreeView",
"Struts2, Tiles2, Spring, Hibernate, JQuery plugin - Linked Dialogs",
"Struts2, Tiles2, Spring, Hibernate, JQuery plugin - Linked JQGrids",
"Struts2, Tiles2, Spring, Hibernate, JQuery plugin - Using JODReports for ODT Templates",
"Struts2, Tiles2, Spring, Hibernate, JQuery - DisplayTag Plugin",
"Struts2, Tiles2, Spring, Hibernate, JQuery Plugin - Tabbed Panel".

So, as the samples say, we will deal with specific approaches for: JQuery Autocompleter, JQuery TreeView, JQuery Dialog and JQuery JQGrid.

2. Prerequisites:
2.1 Operating System;
2.2. Java;
2.3. Development IDE;
2.4. Tomcat 7;
2.5. Struts2 Framework;
2.6. Spring 3.0.5 Framework;
2.7. Hibernate 3.6.0;
2.8. MySQL 5;
2.9. MySQL Connector;
2.10. JQuery;
2.11. Logging errors;
2.12. JSON;

2.1. Operating System
I used WinXP SP3 for this sample, but you may use any OS on which you may install Java Virtual Machine.

2.2. Java
You will need Java JDK 1.6.0_x. Go download'it from Oracle website.

2.3. Development IDE
You may use Netbeans, Eclipse with WTP, MyEclipse, aso.
In my case, I used MyEclipse for Spring v. 8.6.

Generally speaking, you will need an IDE that supports JEE, not only JSE.

2.4. Tomcat 7
I used Apache Tomcat 7 as web container, but you may use any web servers that supports JEE deployments.

2.5. Struts2 Framework
I used Struts v. 2.2.1 with Tiles v. 2.2.2.
You need to download latest Struts2 Framework librairies, so google for'em;
Also, google for the latest Tiles2 librairies, as they will be used, too.

2.6. Spring 3.0.5 Framework

I used Spring v. 3.0.5
You need to download latest Spring Framework librairies, so google for'em;

2.7. Hibernate 3.6.0
Hibernate v. 3.6.0 was used, so, google it.

2.8. MySQL 5
I used MySQL 5, as I have it configured on the machine, but you may use any database support with the condition to configure the database connection driver.
Download MySQL 5 from Oracle, together with a visual database manager for MySQL; I used MySQL Administrator, but you may find others: Workbench, Heidi, Navicat, aso.

2.9. MySQL Connector
I used mysql-connector-java-5.1.14-bin.jar
Also, for Tomcat you may need: tomcat-jdbc.jar

2.10. JQuery

You will need the JQuery plugins for Struts2:
struts2-jquery-plugin-2.5.0.jar
struts2-jquery-grid-plugin-2.5.0.jar

Also, you will need other JQuery components:
JQuery UI theme: ui-lightness
jquery.treeview.js
jquery.treeview.async.js
jquery.cookie.js

2.11. Logging errors
log4j-1.2.16.jar
jul-to-slf4j-1.6.1.jar
log4j-over-slf4j-1.6.1.jar
slf4j-simple-1.6.1.jar

2.12. JSON

JSON plugin struts-2.2.1/lib/struts2-json-plugin-2.2.1.jar from Struts 2.2.1 will be used to form Struts2 action result, but you will also need a JSON parser: json-org.jar

3. Installation
Once you downloaded all the above, you'll have to install:
- Java JDK; install to default specified location;
- Apache Tomcat 7 - install to default location; use the default specified port (8080) for tomcat HTTP web connector;
- Development IDE - install to specified location;
- MySQL - download to specified default location; use the default specified port (3306) for MySQL service database connectivity; also install the MySQL database manager (Administrator, Workbench, Heidi, aso) to default specified location;

Note: if installed, do not install again.

4. Assembly librairies
After you downloaded all the above, and installed the items at 3), a good approach is to keep'em the Java librairies in their directories, in order to have access to their sources for debug purposes.
Anyhow, you should have these on the application library path:
    Hibernate 3.6.0
        hibernate-distribution-3.6.0.Final/hibernate3.jar
        hibernate-distribution-3.6.0.Final/lib/required/antlr-2.7.6.jar
        hibernate-distribution-3.6.0.Final/lib/required/slf4j-api-1.6.1.jar
        hibernate-distribution-3.6.0.Final/lib/required/dom4j-1.6.1.jar
        hibernate-distribution-3.6.0.Final/lib/required/javassist-3.12.0.GA.jar
        hibernate-distribution-3.6.0.Final/lib/required/jta-1.1.jar
        hibernate-distribution-3.6.0.Final/lib/bytecode/cglib/cglib-2.2.jar
        hibernate-distribution-3.6.0.Final/lib/jpa/hibernate-jpa-2.0-api-1.0.0.Final.jar
   
    Spring 3.0.5
        spring-framework-3.0.5.RELEASE/dist/org.springframework.aop-3.0.5.RELEASE.jar
        spring-framework-3.0.5.RELEASE/dist/org.springframework.asm-3.0.5.RELEASE.jar
        spring-framework-3.0.5.RELEASE/dist/org.springframework.aspects-3.0.5.RELEASE.jar
        spring-framework-3.0.5.RELEASE/dist/org.springframework.beans-3.0.5.RELEASE.jar
        spring-framework-3.0.5.RELEASE/dist/org.springframework.context-3.0.5.RELEASE.jar
        spring-framework-3.0.5.RELEASE/dist/org.springframework.context.support-3.0.5.RELEASE.jar
        spring-framework-3.0.5.RELEASE/dist/org.springframework.core-3.0.5.RELEASE.jar
        spring-framework-3.0.5.RELEASE/dist/org.springframework.expression-3.0.5.RELEASE.jar
        spring-framework-3.0.5.RELEASE/dist/org.springframework.instrument-3.0.5.RELEASE.jar
        spring-framework-3.0.5.RELEASE/dist/org.springframework.instrument.tomcat-3.0.5.RELEASE.jar
        spring-framework-3.0.5.RELEASE/dist/org.springframework.jdbc-3.0.5.RELEASE.jar
        spring-framework-3.0.5.RELEASE/dist/org.springframework.jms-3.0.5.RELEASE.jar
        spring-framework-3.0.5.RELEASE/dist/org.springframework.orm-3.0.5.RELEASE.jar
        spring-framework-3.0.5.RELEASE/dist/org.springframework.oxm-3.0.5.RELEASE.jar
        spring-framework-3.0.5.RELEASE/dist/org.springframework.transaction-3.0.5.RELEASE.jar
        spring-framework-3.0.5.RELEASE/dist/org.springframework.web-3.0.5.RELEASE.jar
        spring-framework-3.0.5.RELEASE/dist/org.springframework.web.servlet-3.0.5.RELEASE.jar
        spring-framework-3.0.5.RELEASE/dist/org.springframework.web.struts-3.0.5.RELEASE.jar
   
    Struts 2.2.1
        struts-2.2.1/lib/xwork-core-2.2.1.jar
        struts-2.2.1/lib/aopalliance-1.0.jar
        struts-2.2.1/lib/classworlds-1.1.jar
        struts-2.2.1/lib/commons-beanutils-1.7.0.jar
        struts-2.2.1/lib/commons-chain-1.2.jar
        struts-2.2.1/lib/commons-collections-3.2.jar
        struts-2.2.1/lib/commons-digester-2.0.jar
        struts-2.2.1/lib/commons-fileupload-1.2.1.jar
        struts-2.2.1/lib/commons-io-1.3.2.jar
        struts-2.2.1/lib/commons-lang-2.3.jar
        struts-2.2.1/lib/commons-logging-1.0.4.jar
        struts-2.2.1/lib/commons-logging-api-1.1.jar
        struts-2.2.1/lib/commons-validator-1.3.1.jar
        struts-2.2.1/lib/freemarker-2.3.16.jar
        struts-2.2.1/lib/json-lib-2.1-jdk15.jar
        struts-2.2.1/lib/ognl-3.0.jar
        struts-2.2.1/lib/sslext-1.2-0.jar
        struts-2.2.1/lib/struts2-convention-plugin-2.2.1.jar
        struts-2.2.1/lib/struts2-core-2.2.1.jar
        struts-2.2.1/lib/struts2-embeddedjsp-plugin-2.2.1.jar
        struts-2.2.1/lib/struts2-json-plugin-2.2.1.jar
        struts-2.2.1/lib/struts2-spring-plugin-2.2.1.jar
        struts-2.2.1/lib/struts2-tiles-plugin-2.2.1.jar
        struts-2.2.1/lib/oro-2.0.8.jar
        struts-2.2.1/lib/velocity-tools-1.3.jar
        struts-2.2.1/lib/velocity-1.6.3.jar
   
    Tiles 2.2
        tiles-2.2.2/tiles-ognl-2.2.2.jar
        tiles-2.2.2/tiles-servlet-2.2.2.jar
        tiles-2.2.2/tiles-api-2.2.2.jar
        tiles-2.2.2/tiles-core-2.2.2.jar
        tiles-2.2.2/tiles-jsp-2.2.2.jar
        tiles-2.2.2/tiles-template-2.2.2.jar
        tiles-2.2.2/tiles-el-2.2.2.jar

Note: Not all of the above are required, but is better to have references to all the vendor distributed packages.
Note: Besides the above, you will also need the librairies from 2.7. -> 2.10 on the app path.

5. Configuration
Following JEE web app architecture, you will configure:
5.1. JEE app;
5.2. web.xml;
5.3. struts.xml;
5.4. tiles.xml;
5.5. applicationContext.xml;
5.6. context.xml;
5.7. log4j.properties;

5.1. JEE app
With your IDE development, create a new JEE project; name it "blogac".
Under "blogac" you should have:
- the "src" directory, in which will reside all your Java code;
- the "META-INF" directory that will store the connection file (context.xml) to the database via the MySQL JDBC driver and the MANIFEST.MF project descriptor file;
- the "WEB-INF" directory that will store the web dependecy files: librairies (lib subfolder), web.xml, applicationContext.xml, tiles.xml;
- other web used subfolders: css, js, images, aso;

Basically, the structure should look like in the image below taken from MyEclipse for Spring IDE:
JEE project structure:



5.2. web.xml
This is the web app descriptor, located under "WEB-INF" application directory:
<<
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
      version="3.0" metadata-complete="true">
     
    <session-config>
        <session-timeout>30</session-timeout>
    </session-config>
     
      <filter>
        <filter-name>hibernateFilter</filter-name>
        <filter-class>blog.filters.HibernateFilter</filter-class>
        <init-param>    
             <param-name>singleSession</param-name>      
             <param-value>true</param-value>  
        </init-param> 
        <init-param>
            <param-name>sessionFactoryBeanName</param-name>
            <param-value>sessionFactory</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>hibernateFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping> 
         
      <filter>
          <filter-name>struts2</filter-name>
          <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
      </filter>
      <filter-mapping>
          <filter-name>struts2</filter-name>
          <url-pattern>/*</url-pattern>
      </filter-mapping>
 
    <listener>
       <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
    </listener>     
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <listener>
        <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
    </listener>
    <listener>
        <listener-class>org.apache.tiles.web.startup.simple.SimpleTilesListener</listener-class>
    </listener>
       
      <welcome-file-list>
        <welcome-file>index.html</welcome-file>
      </welcome-file-list>
</web-app>

>>
In this file there are configured filters and listeners for: hibernate, struts2, spring, log4j, tiles and the welcome file "index.html".

5.3. struts.xml
This is the configuration file of the Struts 2 Framework, located under "src" application directory:
<<
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
    <constant name="struts.objectFactory" value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
    <constant name="struts.objectFactory.spring.autoWire" value="type" />
    <constant name="struts.enable.DynamicMethodInvocation" value="false" />
    <constant name="struts.devMode" value="true" />
    <constant name="struts.convention.result.path" value="/jsp"/>
    <constant name="struts.convention.action.packages" value="blog.actions"/>
    <constant name="struts.convention.classes.reload" value="false" />

    <package name="blog-struts" extends="struts-default" namespace="/">
        <result-types>
            <result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult" />
        </result-types>
    </package>

</struts>

>>
Here are specified: the DTD for struts2, the communication between Struts2 and Spring, debug mode, annotation convention for Struts2 actions, package types for Struts2 action, tiles result.

5.4. tiles.xml;
Here is the layout configuration of Tiles, located under "WEB-INF" app directory.
For start you put just these:
<<
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 2.1//EN" "http://tiles.apache.org/dtds/tiles-config_2_1.dtd">

<tiles-definitions>
    <definition name="site.definition" template="/jsp/siteDefinition.jsp" />

    <definition name="page.index" extends="site.definition">
        <put-attribute name="title" value="blog" />
        <put-attribute name="header" value="/jsp/header.jsp" />
        <put-attribute name="content" value="/jsp/index.jsp" />
        <put-attribute name="footer" value="/jsp/footer.jsp" />
    </definition>

    <definition name="page.empty" extends="page.index">
        <put-attribute name="content" value="/jsp/empty.jsp" />
    </definition>

</tiles-definitions>

>>
Practically, you defined a layout with: header, content and footer that refers firstly to "/jsp/index.jsp" page and will be used as a tiles template; then, another page will extend this template by substituting the "content" page with "/jsp/empty.jsp". Later, you may add other pages that will use tiles for the View.

5.5. applicationContext.xml
This is the Spring configuration file, located unde "WEB-INF" directory. It describes how Spring uses Hibernate to connect to the database.
To have Spring and Hibernate configured, you will need at least these:
<<
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:p="http://www.springframework.org/schema/p"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:tx="http://www.springframework.org/schema/tx"   
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">

    <context:annotation-config/>
    <context:component-scan base-package="blog" />

    <bean id="dsBlog" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiName" value="java:comp/env/jdbc/dsBlog" />
        <property name="resourceRef" value="true" />
    </bean>
   
    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
        <property name="dataSource" ref="dsBlog" />
        <property name="packagesToScan"> 
               <list>
                <value>blog.hibernate.dao.**.*</value>
               </list> 
          </property>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</prop>
                <prop key="hibernate.max_fetch_depth">3</prop>
                <prop key="hibernate.show_sql">false</prop>
            </props>
        </property>
    </bean>
        
    <bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
        <property name="sessionFactory" ref="sessionFactory" />
    </bean>   
   
    <tx:annotation-driven transaction-manager="txManager" />
</beans>

>>
So, you specified here: the DTDs used to verify Spring persistence, Spring AOP, Spring transactions, Spring annotations context; which package to scan the Spring annotations; the bean that will look for the database objects (JNDI); the session factory that will use the JNDI bean to create Spring management of the Hibernate sessions over the Hibernate annotated entities; the Spring transaction manager that will use the session factory.

5.6. context.xml

This is located under "META-INF" folder and will configure the MySQL JDBC driver for MySQL database:
<<
<?xml version="1.0" encoding="UTF-8"?>
<Context reloadable="false">
    <Resource
        auth="Container"
        name="jdbc/dsBlog"
        type="javax.sql.DataSource"
        factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
        driverClassName="org.gjt.mm.mysql.Driver"
        url="jdbc:mysql://localhost:3306/blog"
        username="root"
        password=""
        defaultAutoCommit="true"
        defaultReadOnly="false"
        defaultTransactionIsolation="READ_COMMITTED"
        jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer"
        fairQueue="false"
        maxActive="200"
        initialSize="20"  
        maxIdle="30"  
        minIdle="20"  
        maxWait="10000"  
        removeAbandoned="true"  
        removeAbandonedTimeout="300"
        testOnBorrow="true"
        testOnReturn="false"
        testWhileIdle="false"
        minEvictableIdleTimeMillis="30000"  
        timeBetweenEvictionRunsMillis="30000"          
        validationInterval="30000"
        validationQuery="select 1" />
</Context>

>>
You probably will not need all the properties in the resource above, so you'll have to google for the MySQL JDBC driver connectivity documentation.

5.7. log4j.properties
This is located under "src" app directory and will configure log4j to log the app errors:
<<
log4j.rootLogger=ERROR, dest1
log4j.appender.dest1=org.apache.log4j.DailyRollingFileAppender
log4j.appender.dest1.File=${catalina.home}/logs/blog.log
log4j.appender.dest1.DatePattern='.'yyyy-MM-dd
log4j.appender.dest1.layout=org.apache.log4j.PatternLayout
log4j.appender.dest1.layout.ConversionPattern=[%5p] [%t] %d{dd.MM.yyyy HH:mm:ss} %c (%F:%M:%L)%n%m%n%n

log4j.logger.blog=ERROR

log4j.logger.org.springframework=ERROR
log4j.logger.org.springframework.security=ERROR
log4j.logger.org.hibernate=ERROR
log4j.logger.org.apache=ERROR

>>
So, only ERROR type events will be logged to "${catalina.home}/logs/blog.log"; log4j will be used later by slf4j to log the individual errors of Spring, Hibernate, JDBC, aso.

6. MySQL database
The database used in the following samples, namely "blog", contains 3 tables: zone, country, city. These tables are linked by foreign keys that will create a correspondence of the kind - zones include countries and countries include cities.
Use the following script to create the MySQL "blog" database from MySQL command line prompt:
<<
CREATE DATABASE IF NOT EXISTS blog;
USE blog;


DROP TABLE IF EXISTS `zone`;
CREATE TABLE `zone` (
  `cod` varchar(4) NOT NULL,
  `name` varchar(45) NOT NULL,
  PRIMARY KEY  (`cod`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `zone` (`cod`,`name`) VALUES
 ('AS','Asia'),
 ('EU','Europe'),
 ('NA','North America'),
 ('SA','South America');


DROP TABLE IF EXISTS `country`;
CREATE TABLE `country` (
  `cod` varchar(4) NOT NULL,
  `name` varchar(45) NOT NULL,
  `cod_zone` varchar(4) NOT NULL,
  PRIMARY KEY  (`cod`),
  KEY `FK_country_zone` (`cod_zone`),
  CONSTRAINT `FK_country_zone` FOREIGN KEY (`cod_zone`) REFERENCES `zone` (`cod`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `country` (`cod`,`name`,`cod_zone`) VALUES
 ('AG','Argentina','SA'),
 ('BR','Brasil','SA'),
 ('CA','Canada','NA'),
 ('CN','China','AS'),
 ('DE','Germany','EU'),
 ('FR','France','EU'),
 ('GR','Greece','EU'),
 ('RU','Russia','AS'),
 ('US','United States','NA');

DROP TABLE IF EXISTS `city`;
CREATE TABLE `city` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `cod_country` varchar(4) NOT NULL,
  `name` varchar(45) NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `FK_city_country` (`cod_country`),
  CONSTRAINT `FK_city_country` FOREIGN KEY (`cod_country`) REFERENCES `country` (`cod`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=latin1;


INSERT INTO `city` (`id`,`cod_country`,`name`) VALUES
 (1,'DE','Berlin'),
 (2,'DE','Dortmund'),
 (3,'DE','Munchen'),
 (4,'FR','Paris'),
 (5,'FR','Marseille'),
 (6,'FR','Bordeaux'),
 (7,'GR','Athens'),
 (8,'GR','Thesaloniki'),
 (9,'GR','Larissa'),
 (10,'US','Seattle'),
 (11,'US','New York'),
 (12,'US','Detroit'),
 (13,'US','Los Angeles'),
 (14,'CA','Toronto'),
 (15,'CA','Montreal'),
 (16,'CA','Vancouver'),
 (17,'BR','Janeiro'),
 (18,'BR','Brasil'),
 (19,'AG','Aires'),
 (20,'RU','Moscow'),
 (21,'RU','Stalingrad'),
 (22,'RU','Petersburg'),
 (23,'CN','Beijing'),
 (24,'CN','Nanjang');
>>

7. Considerations

Having all the above installed and configured, you may start to develop a JEE web app, under the MVC (Model View Controller) architecture, by using Hibernate annotated entities as Model, Struts2 + Tiles2 + JQuery as View, Struts2 for actions (Controller level) and Spring for managing the business components.

23 comments:

  1. Hi,

    Thanks A lot, I got the code, but there is some problem - compile time error for
    //public class HibernateFilter extends OpenSessionInViewFilter {

    here OpenSessionInViewFilter class is not identified by the compiler, please mention which jar is required for this, though i have put all required jars. Thanks Once again :)

    ReplyDelete
  2. hi nikh,

    i sent you via email an explanation for this;
    if you didn't received it, then checkout: http://static.springsource.org/spring/docs/1.2.x/api/org/springframework/orm/hibernate3/support/OpenSessionInViewFilter.html. The class should be in your spring framework distrib. In the "4. assembly librairies", it should be this: "org.springframework.orm-3.0.5.RELEASE.jar"

    ReplyDelete
  3. Hi, Thanks for the post,
    I used Strut2 jquery tree plugin. Tree us getting poluated but it is not using theme. How to configure path for jquery tree plugin to use default theme. and where to copy *.js files in eclipse.

    Thanks,
    tania

    ReplyDelete
  4. Hi Tania,

    the templates folder for jquery UI should be here:
    \blogtree\WebRoot\template\themes\ui-lightness

    The ui-lightness is then used in the main JSP file; in my sample this JSP is siteLayout.jsp (a file that also describes how the Tiles2 is used further in app).
    The line that sets the jquery UI theme is:
    <sj:head loadAtOnce="true" compressed="false" jqueryui="true" jquerytheme="ui-lightness" customBasepath="template/themes" loadFromGoogle="false" debug="true" />
    As you see, the customBasepath="template/themes" attribute tells jquery UI where to find the templates.

    You should also know that the "WebRoot" folder is specific to eclipse (myEclipse), so, if other IDE used, then this folder may not exist or may be named differently; if eclipse used, then the internal maven of eclipse will know how to compile the files in WebRoot.
    If you still have problems, then give me a valid email to forward you the code.

    ReplyDelete
  5. Hi vsorinel
    Really good work ..
    I very happy when i found this blog i was goggling for the integration of struts2+spring3 with annotations i was helpless but this blog helped me a lot,could u provide me some action and service class's my email is ghantaramaseshu@gmail.com

    Thanks
    seshu.

    ReplyDelete
  6. Hi bro plz mail me the source code of this example
    plz plz ..

    ReplyDelete
  7. Hi seshu, I just sent you an archive with a sample; to use annotations you'll need "org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean", checkout the section "5.5. applicationContext.xml" and also the archive I sent you.

    ReplyDelete
  8. Please mail me the source code to aficionado@aol.in

    ReplyDelete
  9. @aficionado: here I posted only the binary versions of the libs I used; for their source code, you'll have to google at their respective owners; also, I cannot send you even the binaries, because of their size: 550MB; checkout your mail, where I sent you the source code requested at the treeView.

    ReplyDelete
  10. Dear vsorinel,

    Thanks for sharing. I'm searching the integration of these frameworks for a while.
    Would you please share sample source and configuration files? My email chanro@gmail.com

    Thanks a lot.

    ReplyDelete
  11. please share the code. My email id is h5cnov1@gmail.com

    ReplyDelete
  12. Can you email me the code?. My email id is wliu223@gmail.com. THanks.

    ReplyDelete
  13. hi wliu, done (check mail on yahoo account).

    ReplyDelete
  14. Hi,

    Excellent example and exactly what i was looking for. But unfortunately, i am still have problems in running the project. Can you please email the code to me @ haroon.chaudhry1@gmail.com

    ReplyDelete
  15. Hi, I do think this is an excellent blog. I stumbledupon it ;) I am going to return yet again since i have bookmarked it.
    Money and freedom is the best way to change, may you be rich and continue to guide other
    people.
    My website :: buy-provillus-site.wetpaint.Com

    ReplyDelete
  16. Hi, checked your project and trying to implement the same for my requirement. I have used spring hibernate tiles framework.. but at a loss with this framework. please provide a sample *.war with all files of your sample. It would be highly appreciable. My email id is gupta.sushantkumar@gmail.com

    ReplyDelete
  17. Hi all,
    I know there were guys that wanted the code and probably I couldn't send them the code in useful time. First of all I want to apologize to all these guys.
    Second, due to latest activity, I really have no time to maintain this blog, so I want you guys understand I CANNOT SEND THE CODE ANYMORE.
    In this case, you have 2 solutions:
    1) the main aspects for each sample are already posted on respective topics; practically, if you read the "general considerations" and the related topics, you will not need the code; you just need to configure a new app and paste there the code from the topics;
    2) if you really want the code, then ALL THE GUYS THAT PUT THEIR EMAILS ON THE COMMENTS ABOVE HAVE RECEIVED THE CODE; so, if I cannot respond, then maybe they can ;) in fact, it is a distributable code, isn't it ? ;)
    I hope you guys understand the above, thanx, vsorinel.

    ReplyDelete
  18. put the code on git repo?

    ReplyDelete
  19. Nice blog to learn Spring and Struts integration. But as always jar dependency are the vital point in any of this project. Can anyone send me the code with sample db file included. mail me atonuhere@gmail.com

    ReplyDelete
  20. HI,
    Thank you for this tutorial, please send me the source code to my email : akramakom@gmail.com
    thanks lot.

    ReplyDelete