- 浏览: 607040 次
- 性别:
- 来自: 杭州
文章分类
- 全部博客 (228)
- io (15)
- cluster (16)
- linux (7)
- js (23)
- bizarrerie (46)
- groovy (1)
- thread (1)
- jsp (8)
- static (4)
- cache (3)
- protocol (2)
- ruby (11)
- hibernate (6)
- svn (1)
- python (8)
- spring (19)
- gma (1)
- architecture (4)
- search (15)
- db (3)
- ibatis (1)
- html5 (1)
- iptables (1)
- server (5)
- nginx (4)
- scala (1)
- DNS (1)
- jPlayer (1)
- Subversion 版本控制 (1)
- velocity (1)
- html (1)
- ppt poi (1)
- java (1)
- bizarrerie spring security (1)
最新评论
-
koreajapan03:
楼主啊,好人啊,帮我解决了问题,谢谢
自定义过滤器时,不能再使用<sec:authorize url="">问题 -
snailprince:
请问有同一页面,多个上传实例的例子吗
webuploader用java实现上传 -
wutao8818:
姚小呵 写道如何接收server返回的参数呢?例如你返回的是“ ...
webuploader用java实现上传 -
姚小呵:
如何接收server返回的参数呢?例如你返回的是“1”,上传的 ...
webuploader用java实现上传 -
zycjf2009:
你好,我想用jplayer做一个简单的播放器,但是因为对js不 ...
jplayer 实战
按 重头开始学 Spring JPetStore 2 中的提示部署启动成功。出现了以下页面。
现在让我们来看看它在启动过程中时到底做了什么?
先看看web.xml
<!--
- Loads the root application context of this web app at startup,
- by default from "/WEB-INF/applicationContext.xml".
- Note that you need to fall back to Spring's ContextLoaderServlet for
- J2EE servers that do not follow the Servlet 2.4 initialization order.
-
- Use WebApplicationContextUtils.getWebApplicationContext(servletContext)
- to access it anywhere in the web application, outside of the framework.
-
- The root context is the parent of all servlet-specific contexts.
- This means that its beans are automatically available in these child contexts,
- both for getBean(name) calls and (external) bean references.
-->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
这里 spring 做了大量的工作完成了bean的组装,暂时先带过。
配置文件在
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/dataAccessContext-local.xml /WEB-INF/applicationContext.xml</param-value>
<!--
<param-value>/WEB-INF/dataAccessContext-jta.xml /WEB-INF/applicationContext.xml</param-value>
-->
</context-param>
中指定了。
加载spring mvc 配置文件。默认文件名称为{servlet-name}-servlet.xml 这里就是petstore-servlet.xml了。
下面这片配置文件是关于Struts ,Spring's HTTP invoker , Web Service remoting的配置文件
<!--
- Struts servlet that dispatches requests to registered actions.
- Reads its configuration from "struts-config.xml".
-
- A web app can just contain one such servlet.
- If you need multiple namespaces, use Struts' module mechanism.
-->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<load-on-startup>3</load-on-startup>
</servlet>
<!--
- Dispatcher servlet definition for HTTP remoting via Hessian, Burlap, and
- Spring's HTTP invoker (see remoting-servlet.xml for the controllers).
-->
<servlet>
<servlet-name>remoting</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>4</load-on-startup>
</servlet>
<!--
- Servlet definition for Web Service remoting via Apache Axis
- (see server-config.wsdd for Axis configuration).
-->
<servlet>
<servlet-name>axis</servlet-name>
<servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class>
<load-on-startup>5</load-on-startup>
</servlet>
<!--
- Dispatcher servlet mapping for the main web user interface.
- Either refering to "petstore" for the Spring web MVC dispatcher,
- or to "action" for the Struts dispatcher.
-
- Simply comment out the "petstore" reference in favour of "action"
- to switch from the Spring web tier to the Struts web tier.
-->
<servlet-mapping>
<servlet-name>petstore</servlet-name>
<!--
<servlet-name>action</servlet-name>
-->
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!--
- Dispatcher servlet mapping for HTTP remoting via Hessian, Burlap, and
- Spring's HTTP invoker (see remoting-servlet.xml for the controllers).
-->
<servlet-mapping>
<servlet-name>remoting</servlet-name>
<url-pattern>/remoting/*</url-pattern>
</servlet-mapping>
<!--
- Servlet mapping for Web Service remoting via Apache Axis
- (see server-config.wsdd for Axis configuration).
-->
<servlet-mapping>
<servlet-name>axis</servlet-name>
<url-pattern>/axis/*</url-pattern>
</servlet-mapping>
所有 .do 的请求 都交给 org.springframework.web.servlet.DispatcherServlet 这个Spring控制器来分发了!
所有的 .action 请求都由 org.apache.struts.action.ActionServlet 也就是 Struts 处理。
下面类似的配置类似,就不再说了。
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
这个就不用说了吧。也就是刚看到的 展示页面了。
接下来 就顺着这个首页的 链接 顺藤摸瓜 看看spring mvc 的处理过程了吧
现在让我们来看看它在启动过程中时到底做了什么?
先看看web.xml
引用
<!--
- Loads the root application context of this web app at startup,
- by default from "/WEB-INF/applicationContext.xml".
- Note that you need to fall back to Spring's ContextLoaderServlet for
- J2EE servers that do not follow the Servlet 2.4 initialization order.
-
- Use WebApplicationContextUtils.getWebApplicationContext(servletContext)
- to access it anywhere in the web application, outside of the framework.
-
- The root context is the parent of all servlet-specific contexts.
- This means that its beans are automatically available in these child contexts,
- both for getBean(name) calls and (external) bean references.
-->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
这里 spring 做了大量的工作完成了bean的组装,暂时先带过。
配置文件在
引用
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/dataAccessContext-local.xml /WEB-INF/applicationContext.xml</param-value>
<!--
<param-value>/WEB-INF/dataAccessContext-jta.xml /WEB-INF/applicationContext.xml</param-value>
-->
</context-param>
中指定了。
引用
<!--
- Spring web MVC servlet that dispatches requests to registered handlers.
- Has its own application context, by default defined in "{servlet-name}-servlet.xml",
- i.e. "petstore-servlet.xml" in this case.
-
- A web app can contain any number of such servlets.
- Note that this web app has a shared root application context, serving as parent
- of all DispatcherServlet contexts.
-->
<servlet>
<servlet-name>petstore</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
- Spring web MVC servlet that dispatches requests to registered handlers.
- Has its own application context, by default defined in "{servlet-name}-servlet.xml",
- i.e. "petstore-servlet.xml" in this case.
-
- A web app can contain any number of such servlets.
- Note that this web app has a shared root application context, serving as parent
- of all DispatcherServlet contexts.
-->
<servlet>
<servlet-name>petstore</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
加载spring mvc 配置文件。默认文件名称为{servlet-name}-servlet.xml 这里就是petstore-servlet.xml了。
下面这片配置文件是关于Struts ,Spring's HTTP invoker , Web Service remoting的配置文件
引用
<!--
- Struts servlet that dispatches requests to registered actions.
- Reads its configuration from "struts-config.xml".
-
- A web app can just contain one such servlet.
- If you need multiple namespaces, use Struts' module mechanism.
-->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<load-on-startup>3</load-on-startup>
</servlet>
<!--
- Dispatcher servlet definition for HTTP remoting via Hessian, Burlap, and
- Spring's HTTP invoker (see remoting-servlet.xml for the controllers).
-->
<servlet>
<servlet-name>remoting</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>4</load-on-startup>
</servlet>
<!--
- Servlet definition for Web Service remoting via Apache Axis
- (see server-config.wsdd for Axis configuration).
-->
<servlet>
<servlet-name>axis</servlet-name>
<servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class>
<load-on-startup>5</load-on-startup>
</servlet>
引用
<!--
- Dispatcher servlet mapping for the main web user interface.
- Either refering to "petstore" for the Spring web MVC dispatcher,
- or to "action" for the Struts dispatcher.
-
- Simply comment out the "petstore" reference in favour of "action"
- to switch from the Spring web tier to the Struts web tier.
-->
<servlet-mapping>
<servlet-name>petstore</servlet-name>
<!--
<servlet-name>action</servlet-name>
-->
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!--
- Dispatcher servlet mapping for HTTP remoting via Hessian, Burlap, and
- Spring's HTTP invoker (see remoting-servlet.xml for the controllers).
-->
<servlet-mapping>
<servlet-name>remoting</servlet-name>
<url-pattern>/remoting/*</url-pattern>
</servlet-mapping>
<!--
- Servlet mapping for Web Service remoting via Apache Axis
- (see server-config.wsdd for Axis configuration).
-->
<servlet-mapping>
<servlet-name>axis</servlet-name>
<url-pattern>/axis/*</url-pattern>
</servlet-mapping>
所有 .do 的请求 都交给 org.springframework.web.servlet.DispatcherServlet 这个Spring控制器来分发了!
所有的 .action 请求都由 org.apache.struts.action.ActionServlet 也就是 Struts 处理。
下面类似的配置类似,就不再说了。
引用
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
这个就不用说了吧。也就是刚看到的 展示页面了。
接下来 就顺着这个首页的 链接 顺藤摸瓜 看看spring mvc 的处理过程了吧
发表评论
-
webuploader用java实现上传
2014-10-17 23:55 40725<div id="uploader&q ... -
springmvc,Servlet3异步,websocket
2014-10-17 22:58 1377spring4.0以后加入了对websocket技术的支持 ... -
SpringMVC中的文件上传【转发】
2014-09-19 21:54 993http://blog.csdn.net/jadyer/art ... -
{转}spring security 3 自定义认证授权示例
2011-11-10 16:46 2271转:http://www.4ucode.com/Study/T ... -
用spring resource 接口获取 web应用的ROOT目录
2010-12-09 19:44 3123Resource r = new ClassPathResou ... -
springmvc 表单 @RequestMapping 上传文件
2010-06-04 18:08 6514@RequestMapping(method = Req ... -
ControllerClassNameHandlerMapping @Controller
2009-06-27 01:25 4411这里也提到这个问题 http://forum.springs ... -
spring MessageSource
2009-06-12 13:06 1254http://www.blogjava.net/xzclog/ ... -
PagedListHolder
2009-03-26 23:32 1647org.springframework.beans.suppo ... -
HOWTO: Use Freemarker, SiteMesh, and Spring MVC(2)
2009-03-19 23:52 2013Here's an example of the Freema ... -
HOWTO: Use Freemarker, SiteMesh, and Spring MVC(1)
2009-03-19 23:50 4762<object classid="c ... -
spring mvc & freemarker 版ROR
2008-06-19 01:27 3529实现COC原则无配置自动映射 引用http://localho ... -
spring mvc 也能实现 ror 类似的URL路由
2008-06-18 18:54 3549看过ror的朋友一定知道它所体现的一个核心思想就是惯例优先原则 ... -
重头开始学 Spring JPetStore 5
2008-06-18 18:25 2012重头开始学 Spring JPetStore 4 里面的Con ... -
重头开始学 Spring JPetStore 4
2008-06-18 15:42 2429跟踪一个 .do 请求吧 就它了。 Enter the S ... -
重头开始学 Spring JPetStore 2
2008-06-17 11:50 17352. BUILD AND DEPLOYMENT 编译和发布 ... -
重头开始学 Spring JPetStore 1
2008-06-17 11:35 1618先看看它的readme.txt 引用@author Juer ... -
一个关于Spring的好消息及Spring Batch概述
2008-05-26 00:45 56563年前,即将大学毕业,遇到了spring,还以SSH框架为题做 ...
相关推荐
学习Spring 的例子JpetStore
spring附带的例子 jpetstore 包括spring mvc 和 struts
NULL 博文链接:https://jnh.iteye.com/blog/452766
用spring改造的jpetstore4.0,适用于jdk7+,tomcat6+。mysql数据库
spring自带的JPetStore,我已经配置好(数据库也配置好,用的是hsqldb),可以直接导 入eclipse中运行。共3个压缩包
最新spring带的JPetStore的MyEclipse项目,包括了数据库,可用hsqldb直接运行,可以直接导入MyEclipse中并部署运行。 在Myeclipse里新建一个web项目,导入shopping项目即可,数据库在db文件夹里
本例子经过修改,配置,组装成了一个可直接部署运行,不需要修改的demo,是学习spring ibatis struts 的一个非常好的例子。绝对好东西!!尽情下吧!!!
spring的jpetstore实例,可以直接用myeclipse打开的工程,里面含有建数据库的文件。
spring jpetstorespring jpetstorespring jpetstorespring jpetstorespring jpetstorespring jpetstore
这是使用Struts+Spring+Hibernate实现jpetstore的功能的源代码
jpetstore学习j2ee的好资料,可以学到很多的设计模式
NULL 博文链接:https://tgwall163.iteye.com/blog/1219314
NULL 博文链接:https://ritaleo.iteye.com/blog/723394
该jpetstore经典案例为最新SPRING开发包里面的完全案例,并集成到eclipse里面了,在eclipse里面可以直接运行并调试,在工作目录里面直接建立jpetstore目录,自动导入该目录下文件,修改jdbc.properties配置文件,连接...
在原有的JPetStore5.0的基础上修改,数据持久层用hibernate替换原有的ibatis;添加Spring框架。
用jpetstore学习架构 使用Spring boot+MyBatis +MySQL
myeclipse些测试运行成功
eclipse环境下spring框架的宠物商店的例子目录结构~
Struts+Spring+ibatis开发的Jpetstore宠物商店的开源程序,在SourceForce上下载的,学JAVA WEB开发的人研究的热门开源程序。有需要的同学分享吧!这里提供的是一个下载地址,因为有点大,所以就提供了一个地址,大家...