%date:~0,10% %time:~0,8%
日期格式2011-03-17 11:38:06
posted @ 2011-03-17 11:43 rainingcn 閱讀(415) | 評論 (0) | 編輯 收藏
posts - 6, comments - 0, trackbacks - 0, articles - 0 |
|
%date:~0,10% %time:~0,8%
日期格式2011-03-17 11:38:06
posted @ 2011-03-17 11:43 rainingcn 閱讀(415) | 評論 (0) | 編輯 收藏 1. 使用Maven的maven-archetype-webapp 創建
mvn archetype:create -DgroupId=com.test -DartifactId=tutorial -DarchetypeArtifactId=maven-archetype-webapp
2.修改pom.xml。在build屬性中增加jetty配置<build>
2.1 可以輸入 mvn jetty:run 啟動jetty容器<finalName>tutorial</finalName> <plugins> <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> </plugin> <!-- <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>tomcat-maven-plugin</artifactId> </plugin> --> </plugins> </build> 3.增加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>com.test</groupId> <artifactId>tutorial</artifactId> <packaging>war</packaging> <version>1.0-SNAPSHOT</version> <name>tutorial Maven Webapp</name> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-core</artifactId> <version>2.2.1</version> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.14</version> </dependency> <dependency> <groupId>javassist</groupId> <artifactId>javassist</artifactId> <version>3.8.0.GA</version> </dependency> </dependencies> <build> <finalName>tutorial</finalName> <plugins> <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> </plugin> <!-- <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>tomcat-maven-plugin</artifactId> </plugin> --> </plugins> </build> </project> 4.導入到相關的IDE工具。如idea mvn idea:idea
4.1 idea中的目錄結構5.寫個class 看下能否正常跳轉。注意點:java類的源目錄為 src │ └─main │ ├─java public class Test {
對應的struts.xmlpublic String execute() { return "success"; } } <?xml version="1.0" encoding="UTF-8"?>
6. url: http://localhost:8080/test<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <package name="default" extends="struts-default" namespace="/"> <action name="test" class="com.test.Test"> <result>index.jsp</result> </action> </package> </struts> 7.參考: Building Web Applications with Maven 2Create Struts 2 Web Application Using Maven To Manage Artifacts and To Build The Applicationposted @ 2011-03-16 15:02 rainingcn 閱讀(1572) | 評論 (0) | 編輯 收藏 idea中使用SourceSafe沒有在eclipse使用簡便。idea項目工程文件和SS上的工程文件要制定下。原先配過一次,很久不用又忘了。所以試著記下來。
具體步驟 1.配置SourceSafe ![]() 2.配置idea項目工程文件和SS上的工程文件 ![]() posted @ 2011-02-12 16:13 rainingcn 閱讀(277) | 評論 (0) | 編輯 收藏 linux 自帶的apache默認安裝下,動態加載模塊是不啟動的。也就是意味著每一個httpd進程有自己獨立的模塊文件,分別獨立。
這個在多并發的情況下會占用很大資源。 查看方式: 1.查看httpd進程數 ps -ef|grep httpd|wc -l
2.查看打開的文件模塊數 lsof |grep /usr/lib64/httpd/modules/mod_auth_basic.so|wc -l
解決方式:重編譯apache, --enable-mods-shared=most
posted @ 2010-12-20 16:32 rainingcn 閱讀(287) | 評論 (0) | 編輯 收藏 |
|