SSH注意点:
1.maven的POM文件内容:Jetty
2.SSH配置文件:jdbc.properties、log4j.properties、spring.xml、struts.xm
3.Sort:jdbc.properties/log4j.properties/Pom.xml-->Web.xml-->spring.xml
-->struts.xml-->TestEntity.java-->TestAction.java-->ITestDao.java-->TestDaoImpl.java-->DBCommon.java-->LogPrint.java-->test.jsp
4.web.xml暂时有缺陷,没有设置sping.xml的加载优先级(在spring的xml文件内引入其他关于spring的配置——》点击打开链接)
5.spring.xml/struts.xml暂时有缺陷,没有设置加载其他配置文件(在spring的xml文件内引入其他关于spring/struts的配置——》点击打开链接)
6.DBCommon暂时有缺陷(待续)
Summary:ssh是由spring来管理,所以得类都要配置或注解形式交给Spring管理,sqsession关闭后不能直接再开启
Server To Jsp
➀ActionContext.getContext().put("testEntity", entity);---------<s:property value="#testEntity.t_char"/>
jdbc.properties
driver=com.mysql.jdbc.Driver
url=jdbc:mysql://localhost:3306/hrms
username=root
password=root
#\u5B9A\u4E49\u521D\u59CB\u8FDE\u63A5\u6570
initialSize=0
#\u5B9A\u4E49\u6700\u5927\u8FDE\u63A5\u6570
maxActive=20
#\u5B9A\u4E49\u6700\u5927\u7A7A\u95F2
maxIdle=20
#\u5B9A\u4E49\u6700\u5C0F\u7A7A\u95F2
minIdle=1
#\u5B9A\u4E49\u6700\u957F\u7B49\u5F85\u65F6\u95F4
maxWait=60000
log4j.properties
log4j.rootLogger=INFO,Console,File,STDOUT,warn
#Log Print Config At Console
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.Target=System.out
#Log Print Content Layout At Console
log4j.appender.Console.layout = org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS}<%-5p> [%c] - %m%n
#Console Print Debug of Information
log4j.category.com.cn.xt = debug
#Log File Store Config
log4j.appender.File = org.apache.log4j.RollingFileAppender
#Log File Store Place
log4j.appender.File.File = D:/Log/XpressThink.log
#Log File Storage MaxSize
log4j.appender.File.MaxFileSize = 10MB
#Log File Content Layout
log4j.appender.File.Threshold = ALL
log4j.appender.File.layout = org.apache.log4j.PatternLayout
log4j.appender.File.layout.ConversionPattern =[%p] [%d{yyyy-MM-dd HH\:mm\:ss}][%c]%m%n
Maven(依赖):
<!--Important: SSH Core Start-->
<properties>
<!-- All Coding -->
<!-- Framework Version -->
<struts.version>2.5.10</struts.version>
<spring.version>4.3.8.RELEASE</spring.version>
<hibernate.version>5.1.7.Final</hibernate.version>
</properties>
<!--Important: SSH Core End-->
<dependencies>
<!-- Important: SSH Dependence -->
<!-- Junit依赖 -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- Spring Utils -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.7</version>
</dependency>
<!-- Spring 核心依赖 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- Spring web依赖 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- Spring整合ORM框架依赖 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- Struts2 核心依赖 -->
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>${struts.version}</version>
</dependency>
<!-- Struts2和Spring整合依赖 -->
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
<version>${struts.version}</version>
</dependency>
<!-- Struts2和Spring注解 -->
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-convention-plugin</artifactId>
<version>2.5.14.1</version>
</dependency>
<!-- Hibernate 核心依赖 -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate.version}</version>
</dependency>
<!-- MySQL 依赖 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.42</version>
</dependency>
<!-- C3P0 依赖 -->
<dependency>
<groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.5</version>
</dependency>
<!-- AspectJ依赖 -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.8.10</version>
</dependency>
<!-- SLF4J依赖 -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.25</version>
</dependency>
<!-- 导入java ee jar 包 -->
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
</dependency>
</dependencies>
<build>
<finalName>ssh-bulid</finalName>
<plugins>
<!-- 配置加入jetty服务器,开发时我们一般使用jetty服务器 -->
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
<connectors>
<!-- Http 访问 -->
<!-- <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>8081</port> 访问端口,默认8080 </connector> -->
<!-- Https 访问(配置keyStore) -->
<!-- <connector implementation="org.eclipse.jetty.server.ssl.SslSelectChannelConnector">
<port>9443</port> <password>123456</password> </connector> -->
<!-- Jetty有一个问题,默认使用nio连接会把资源文件(html, css)锁定,解决方案是把nio改为bio -->
<connector implementation="org.eclipse.jetty.server.bio.SocketConnector">
<port>8082</port>
</connector>
<!-- Https(配置keyStore) -->
<!-- <connector implementation="org.eclipse.jetty.server.ssl.SslSocketConnector">
<port>8443</port> <password>123</password> </connector> -->
</connectors>
<!-- 设置扫描target/classes内部文件变化时间间隔 -->
<scanIntervalSeconds>2</scanIntervalSeconds>
<!-- 设置工程访问路径 -->
<webApp>
<contextPath>/ssh</contextPath><!-- 包含服务器访问路径+工程(名)访问路径 -->
</webApp>
</configuration>
</plugin>
<!-- compiler插件, 设定JDK版本 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<showWarnings>true</showWarnings>
</configuration>
</plugin>
<!-- war打包插件, 设定war包名称不带版本号 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<warName>winssage</warName>
</configuration>
</plugin>
<!-- eclipse插件, 设定wtp版本 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>false</downloadJavadocs>
<wtpversion>2.0</wtpversion>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>install</id>
<phase>install</phase>
<goals>
<goal>sources</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- 用于支持跨模块加载配置文件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<configuration>
<encoding>UTF-8</encoding>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>dll</nonFilteredFileExtension>
<nonFilteredFileExtension>so</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration>
</plugin>
</plugins>
</build>
Web.xml
<web-app>
<display-name>Archetype Created Web Application</display-name>
<!-- Global Core configure for SSH -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring.xml</param-value>
</context-param>
<!-- Core configure for Struts of Web -->
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- openSessionInView配置 作用是延迟session关闭到view层 -->
<filter>
<filter-name>openSessionInViewFilter</filter-name>
<filter-class>org.springframework.orm.hibernate5.support.OpenSessionInViewFilter
</filter-class>
<init-param>
<param-name>singleSession</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>openSessionInViewFilter</filter-name>
<url-pattern>/</url-pattern>
</filter-mapping>
<!-- 防止spring内存溢出监听器 -->
<!-- <listener>
<listener-class>org.springframework.web.util.IntrospectorCleanupListener
</listener-class>
</listener> -->
<!-- Core configure for Spring of Web -->
<!-- Core configure for Session of Web -->
<session-config>
<session-timeout>600</session-timeout>
</session-config>
<!-- Core configure for Else of Web -->
</web-app>
spring.xml
<?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:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd">
<context:annotation-config />
<!-- 开启包扫描,并注册注解 -->
<context:component-scan base-package="ssh.build.cyj.*" />
<!-- 引入DB属性文件 (两种形式)-->
<!-- <context:property-placeholder location="classpath:jdbc.properties"
/> -->
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:jdbc.properties</value>
</list>
</property>
</bean>
<!-- 配置C3P0连接池 -->
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<!-- 数据库连接相关信息 -->
<property name="jdbcUrl" value="${url}" />
<property name="driverClass" value="${driver}" />
<property name="user" value="${username}" />
<property name="password" value="${password}" />
</bean>
<!-- 配置Hibernate的SessionFactory -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
<!-- 注入连接池 -->
<property name="dataSource" ref="dataSource" />
<!-- 配置Hibernate属性 -->
<property name="hibernateProperties">
<props>
<prop key="hibernate.show_sql">true</prop><!-- 是否展示SQL -->
<prop key="hibernate.format_sql">true</prop><!-- Sql Of Format -->
<prop key="hibernate.use_sql_comments">true</prop><!-- Use Sql Comment -->
<prop key="hibernate.hbm2ddl.auto">update</prop><!-- 是否自动创建表结构 -->
<prop key="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</prop>
<prop key="javax.persistence.validation.mode">none</prop>
</props>
</property>
<!--自动扫描实体类(配置) -->
<property name="packagesToScan" value="ssh.build.cyj.entity" />
<!-- 扫描并加载注解过的实体类 -->
<!-- <property name="mappingLocations"> <list> <value>classpath:ssh/build/cyj/entity/*.hbm.xml</value>
</list> </property> -->
</bean>
<!-- <bean id="testDaoImpl" class="cn.cyj.ssh.daoImpl.TestDaoImpl"> <property
name="sessionFactory" ref="sessionFactory"></property> </bean> -->
<!-- 配置事务管理器 -->
<bean id="transactionManager"
class="org.springframework.orm.hibernate5.HibernateTransactionManager">
<!-- 注入SessionFactory -->
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<!-- 配置事务增强 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<!-- 配置需要进行事务管理的方法,和事务传播行为 -->
<tx:method name="save*" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
<tx:method name="delete*" propagation="REQUIRED" />
</tx:attributes>
</tx:advice>
<!-- 配置切面 -->
<aop:config>
<!-- 配置切入点 com.yjq.ssh.*.service.*+.*(..) * org.ssh.service.*+.*(..) *:表示方法的作用域,*表示所有
org.ssh.service.*:表示org.ssh.service下的任何包 org.ssh.service.*+:表示org.ssh.service下的任何包及其子包
*(..):*表示任何方法,(..)表示方法的任何参数 -->
<aop:pointcut id="pointcut"
expression="execution(* com.yjq.ssh.service.*+.*(..))" />
<!-- 适配切入点和事务增强 -->
<aop:advisor advice-ref="txAdvice" pointcut-ref="pointcut" />
</aop:config>
</beans>
struts.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
<!-- 指定由spring负责action对象的创建 -->
<constant name="struts.objectFactory" value="spring" />
<!-- 所有匹配*.action的请求都由struts2处理 -->
<constant name="struts.action.extension" value="action" />
<!-- 是否启用开发模式 -->
<constant name="struts.devMode" value="true" />
<!-- struts配置文件改动后,是aa否重新加载 -->
<constant name="struts.configuration.xml.reload" value="true" />
<!-- 设置浏览器是否缓存静态内容 -->
<constant name="struts.serve.static.browserCache" value="false" />
<!-- 请求参数的编码方式 -->
<constant name="struts.i18n.encoding" value="utf-8" />
<!-- 每次HTTP请求系统都重新加载资源文件,有助于开发 -->
<constant name="struts.i18n.reload" value="true" />
<!-- 文件上传最大值 -->
<constant name="struts.multipart.maxSize" value="104857600" />
<!-- 让struts2支持动态方法调用 -->
<constant name="struts.enable.DynamicMethodInvocation" value="true" />
<!-- Action名称中是否还是用斜线 -->
<constant name="struts.enable.SlashesInActionNames" value="false" />
<!-- 允许标签中使用表达式语法 -->
<constant name="struts.tag.altSyntax" value="true" />
<!-- 对于WebLogic,Orion,OC4J此属性应该设置成true -->
<constant name="struts.dispatcher.parametersWorkaround" value="false" />
<!-- 默认访问页面 -->
</package>-->
<!-- 引入资源文件 -->
<constant name="struts.custom.i18n.resources" value="messageResource"></constant>
</struts>
TestEntity.java
package ssh.build.cyj.entity;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity(name = "test_tb")// 当表名和实体类名不一致时设置
public class TestEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private int id;
@Column(name = "t_char")
private String t_char;
@Column(name = "t_bit")
private boolean t_bit;
@Column(name = "t_date")
private Date t_date;
/**
* @return the id
*/
public int getId() {
return id;
}
/**
* @param id
* the id to set
*/
public void setId(int id) {
this.id = id;
}
/**
* @return the t_char
*/
public String getT_char() {
return t_char;
}
/**
* @param t_char
* the t_char to set
*/
public void setT_char(String t_char) {
this.t_char = t_char;
}
/**
* @return the t_bit
*/
public boolean isT_bit() {
return t_bit;
}
/**
* @param t_bit
* the t_bit to set
*/
public void setT_bit(boolean t_bit) {
this.t_bit = t_bit;
}
/**
* @return the t_date
*/
public Date getT_date() {
return t_date;
}
/**
* @param t_date
* the t_date to set
*/
public void setT_date(Date t_date) {
this.t_date = t_date;
}
/**
* @param id
* @param t_char
* @param t_bit
* @param t_date
*/
public TestEntity(int id, String t_char, boolean t_bit, Date t_date) {
this.id = id;
this.t_char = t_char;
this.t_bit = t_bit;
this.t_date = t_date;
}
public TestEntity() {
// TODO Auto-generated constructor stub
}
/**
* @param t_char
* @param t_bit
* @param t_date
*/
public TestEntity(String t_char, boolean t_bit, Date t_date) {
this.t_char = t_char;
this.t_bit = t_bit;
this.t_date = t_date;
}
}
TestAction.java
package ssh.build.cyj.action;
import javax.annotation.Resource;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import ssh.build.cyj.Idao.ITestDao;
import ssh.build.cyj.entity.TestEntity;
@Controller
@Scope("prototype") // Single Model
@ParentPackage("struts-default")
@Namespace("/")
@Results({ @Result(name = "test", location = "/WEB-INF/JSP/test.jsp"), @Result(location = "/index.jsp") })
public class TestAct extends ActionSupport implements ModelDriven<TestEntity> {
/**
* @return the responseStr
*/
public String getResponseStr() {
return responseStr;
}
/**
* @param responseStr
* the responseStr to set
*/
public void setResponseStr(String responseStr) {
this.responseStr = responseStr;
}
/**
*
*/
private static final long serialVersionUID = 1L;
@Resource(name = "testDao")
private ITestDao dao;
private TestEntity entity = new TestEntity();
@Action("init")
public String doInit() {
return "test";
}
@Action("test")
public String doAct() {
dao.testSave(entity);
ActionContext.getContext().put("testEntity", entity);
return "test";
}
@Override
public TestEntity getModel() {
// TODO Auto-generated method stub
return entity;
}
}
ITestDao.java
package ssh.build.cyj.Idao;
import java.util.List;
import ssh.build.cyj.entity.TestEntity;
public interface ITestDao {
public void testSave(TestEntity entity);
public void testUpd(TestEntity entity);
public void testDel(TestEntity entity);
public List<TestEntity> testQuery(TestEntity entity);
}
TestDaoImpl.java
package ssh.build.cyj.daoImpl;
import java.util.List;
import org.springframework.stereotype.Repository;
import ssh.build.cyj.Idao.ITestDao;
import ssh.build.cyj.common.DBCommon;
import ssh.build.cyj.entity.TestEntity;
@Repository(value = "testDao")
public class TestDaoImpl extends DBCommon implements ITestDao {
@Override
public void testSave(TestEntity entity) {
save(entity);
}
@Override
public void testUpd(TestEntity entity) {
// TODO Auto-generated method stub
}
@Override
public void testDel(TestEntity entity) {
// TODO Auto-generated method stub
}
@Override
public List<TestEntity> testQuery(TestEntity entity) {
List<TestEntity> query = query("select * from test_tb");
return query;
}
}
DBCommon.java
package ssh.build.cyj.common;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.SQLQuery;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import ssh.build.cyj.entity.TestEntity;
public class DBCommon<T> extends LogPrintCommon{
@Resource(name = "sessionFactory")
private SessionFactory sessionFactory;
private Session session;
private Transaction transaction;
public DBCommon() {
}
public void save(Object obj) {
Class<? extends String> simpleName = getClass().getSimpleName().getClass();
DBParamLog(obj);
doDbBeforeAct();
session.save(obj);
doDbAftAct();
};
public void update(Object obj) {
doDbBeforeAct();
session.saveOrUpdate(obj);
doDbAftAct();
};
public List<Object> query(String hql) {
doDbBeforeAct();
SQLQuery sqlQuery = session.createSQLQuery(hql);
@SuppressWarnings("unchecked")
List<Object> searchResult = sqlQuery.addEntity("*", TestEntity.class).list();
return searchResult;
};
public void delete(Object obj) {
doDbBeforeAct();
session.delete(obj);
doDbAftAct();
};
/**
* Common:execute to DB before
*/
private void doDbBeforeAct() {
session = sessionFactory.openSession();
transaction = session.beginTransaction();
}
/**
* Common:execute to DB After
*/
private void doDbAftAct() {
transaction.commit();
session.close();
sessionFactory.close();
}
}
LogPrintCommon.java
package ssh.build.cyj.common;
import java.lang.reflect.Field;
import java.text.SimpleDateFormat;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class LogPrintCommon {
private final SimpleDateFormat dataFormat_yyyyMMdd = new SimpleDateFormat("yyyy/MM/dd Z HH:mm:ss:S");
private final Logger log = LoggerFactory.getLogger(LogPrintCommon.class);
protected void DBParamLog(Object object) {
// get all Attributes of Object
Field[] fields = object.getClass().getDeclaredFields();
for (Field field : fields) {
// get name of every Attribute
String attrName = field.getName();
Object attrVal = null;
// set All Attribute is access
field.setAccessible(true);
try {
// get value of every Attribute
attrVal = field.get(object);
String attrType = field.getType().toString();
if (StringUtils.equals("class java.util.Date", attrType) && !StringUtils.isEmpty((String) attrVal)) {
dataFormat_yyyyMMdd.setLenient(false);
attrVal = dataFormat_yyyyMMdd.format(field.get(object));
}
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
log.info("param[" + attrName + "]:" + attrVal);
}
}
}
test.jsp(From: send to data for server)
<!-- From [Start]-->
<form class="bs-example bs-example-form form-group" action="test.action" role="form" method="post">
<!-- Login Mark Start-->
<div style="padding:0px 0px 10px 80px;">
<h2><strong>Login</strong></h2>
</div>
<!-- Login Mark End-->
<!-- Input Account [Start]-->
<div class="input-group row input-group-lg from-group" id="div_account">
<span class="input-group-addon" style="width:115px;">Account</span>
<input type="text" class="form-control" οnblur="inputBlur(1)" id="account" name="t_char">
</div>
<!-- Input Account [End]-->
<br/>
<!-- Input Password [Start] -->
<div class="input-group row input-group-lg" id="div_psd">
<span class="input-group-addon" style="width:115px;">Password</span>
<input type="password" class="form-control" οnblur="inputBlur(2)" id="psd" name="t_id">
</div>
<!-- Input Password [End] -->
<br/>
<!-- Login Button [Start] -->
<div class="btn-group btn-group-lg row">
<button type="submit" class="btn btn-primary" data-toggle="submit">Register</button>
<!-- Login Button [End] -->
<!-- Reset Button [Start] -->
<button type="reset" class="btn btn-default" data-toggle="reset">Reset</button>
</div>
<!-- Reset Button [End] -->
</form>
<!-- From [End] -->
test.jsp(send to data for jsp at server)
<td><s:property value="#testEntity.t_char"/></td>