- 浏览: 62447 次
- 性别:
- 来自: 广州
-
最新评论
-
zxjlwt:
学习了。http://surenpi.com
python:在python中使用opencv进行摄像头编程初体验 -
lingshangwen:
http://www.opencv.org.cn/index. ...
python:在python中使用opencv进行摄像头编程初体验 -
fengsage:
能给下python opencv的下载地址吗?
python:在python中使用opencv进行摄像头编程初体验
最近用spring2.5.6+hibernate3.2+struts2.0.14做项目,用这些框架做项目最鬼麻烦的就是搭建工程的基本原型,为了在以后不用在这么麻烦,于是就有了创建一个自己的ssh的archetype的念头,说干就干,开始动手。
1.创建一个maven项目(在eclipse 中通过m2eclipse创建或者用mvn archetype:genetate命令创建)。
2.添加spring,hibernate,struts2的依赖包,我的pom.xml如下:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.eagle</groupId> <artifactId>ssh-base</artifactId> <packaging>war</packaging> <version>0.0.1-SNAPSHOT</version> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.0.2</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> <version>6.1.14</version> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.5</version> <type>jar</type> <scope>provided</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> <version>2.5.6</version> <type>jar</type> <scope>compile</scope> </dependency> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjrt</artifactId> <version>1.6.2</version> <type>jar</type> <scope>compile</scope> </dependency> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>1.6.2</version> <type>jar</type> <scope>compile</scope> </dependency> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-core</artifactId> <version>2.0.14</version> <type>jar</type> <scope>compile</scope> </dependency> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-spring-plugin</artifactId> <version>2.0.14</version> <type>jar</type> <scope>compile</scope> <exclusions> <exclusion> <artifactId>spring-beans</artifactId> <groupId>org.springframework</groupId> </exclusion> <exclusion> <artifactId>spring-core</artifactId> <groupId>org.springframework</groupId> </exclusion> <exclusion> <artifactId>spring-context</artifactId> <groupId>org.springframework</groupId> </exclusion> <exclusion> <artifactId>spring-web</artifactId> <groupId>org.springframework</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate</artifactId> <version>3.2.6.ga</version> <type>jar</type> <scope>compile</scope> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.6</version> <type>jar</type> <scope>runtime</scope> </dependency> <dependency> <groupId>c3p0</groupId> <artifactId>c3p0</artifactId> <version>0.9.1.2</version> <type>jar</type> <scope>compile</scope> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.14</version> <type>jar</type> <scope>compile</scope> </dependency> <dependency> <groupId>cglib</groupId> <artifactId>cglib-nodep</artifactId> <version>2.1_3</version> <type>jar</type> <scope>compile</scope> </dependency> </dependencies> </project>
3.添加基本的配置文件
src/main/resources/applicationContext.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-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd"> <context:property-placeholder location="WEB-INF/config/jdbc.properties" /> <!-- 定义数据源Bean,使用C3P0数据源实现 --> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <!-- 指定连接数据库的驱动 --> <property name="driverClass" value="${jdbc.driverClassName}" /> <!-- 指定连接数据库的URL --> <property name="jdbcUrl" value="${jdbc.url}" /> <!-- 指定连接数据库的用户名 --> <property name="user" value="${jdbc.username}" /> <!-- 指定连接数据库的密码 --> <property name="password" value="${jdbc.password}" /> <!-- 指定连接数据库连接池的最大连接数 --> <property name="maxPoolSize" value="20" /> <!-- 指定连接数据库连接池的最小连接数 --> <property name="minPoolSize" value="1" /> <!-- 指定连接数据库连接池的初始化连接数 --> <property name="initialPoolSize" value="1" /> <!-- 指定连接数据库连接池的连接的最大空闲时间 --> <property name="maxIdleTime" value="20" /> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="mappingDirectoryLocations"> <list> <value>classpath:org/eagle/orm</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect </prop> <prop key="show_sql">true</prop> <prop key="hibernate.hbm2ddl.auto">update</prop> <prop key="hibernate.jdbc.batch_size">20</prop> </props> </property> </bean> <!-- 配置事务管理器 --> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> </bean> <!-- 配置事务的传播性 --> <tx:advice id="txAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="add*" propagation="REQUIRED" /> <tx:method name="del*" propagation="REQUIRED" /> <tx:method name="modify*" propagation="REQUIRED" /> <tx:method name="*" read-only="true" /> </tx:attributes> </tx:advice> <!-- 配置哪些类哪些方法使用事务 --> <aop:config> <!-- 配置切入点(定义哪些方法要进行事务处理) --> <aop:pointcut id="allManager" expression="execution(* org.eagle.services..*.*(..))" /> <!-- 定义advice --> <aop:advisor advice-ref="txAdvice" pointcut-ref="allManager" /> </aop:config> </beans>
src/main/resources/struts.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> </struts>
src/main/webapp/WEB-INF/config/jdbc.properties
jdbc.driverClassName=com.mysql.jdbc.Driver jdbc.url=jdbc:mysql://localhost:3306/shs2 jdbc.username=root jdbc.password=ubuntu
src/main/webapp/WEB-INF/config/log4j.properties
log4j.rootLogger=INFO, stdout, logfile log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n log4j.appender.logfile=org.apache.log4j.RollingFileAppender log4j.appender.logfile.File=${webapp.root}/WEB-INF/logs/pcdiy.log log4j.appender.logfile.MaxFileSize=512KB # Keep three backup files. log4j.appender.logfile.MaxBackupIndex=3 # Pattern to output: date priority [category] - message log4j.appender.logfile.layout=org.apache.log4j.PatternLayout log4j.appender.logfile.layout.ConversionPattern=%d %p [%c] - %m%n
4.web.xml
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:applicationContext.xml</param-value> </context-param> <context-param> <param-name>log4jConfigLocation</param-name> <param-value>/WEB-INF/config/log4j.properties</param-value> </context-param> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <listener> <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> </listener> </web-app>
5.基本上可以,现在来生成archetype的目录结构(假设工程在/home/lingshangwen/project/ssh-base)
进入到工程的根目录ssh-base下
$cd ~/project/ssh-base
$mvn archetype:create-from-project
运行完该命令后,将会有如下的目录~/project/ssh-base/target/generated-sources/archetype
6.创建archetype
$cd ~/project/ssh-base/target/generated-sources/archetype
$mvn install
到现在为止,我想要的ssh的archetype创建出来了,如何通过该archetype创建项目呢,很简单,看看
$cd ~/project
$mvn archetype:generate
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [archetype:generate] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] Preparing archetype:generate
[INFO] No goals needed for project - skipping
[INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] [archetype:generate]
[INFO] Generating project in Interactive mode
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1: local -> ssh (null)
2: local -> ssh-base-archetype (ssh-base-archetype)
3: internal -> appfuse-basic-jsf (AppFuse archetype for creating a web application with Hibernate, Spring and JSF)
4: internal -> appfuse-basic-spring (AppFuse archetype for creating a web application with Hibernate, Spring and Spring MVC)
5: internal -> appfuse-basic-struts (AppFuse archetype for creating a web application with Hibernate, Spring and Struts 2)
6: internal -> appfuse-basic-tapestry (AppFuse archetype for creating a web application with Hibernate, Spring and Tapestry 4)
7: internal -> appfuse-core (AppFuse archetype for creating a jar application with Hibernate and Spring and XFire)
8: internal -> appfuse-modular-jsf (AppFuse archetype for creating a modular application with Hibernate, Spring and JSF)
9: internal -> appfuse-modular-spring (AppFuse archetype for creating a modular application with Hibernate, Spring and Spring MVC)
10: internal -> appfuse-modular-struts (AppFuse archetype for creating a modular application with Hibernate, Spring and Struts 2)
11: internal -> appfuse-modular-tapestry (AppFuse archetype for creating a modular application with Hibernate, Spring and Tapestry 4)
12: internal -> maven-archetype-j2ee-simple (A simple J2EE Java application)
13: internal -> maven-archetype-marmalade-mojo (A Maven plugin development project using marmalade)
14: internal -> maven-archetype-mojo (A Maven Java plugin development project)
15: internal -> maven-archetype-portlet (A simple portlet application)
16: internal -> maven-archetype-profiles ()
17: internal -> maven-archetype-quickstart ()
18: internal -> maven-archetype-site-simple (A simple site generation project)
19: internal -> maven-archetype-site (A more complex site project)
20: internal -> maven-archetype-webapp (A simple Java web application)
21: internal -> jini-service-archetype (Archetype for Jini service project creation)
22: internal -> softeu-archetype-seam (JSF+Facelets+Seam Archetype)
23: internal -> softeu-archetype-seam-simple (JSF+Facelets+Seam (no persistence) Archetype)
24: internal -> softeu-archetype-jsf (JSF+Facelets Archetype)
25: internal -> jpa-maven-archetype (JPA application)
26: internal -> spring-osgi-bundle-archetype (Spring-OSGi archetype)
27: internal -> confluence-plugin-archetype (Atlassian Confluence plugin archetype)
28: internal -> jira-plugin-archetype (Atlassian JIRA plugin archetype)
29: internal -> maven-archetype-har (Hibernate Archive)
30: internal -> maven-archetype-sar (JBoss Service Archive)
31: internal -> wicket-archetype-quickstart (A simple Apache Wicket project)
32: internal -> scala-archetype-simple (A simple scala project)
33: internal -> lift-archetype-blank (A blank/empty liftweb project)
34: internal -> lift-archetype-basic (The basic (liftweb) project)
35: internal -> cocoon-22-archetype-block-plain ([http://cocoon.apache.org/2.2/maven-plugins/])
36: internal -> cocoon-22-archetype-block ([http://cocoon.apache.org/2.2/maven-plugins/])
37: internal -> cocoon-22-archetype-webapp ([http://cocoon.apache.org/2.2/maven-plugins/])
38: internal -> myfaces-archetype-helloworld (A simple archetype using MyFaces)
39: internal -> myfaces-archetype-helloworld-facelets (A simple archetype using MyFaces and facelets)
40: internal -> myfaces-archetype-trinidad (A simple archetype using Myfaces and Trinidad)
41: internal -> myfaces-archetype-jsfcomponents (A simple archetype for create custom JSF components using MyFaces)
42: internal -> gmaven-archetype-basic (Groovy basic archetype)
43: internal -> gmaven-archetype-mojo (Groovy mojo archetype)
Choose a number: (1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/19/20/21/22/23/24/25/26/27/28/29/30/31/32/33/34/35/36/37/38/39/40/41/42/43) 17: :
ssh-base的archetype为2,故选择2
~~有个这个archetype以后创建ssh项目就快多了
发表评论
-
ubuntu下安装Memcache
2009-11-26 21:24 1210下载memcached : http://danga.com/ ... -
python编码
2009-10-21 13:48 0m = {"id":12560271 ... -
python:Queue模块
2009-10-05 23:03 1550queue — A synchronized que ... -
Python调用C语言函数
2009-08-03 11:39 3240使用Python的ctypes,我们可以直接调用由C直接编译出 ... -
python:在python中使用opencv进行摄像头编程初体验
2009-07-19 11:22 17711闲着没事做,前段时间买了个摄像头,在ubuntu上用。打开ch ... -
使用freemarker
2009-06-21 00:08 987public class Student { p ... -
wxPython:初识wx.Frame
2009-06-10 23:11 1337parent :框架的父窗口。对于顶级窗口,这个值是None ... -
oracle:进行分组并取每组中的前n条记录
2009-05-19 22:56 3855题目: 在oracle中有一数据表exam_result(成 ... -
python:pymedia安装
2009-05-16 00:00 4498"Pymedia is a Python libra ... -
maven2:安装篇
2009-05-06 23:13 1941下载maven2:http://www.apache.org/ ... -
pygame新手指南
2009-04-12 01:50 2331pygame新手指南 ——zzj译 原文出处 ... -
struts2.1.X中使用datetimepicker
2009-03-22 21:56 1956添加dojo依赖 <dependency> ...
相关推荐
1. **初始化父模块**:使用`mvn archetype:create-from-project`命令或者在IDEA等集成环境中,从现有项目创建父模块。在pom.xml中,设置`<packaging>`为`pom`,并添加子模块的`<modules>`标签,例如: ```xml .....
本手册涵盖了从Maven的基本概念到实际操作,再到在Eclipse集成开发环境中的应用等多个方面,旨在为用户提供全面的知识支持。 **第一章 引言** 1. **什么是MAVEN?** Maven是一个基于项目对象模型(POM)的项目管理...
这种设计使得信息可以从各种资源中以简单高效的方式获取。 #### 二、Jetspeed2的关键特性 1. **安全访问机制**:Jetspeed2提供了一套完整的安全体系,支持对门户内容的访问控制,确保只有授权用户才能访问特定的...
uniapp实战商城类app和小程序源码,包含后端API源码和交互完整源码。
本课程是 PHP 进阶系列之 Swoole 入门精讲,系统讲解 Swoole 在 PHP 高性能开发中的应用,涵盖 协程、异步编程、WebSocket、TCP/UDP 通信、任务投递、定时器等核心功能。通过理论解析和实战案例相结合,帮助开发者掌握 Swoole 的基本使用方法及其在高并发场景下的应用。 适用人群: 适合 有一定 PHP 基础的开发者、希望提升后端性能优化能力的工程师,以及 对高并发、异步编程感兴趣的学习者。 能学到什么: 掌握 Swoole 基础——理解 Swoole 的核心概念,如协程、异步编程、事件驱动等。 高并发处理——学习如何使用 Swoole 构建高并发的 Web 服务器、TCP/UDP 服务器。 实战项目经验——通过案例实践,掌握 Swoole 在 WebSocket、消息队列、微服务等场景的应用。 阅读建议: 建议先掌握 PHP 基础,了解 HTTP 服务器和并发处理相关概念。学习过程中,结合 官方文档和实际项目 进行实践,加深理解,逐步提升 Swoole 开发能力。
matlab齿轮-轴-轴承系统含间隙非线性动力学 基于matlab的齿轮-轴-轴承系统的含间隙非线性动力学模型,根据牛顿第二定律,建立齿轮系统啮合的非线性动力学方程,同时也主要应用修正Capone模型的滑动轴承无量纲化雷诺方程,利用这些方程推到公式建模;用MATLAB求解画出位移-速度图像,从而得到系统在不同转速下的混沌特性,分析齿轮-滑动轴承系统的动态特性 程序已调通,可直接运行 ,关键词:Matlab;齿轮-轴-轴承系统;含间隙非线性动力学;牛顿第二定律;动力学方程;修正Capone模型;无量纲化雷诺方程;位移-速度图像;混沌特性;动态特性。,基于Matlab的齿轮-轴-轴承系统非线性动力学建模与混沌特性分析
2024年移动应用隐私安全观测报告.pdf
本电影评论网站管理员和用户。管理员功能有个人中心,用户管理,电影类别管理,电影信息管理,留言板管理,论坛交流,系统管理等。用户可以对电影进行评论。因而具有一定的实用性。本站是一个B/S模式系统,采用SSM框架,MYSQL数据库设计开发,充分保证系统的稳定性。系统具有界面清晰、操作简单,功能齐全的特点,使得电影评论网站管理工作系统化、规范化。 本系统的使用使管理人员从繁重的工作中解脱出来,实现无纸化办公,能够有效的提高电影评论网站管理效率。 关键词:电影评论网站;SSM框架;MYSQL数据库 1系统概述 1 1.1 研究背景 1 1.2研究目的 1 1.3系统设计思想 1 2相关技术 2 2.1 MYSQL数据库 2 2.2 B/S结构 3 2.3 Spring Boot框架简介 4 3系统分析 4 3.1可行性分析 4 3.1.1技术可行性 4 3.1.2经济可行性 5 3.1.3操作可行性 5 3.2系统性能分析 5 3.2.1 系统安全性 5 3.2.2 数据完整性 6 3.3系统界面分析 6 3.4系统流程和逻辑 7 4系统概要设计 8 4.1概述 8 4.2系统结构 9 4.
2023-04-06-项目笔记-第四百三十六阶段-课前小分享_小分享1.坚持提交gitee 小分享2.作业中提交代码 小分享3.写代码注意代码风格 4.3.1变量的使用 4.4变量的作用域与生命周期 4.4.1局部变量的作用域 4.4.2全局变量的作用域 4.4.2.1全局变量的作用域_1 4.4.2.434局变量的作用域_434- 2025-03-13
基于STM32的流量计智能流速流量监测、水泵报警系统(泵启动 1100027-基于STM32的流量计智能流速流量监测、水泵报警系统(泵启动、阈值设置、LCD1602、超阈值报警、proteus) 功能描述: 基于STM32F103C8单片机实现的智能流速、流量,流量计设计 实现的功能是通过信号发生器模拟齿轮传感器,检测流量的大小,同时计算流过液体的总容量 可以设置最大流过的总容量,当超过设定值后通过蜂鸣器与LED灯指示 当没有超过则启动水泵控制电路带动液体流动 1、流速检测 2、流量统计 3、阈值显示与设置(通过按键实现阈值的调节或清零) 4、水泵启动 5、超阈值报警 有哪些资料: 1、仿真工程文件 2、PCB工程文件 3、原理图工程文件 4、源代码 ,核心关键词: 基于STM32的流量计; 智能流速流量监测; 水泵报警系统; 阈值设置; LCD1602; 超阈值报警; Proteus仿真; STM32F103C8单片机; 齿轮传感器; 信号发生器; 流量统计; 蜂鸣器与LED灯指示; 水泵控制电路。,基于STM32的智能流量监测与报警系统(阈值可调、流速与流量监
(灰度场景下的平面、海底、船、受害者)图像分类数据集【已标注,约1100张数据】 数据经过预处理,可以直接作为分类网络输入使用 分类个数【4】:平面、海底、船、受害者【具体查看json文件】 划分了训练集、测试集。存放各自的同一类数据图片。如果想可视化数据集,可以运行资源中的show脚本。 图像分类、分割网络改进:https://blog.csdn.net/qq_44886601/category_12858320.html 计算机视觉完整项目:https://blog.csdn.net/qq_44886601/category_12816068.html
arkime无geo下的oui文件
人脸识别项目实战
人脸识别项目实战
CAD 2025 二次开发dll
人脸识别项目源码实战
c语言学习
基于扩张状态观测器eso扰动补偿和权重因子调节的电流预测控制,相比传统方法,增加了参数鲁棒性 降低电流脉动,和误差 基于扩张状态观测器eso补偿的三矢量模型预测控制 ,基于扩张状态观测器; 扰动补偿; 权重因子调节; 电流预测控制; 参数鲁棒性; 电流脉动降低; 误差降低; 三矢量模型预测控制,基于鲁棒性增强和扰动补偿的电流预测控制方法
c语言学习