-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A web service application for a high school club
This web application use SpringMVC framework
- Loading branch information
0 parents
commit 7efd74f
Showing
145 changed files
with
15,581 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v8.0"> | ||
<attributes> | ||
<attribute name="owner.project.facets" value="jst.web"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/> | ||
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | ||
<classpathentry kind="output" path="build/classes"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>Demo1</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.wst.common.project.facet.core.builder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.wst.validation.validationbuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature> | ||
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> | ||
<nature>org.eclipse.wst.common.project.facet.core.nature</nature> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
<nature>org.eclipse.wst.jsdt.core.jsNature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="WebContent"/> | ||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/> | ||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject"> | ||
<attributes> | ||
<attribute name="hide" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/> | ||
<classpathentry kind="output" path=""/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 | ||
org.eclipse.jdt.core.compiler.compliance=1.8 | ||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
org.eclipse.jdt.core.compiler.source=1.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0"> | ||
<wb-module deploy-name="Demo1"> | ||
<wb-resource deploy-path="/" source-path="/WebContent" tag="defaultRootSource"/> | ||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/> | ||
<property name="context-root" value="Demo1"/> | ||
<property name="java-output-path" value="/Demo1/build/classes"/> | ||
</wb-module> | ||
</project-modules> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<faceted-project> | ||
<runtime name="Apache Tomcat v8.0"/> | ||
<fixed facet="jst.web"/> | ||
<fixed facet="java"/> | ||
<fixed facet="wst.jsdt.web"/> | ||
<installed facet="java" version="1.8"/> | ||
<installed facet="jst.web" version="3.1"/> | ||
<installed facet="wst.jsdt.web" version="1.0"/> | ||
</faceted-project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
org.eclipse.wst.jsdt.launching.baseBrowserLibrary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Window |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Manifest-Version: 1.0 | ||
Class-Path: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<?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: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-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 | ||
http://www.springframework.org/schema/context | ||
http://www.springframework.org/schema/context/spring-context-2.5.xsd | ||
"> | ||
<context:component-scan base-package="events" /> | ||
<context:component-scan base-package="signUpClass" /> | ||
<context:component-scan base-package="user" /> | ||
<!-- 支持aop注解 --> | ||
<aop:aspectj-autoproxy /> | ||
|
||
|
||
<bean id="dataSource" | ||
class="org.apache.commons.dbcp.BasicDataSource"> | ||
<property name="driverClassName" | ||
value="com.mysql.jdbc.Driver"> | ||
</property> | ||
<property name="url" value="jdbc:mysql://localhost:3306/test"></property> | ||
<property name="username" value="root"></property> | ||
<property name="password" value=""></property> | ||
</bean> | ||
|
||
<bean id="sessionFactory" | ||
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> | ||
<property name="dataSource"> | ||
<ref bean="dataSource" /> | ||
</property> | ||
<property name="hibernateProperties"> | ||
<props> | ||
<!-- key的名字前面都要加hibernate. --> | ||
<prop key="hibernate.dialect"> | ||
org.hibernate.dialect.MySQLDialect | ||
</prop> | ||
<prop key="hibernate.show_sql">true</prop> | ||
<prop key="hibernate.hbm2ddl.auto">update</prop> | ||
</props> | ||
</property> | ||
<property name="packagesToScan"> | ||
<value>robotics</value> | ||
</property> | ||
</bean> | ||
|
||
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate" > | ||
<property name="sessionFactory" ref="sessionFactory"></property> | ||
</bean> | ||
|
||
<!--配置一个JdbcTemplate实例--> | ||
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate"> | ||
<property name="dataSource" ref="dataSource"/> | ||
</bean> | ||
|
||
|
||
<!-- 配置事务管理 --> | ||
<bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager" > | ||
<property name="sessionFactory" ref="sessionFactory"></property> | ||
</bean> | ||
<tx:annotation-driven transaction-manager="txManager" /> | ||
<aop:config> | ||
<aop:pointcut expression="execution(public * com.sxt.service.impl.*.*(..))" id="businessService"/> | ||
<aop:advisor advice-ref="txAdvice" pointcut-ref="businessService" /> | ||
</aop:config> | ||
<tx:advice id="txAdvice" transaction-manager="txManager" > | ||
<tx:attributes> | ||
<tx:method name="find*" read-only="true" propagation="NOT_SUPPORTED" /> | ||
<!-- get开头的方法不需要在事务中运行 。 | ||
有些情况是没有必要使用事务的,比如获取数据。开启事务本身对性能是有一定的影响的--> | ||
<tx:method name="*"/> <!-- 其他方法在实务中运行 --> | ||
</tx:attributes> | ||
</tx:advice> | ||
|
||
</beans> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+98.8 KB
WebContent/WEB-INF/lib/org.springframework.context.support-3.0.0.RELEASE.jar
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+151 KB
WebContent/WEB-INF/lib/org.springframework.expression-3.0.0.RELEASE.jar
Binary file not shown.
Binary file added
BIN
+1.82 KB
WebContent/WEB-INF/lib/org.springframework.instrument-3.0.0.RELEASE.jar
Binary file not shown.
Binary file added
BIN
+5.58 KB
WebContent/WEB-INF/lib/org.springframework.instrument.tomcat-3.0.0.RELEASE.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+226 KB
WebContent/WEB-INF/lib/org.springframework.transaction-3.0.0.RELEASE.jar
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+170 KB
WebContent/WEB-INF/lib/org.springframework.web.portlet-3.0.0.RELEASE.jar
Binary file not shown.
Binary file added
BIN
+378 KB
WebContent/WEB-INF/lib/org.springframework.web.servlet-3.0.0.RELEASE.jar
Binary file not shown.
Binary file added
BIN
+31.1 KB
WebContent/WEB-INF/lib/org.springframework.web.struts-3.0.0.RELEASE.jar
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?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:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context" | ||
xmlns:util="http://www.springframework.org/schema/util" | ||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd | ||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd | ||
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd | ||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd"> | ||
|
||
<!-- 对web包中的所有类进行扫描,以完成Bean创建和自动依赖注入的功能 --> | ||
<context:component-scan base-package="robotics" /> | ||
|
||
<context:annotation-config /> | ||
<mvc:annotation-driven /> <!-- 支持spring3.0新的mvc注解 --> | ||
<!-- 启动Spring MVC的注解功能,完成请求和注解POJO的映射 --> | ||
<bean | ||
class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"> | ||
<property name="cacheSeconds" value="0" /> | ||
<property name="messageConverters"> | ||
<list> | ||
<bean | ||
class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"></bean> | ||
</list> | ||
</property> | ||
</bean> | ||
|
||
<!-- 处理json --> | ||
<bean id="mappingJacksonHttpMessageConverter" class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"> | ||
<property name="supportedMediaTypes"> | ||
<list> | ||
<value>text/html;charset=UTF-8</value> | ||
<value>application/json;charset=UTF-8</value> | ||
</list> | ||
</property> | ||
</bean> | ||
|
||
<!--处理直接返回json格式字符串--> | ||
<bean id="stringHttpMessageConverter" class="org.springframework.http.converter.StringHttpMessageConverter" /> | ||
|
||
<!-- 整合jackson 返回一个json格式 --> | ||
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"> | ||
<property name="messageConverters"> | ||
<list> | ||
<ref bean="mappingJacksonHttpMessageConverter"/> | ||
</list> | ||
</property> | ||
</bean> | ||
|
||
|
||
<!-- 支持JSON 需要加入 jackson-all-1.9.5.jar --> | ||
<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping" /> | ||
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" > | ||
<property name="messageConverters"> | ||
<util:list id="beanList"> | ||
<ref bean="mappingJacksonHttpMessageConverter"/> | ||
</util:list> | ||
</property> | ||
</bean> | ||
|
||
<!-- 处理文件上传 --> | ||
<bean id="multipartResolver" | ||
class="org.springframework.web.multipart.commons.CommonsMultipartResolver"> | ||
<property name="defaultEncoding" value="gbk" /> <!--默认编码 (ISO-8859-1) --> | ||
<property name="maxInMemorySize" value="10240" /> <!-- 最大内存大小 (10240) --> | ||
<property name="uploadTempDir" value="/upload/" /> <!-- 上传后的目录名 (WebUtils#TEMP_DIR_CONTEXT_ATTRIBUTE)--> | ||
<property name="maxUploadSize" value="-1" /> <!-- 最大文件大小,-1为无限止(-1)--> | ||
</bean> | ||
|
||
<!--对模型视图名称的解析,即在模型视图名称添加前后缀 --> | ||
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" | ||
p:suffix=".jsp"> | ||
<!-- 如果使用jstl的话,配置下面的属性 --> | ||
<property name="viewClass" | ||
value="org.springframework.web.servlet.view.JstlView" /> | ||
</bean> | ||
|
||
</beans> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1"> | ||
<display-name>Demo1</display-name> | ||
<filter> | ||
<filter-name>Set Character Encoding</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> | ||
<init-param> | ||
<param-name>forceEncoding</param-name> | ||
<param-value>true</param-value> | ||
</init-param> | ||
</filter> | ||
<filter-mapping> | ||
<filter-name>Set Character Encoding</filter-name> | ||
<url-pattern>/*</url-pattern> | ||
</filter-mapping> | ||
|
||
<servlet> | ||
<servlet-name>dispatcherServlet</servlet-name> | ||
<servlet-class> | ||
org.springframework.web.servlet.DispatcherServlet | ||
</servlet-class> | ||
<init-param> | ||
<param-name>contextConfigLocation</param-name> | ||
<param-value>/WEB-INF/hib-config.xml,/WEB-INF/springmvc-servlet.xml</param-value> | ||
</init-param> | ||
<load-on-startup>1</load-on-startup> | ||
</servlet> | ||
|
||
<servlet-mapping> | ||
<servlet-name>dispatcherServlet</servlet-name> | ||
<url-pattern>*.do</url-pattern> | ||
</servlet-mapping> | ||
|
||
</web-app> |
Oops, something went wrong.