1/2*2/3*3/4……*99/10...

新浪博客首页_新浪网
点击太频繁了,休息一下啦
新浪博友,欢迎您!
登录后,可看到更多精彩内容
下次自动登录
&&&&&&&&&&&&
作者昵称:BLOG地址:
文章标题:文章链接:
文章大类:
情感时尚美容
生活记录栏目
健康休闲栏目
文章小类:
城市·招商leizhimin 的BLOG
用户名:leizhimin
文章数:721
评论数:2667
注册日期:
阅读量:5863
阅读量:12276
阅读量:311924
阅读量:1026924
51CTO推荐博文
帮朋友搭建个简单的helloworld的平台,较简单,但是能用了。给ssh的“零配置”一个正解。看我这个就够了ok了!jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/sshfw?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=round
jdbc.username=root
jdbc.password=leizmlog4j.rootLogger=debug, stdout
log4j.logger.java.sql.Connection=info, stdout
log4j.logger.java.sql.Statement=debug, stdout
log4j.logger.java.sql.PreparedStatement=debug, stdout
log4j.logger.org.hibernate=error
log4j.logger.org.hibernate.SQL=debug
log4j.logger.org.hibernate.tool.hbm2ddl=debug
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%p %d{yyyy-MM-dd HH:mm:ss} %c:%L - %m%n
log4j.category.org.springframework = ON&?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:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.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
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd"
default-autowire="byName"&
&context:property-placeholder location="classpath*:jdbc.properties"/&
&context:component-scan base-package="com.lavasoft.demo.dao" /&
&context:component-scan base-package="com.lavasoft.demo.service"/&
&context:component-scan base-package="com.lavasoft.demo.web.action"/&
&!-- 配置系统的数据源 --&
&bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close"&
&property name="driverClassName" value="${jdbc.driver}"/&
&property name="url" value="${jdbc.url}"/&
&property name="username" value="${jdbc.username}"/&
&property name="password" value="${jdbc.password}"/&
&property name="filters" value="stat"/&
&property name="maxActive" value="10"/&
&property name="initialSize" value="1"/&
&property name="maxWait" value="60000"/&
&property name="minIdle" value="1"/&
&property name="timeBetweenEvictionRunsMillis" value="60000"/&
&property name="minEvictableIdleTimeMillis" value="300000"/&
&property name="validationQuery" value="SELECT 'x'"/&
&property name="testWhileIdle" value="true"/&
&property name="testOnBorrow" value="false"/&
&property name="testOnReturn" value="false"/&
&property name="poolPreparedStatements" value="true"/&
&property name="maxPoolPreparedStatementPerConnectionSize" value="50"/&
&property name="maxOpenPreparedStatements" value="100"/&
&bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"&
&property name="dataSource" ref="dataSource"/&
&property name="hibernateProperties"&
&prop key="hibernate.dialect"&org.hibernate.dialect.MySQL5InnoDBDialect&/prop&
&prop key="hibernate.current_session_context_class"&thread&/prop&
&prop key="hibernate.show_sql"&true&/prop&
&prop key="hibernate.format_sql"&true&/prop&
&prop key="hibernate.hbm2ddl.auto"&update&/prop&
&/property&
&property name="packagesToScan" value="com.lavasoft.demo.entity"/&
&bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"&
&property name="sessionFactory" ref="sessionFactory"/&
&tx:advice id="txAdvice" transaction-manager="transactionManager"&
&tx:attributes&
&tx:method name="select*" read-only="true"/&
&tx:method name="get*" read-only="true"/&
&tx:method name="load*" read-only="true"/&
&tx:method name="find*" read-only="true"/&
&tx:method name="query*" read-only="true"/&
&tx:method name="read*" read-only="true"/&
&tx:method name="sync*"/&
&tx:method name="*" propagation="REQUIRED" rollback-for="Exception"/&
&/tx:attributes&
&/tx:advice&
&aop:config&
&aop:pointcut id="pointcut" expression="execution(* com.lavasoft.demo.service.*Impl.*(..))"/&
&aop:advisor advice-ref="txAdvice" pointcut-ref="pointcut"/&
&/aop:config&
&/beans&&?xml version="1.0" encoding="UTF-8"?&
&!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd"&
&constant name="struts.devMode" value="true"/&
&constant name="struts.i18n.encoding" value="UTF-8" /&
&constant name="struts.convention.result.path" value="/WEB-INF/pages"/&
&constant name="struts.convention.package.locators" value="web,action"/&
&constant name="struts.objectFactory" value="spring"/&
&constant name="struts.configuration.xml.reload" value="true"/&
&package name="demo" extends="struts-default" namespace="/demo"&
&global-results&
&result name="login"&/index.jsp&/result&
&result name="error"&/error.jsp&/result&
&/global-results&
&/package&
&/struts&&?xml version="1.0" encoding="UTF-8"?&
&web-app version="2.5" xmlns="/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="/xml/ns/javaee
/xml/ns/javaee/web-app_2_5.xsd"&
&welcome-file-list&
&welcome-file&login.html&/welcome-file&
&/welcome-file-list&
&filter-name&encodingFilter&/filter-name&
&filter-class&org.springframework.web.filter.CharacterEncodingFilter&/filter-class&
&init-param&
&param-name&encoding&/param-name&
&param-value&UTF-8&/param-value&
&/init-param&
&filter-mapping&
&filter-name&encodingFilter&/filter-name&
&url-pattern&/*&/url-pattern&
&/filter-mapping&
&filter-name&struts2&/filter-name&
&filter-class&org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter&/filter-class&
&filter-mapping&
&filter-name&struts2&/filter-name&
&url-pattern&/*&/url-pattern&
&/filter-mapping&
&context-param&
&param-name&log4jConfigLocation&/param-name&
&param-value&classpath:log4j.properties&/param-value&
&/context-param&
&listener&
&listener-class&org.springframework.web.util.Log4jConfigListener&/listener-class&
&/listener&
&context-param&
&param-name&contextConfigLocation&/param-name&
&param-value&classpath:spring-config.xml&/param-value&
&/context-param&
&listener&
&listener-class&org.springframework.web.context.ContextLoaderListener&/listener-class&
&/listener&
&listener&
&listener-class&org.springframework.web.context.request.RequestContextListener&/listener-class&
&/listener&
&listener&
&listener-class&org.springframework.web.util.IntrospectorCleanupListener&/listener-class&
&/listener&
&/web-app&package com.lavasoft.demo.web.
import com.lavasoft.demo.entity.U
import com.lavasoft.demo.service.UserS
import com.opensymphony.xwork2.ActionS
import org.apache.struts2.convention.annotation.A
import org.apache.struts2.convention.annotation.N
import org.apache.struts2.convention.annotation.R
import org.springframework.context.annotation.S
import org.
import javax.annotation.R
import java.util.L
* Created by Administrator on 14-4-23.
* @author leizhimin 14-4-23 下午3:09
@Namespace("/demo")
@Component
@Scope("prototype")
public class UserAction extends ActionSupport {
private UserService userS
private List&User& userL
@Action(value = "regUser", results = {
@Result(name = "success", location = "/WEB-INF/pages/login.jsp"),
@Result(name = "input", location = "/WEB-INF/pages/error.jsp")})
public String reg() {
System.out.println("----reg page----");
return SUCCESS;
@Action(value = "saveUser", results = {
@Result(name = "success", location = "/WEB-INF/pages/list.jsp"),
@Result(name = "input", location = "/WEB-INF/pages/error.jsp")})
public String save() {
System.out.println("----save----");
System.out.println(user);
userService.saveUser(user);
return SUCCESS;
public String list() {
System.out.println("----list----");
System.out.println(user);
userList = userService.queryUserAll();
return SUCCESS;
public List&User& getUserList() {
return userL
public void setUserList(List&User& userList) {
this.userList = userL
public UserService getUserService() {
return userS
public void setUserService(UserService userService) {
this.userService = userS
public User getUser() {
public void setUser(User user) {
this.user =
}package com.lavasoft.demo.
import com.lavasoft.sshfw.core.BaseDaoI
import org.springframework.stereotype.R
* Created by Administrator on 14-4-23.
* @author leizhimin 14-4-23 下午6:43
@Repository
public class UserDAO extends BaseDaoImpl {
}package com.lavasoft.demo.
import javax.persistence.*;
import static javax.persistence.GenerationType.IDENTITY;
@Table(name = "t_demo")
public class User implements java.io.Serializable {
@GeneratedValue(strategy = IDENTITY)
@Column(name = "id", unique = true, nullable = false)
@Column(name = "username", length = 32)
@Column(name = "password", length = 16)
public User() {
public User(String username, String password) {
this.username =
this.password =
public Long getId() {
public void setId(Long id) {
public String getUsername() {
public void setUsername(String username) {
this.username =
public String getPassword() {
public void setPassword(String password) {
this.password =
public String toString() {
return "User{" +
"id=" + id +
", username='" + username + '\'' +
", password='" + password + '\'' +
}package com.lavasoft.demo.
import com.lavasoft.demo.dao.UserDAO;
import com.lavasoft.demo.entity.U
import com.lavasoft.sshfw.core.BaseD
import org.springframework.stereotype.S
import org.springframework.transaction.annotation.T
import javax.annotation.R
import java.util.L
* Created by Administrator on 14-4-23.
* @author leizhimin 14-4-23 下午6:46
public class UserService {
private UserDAO userDAO;
public void saveUser(User user) {
userDAO.save(user);
public List&User& queryUserAll() {
return userDAO.findAll("from User", User.class);
Created by IntelliJ IDEA.
User: leizhimin 14-4-23 下午5:51
&%@ page contentType="text/charset=UTF-8" language="java" %&
&title&&/title&
&form action="/sshfw/demo/saveUser" method="get"&&br&
用户名:&input type="text" name="user.username"/&&br&
密码:&input type="text" name="user.password"/&
&input type="submit" name="保存"/&
&/html&CREATE TABLE `t_demo` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`username` varchar(32) DEFAULT NULL,
`password` varchar(16) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8webcontent部署为:sshfw访问地址:http://localhost:8080/sshfw/demo/regUserhttp://localhost:8080/sshfw/demo/saveUser?user.username=wer&user.password=本文出自 “” 博客,转载请与作者联系!
了这篇文章
类别:┆阅读(0)┆评论(0)
10:35:22 17:27:01 16:14:26 11:40:17 11:40:29(new defect)
Reported by:
macports-tickets@…
Milestone:
Component:
Attachments
(9.3 KB) -
added by Peter_Dyballa@…
/opt/mports/trunk/base/src/config.h
(14.8 KB) -
added by Peter_Dyballa@…
/usr/include/sys/fcntl.h
Change History
follow-up:
ago by cal@…
in reply to:
ago by Peter_Dyballa@…
ago by Peter_Dyballa@…
follow-up:
ago by cal@…
in reply to:
ago by Peter_Dyballa@…
ago by Peter_Dyballa@…
follow-up:
ago by cal@…
follow-ups:
ago by cal@…
in reply to:
ago by Peter_Dyballa@…
ago by Peter_Dyballa@…
Attachment
in reply to:
follow-up:
ago by Peter_Dyballa@…
in reply to:
follow-up:
ago by larryv@…
in reply to:
follow-up:
ago by Peter_Dyballa@…
in reply to:
follow-up:
ago by larryv@…
ago by Peter_Dyballa@…
Attachment
in reply to:
ago by Peter_Dyballa@…
follow-up:
ago by cal@…
in reply to:
follow-up:
ago by Peter_Dyballa@…
in reply to:
ago by Peter_Dyballa@…
in reply to:
ago by ryandesign@…
for help on using
Download in other formats:

我要回帖

更多关于 99版10元双红 的文章

 

随机推荐