`
iloveflower
  • 浏览: 80365 次
社区版块
存档分类
最新评论
  • iloveflower: 呵呵。好好学习。。。。。。。。。。。。
    java 读书
  • Eric.Yan: 看了一点,不过是电子版的……你这一说到提醒我了,还要继续学习哈 ...
    java 读书

Spring MVC Tutorial

    博客分类:
  • SSH
 
阅读更多
http://www.mkyong.com/tutorials/spring-mvc-tutorials/

Happy learning Spring MVC
Let go through a quick start to understand how Spring MVC framework works.
Spring 3 MVC hello world example
what you need to develop Spring 3 MVC web application.
Spring 3 REST hello world example
Develop REST style web application in Spring 3 MVC.
Spring 2.5.6 MVC hello world example
XML-based Spring 2.5.6 MVC hello world example.
Spring 2.5.6 MVC hello world annotation example
Annotation-based Spring 2.5.6 MVC hello world example.

Handler Mapping

Define how web request (URL) maps to the Controller handlers.
BeanNameUrlHandlerMapping example
Maps the requested URL to the name of the cocntroller.
ControllerClassNameHandlerMapping example
Uses convention to map the requested URL to Controller.
SimpleUrlHandlerMapping example
Allow developer to specify the mapping of URL patterns and handler mappings explicitly.
Configure the handler mapping priority
If multiple view handler mappings are applied, you have to declare priority to avoid conflict issue.


Controller

Controller class to handle the web request.
MultiActionController example
Group related actions into a single controller class.
MultiActionController annotation example
Multi-actions controller by using annotation, @RequestMapping, he best and easy solution.
PropertiesMethodNameResolver example
A flexible method name resolver for the MultiActionController controller class, it allow to define the mapping between requested URL and method name explicitly.
ParameterMethodNameResolver example
Another method name resolver for the MultiActionController controller class, it allow to map URL to method name via requested parameter name.
ParameterizableViewController example
With ParameterizableViewController, you don’t need to hard code the view name in the controller class anymore, instead, you specify the view name through the ParameterizableViewController’s “viewName” property.


View Resolver

Resolve “view name” that returned from the controller class to a physical view page or JSP page.
InternalResourceViewResolver example
Adding a predefined prefix and suffix to the view name (prefix + view name + suffix), and generate the final view page URL.
XmlViewResolver example
Puts view beans in XML file.
ResourceBundleViewResolver example
Puts view beans in “.properties” file.
Configure multiple view resolvers priority
If multiple view resolver strategies are applied, you have to declare priority to avoid conflict issue.


Form Handling

Form handling in Spring MVC.
Form handling example
Form handling in Spring MVC, XML based version.
Form handling annotation example
Form handling in Spring MVC, annotation version.
Handling duplicate form submission
“Post/Redirect/Get” Design Pattern is the common solution for this duplicated form submission problem.
RedirectView example
A view which redirect to another absolute, context relative, or current request relative URL.
Handling multipage / wizard forms
How to handle multipage forms or wizard form.

Spring’s Form Tag Library

Render HTML form’s components via Spring’s form tag.
Textbox example
<form:input /> tag, render a HTML textbox field.
Password example
<form:password /> tag, render a HTML password field.
Textarea example
<form:textarea /> tag, render a HTML textarea field.
Checkbox and Checkboxes example
<form:checkbox />, <form:checkboxes /> tags, render a single or multiple HTML check boxes.
Radiobutton and Radiobuttons example
<form:radiobutton />, <form:radiobuttons /> tags, render a single or multiple HTML radio buttons.
Dropdown and list box example
<form:select />, <form:option /> and <form:options /> tags, render a HTML dropdown box, multiple select box and listbox.
Hidden value example
<form:hidden /> tags, render a HTML hidden value field.
Form errors tag example
<form:errors /> tag , render those form components error messages.
File upload example
File upload handling via Spring MultipartResolver.


Integrating Spring MVC with other frameworks

Integrate Spring MVC with others.
Spring 3 MVC and JSR303 @Valid example
Using Hibernate validator (JSR303 implementation) to validate bean in Spring MVC.
Spring 3 MVC and RSS feed example
Using ROME to generate RSS feed from Spring MVC.
Spring 3 MVC and XML example
Using JAXB to generate XML output from Spring MVC.
Spring 3 MVC and JSON example
Using Jackson to generate JSON output from Spring MVC.
Spring MVC and Excel file via AbstractExcelView
Using AbstractExcelView to export data to Excel file via Apache POI library.
Spring MVC and Excel file via AbstractJExcelView
Using AbstractJExcelView to export data to Excel file via JExcelAPI library.
Spring MVC and PDF file via AbstractPdfView
Using AbstractPdfView to export data to Pdf file via Bruno Lowagie’s iText library.
Spring MVC and Log4j integration example
Example to integrate Log4j into the Spring MVC application.
分享到:
评论

相关推荐

    Spring MVC tutorial

    **Spring MVC教程** Spring MVC是Spring框架的一部分,用于构建Web应用程序。它是一个基于模型-视图-控制器(MVC)设计模式的轻量级Web开发工具。本教程将深入探讨Spring MVC的核心概念、配置和实践应用。 ### ...

    Spring.MVC-A.Tutorial-Spring.MVC学习指南 高清可复制版PDF

    这个教程“Spring MVC - A Tutorial”旨在帮助开发者深入理解和掌握Spring MVC的核心概念和技术。 首先,Spring MVC的核心设计理念是模型-视图-控制器(Model-View-Controller)架构模式。在该模式中,模型负责业务...

    Spring MVC A Tutorial(2nd) mobi

    Spring MVC A Tutorial(2nd) 英文mobi 第2版 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除

    Spring MVC A Tutorial(2nd) epub

    Spring MVC A Tutorial(2nd) 英文epub 第2版 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除

    Spring MVC, A Tutorial, second edition 【2016】

    Spring MVC: A Tutorial (Second Edition) by Paul Deck AZW3/MOBI/EPUB/PDF 多种版本 This is a tutorial on Spring MVC, a module in the Spring Framework for rapidly developing web applications. The MVC in...

    Spring MVC A Tutorial Second Edition

    本书《Spring MVC A Tutorial Second Edition》是一本易于跟随的学习Spring MVC的入门指南。书中涵盖了关于Spring MVC的诸多知识点,包括Spring框架的基本概念、依赖注入、XML配置、控制器以及Spring MVC的特定内容...

    Spring MVC A Tutorial(2nd) azw3

    Spring MVC A Tutorial(2nd) 英文azw3 第2版 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除

    Spring.MVC-A.Tutorial-Spring.MVC学习指南

    Spring MVC是Spring框架中用于Web应用快速开发的一个模块,其中的MVC是Model-View-Controller的缩写。作为当今业界主流的Web开发框架,Spring MVC已经成为当前热门的开发技能,同时也广泛用于桌面开发领域。  ...

    OSGI整合Spring、Mybatis、Spring MVC实现一个登录应用案例

    在这个案例中,我们将探讨如何整合OSGI、Spring、Mybatis以及Spring MVC来实现一个登录应用。这个教程旨在帮助开发者理解如何在OSGI环境中集成这些流行的Java技术,以构建灵活且可扩展的应用程序。 首先,我们需要...

    spring-mvc-showcase

    《Spring MVC Showcase 深入解析》 Spring MVC 是 Spring 框架的重要组成部分,它为构建基于模型-视图-控制器(Model-View-Controller)架构的 Web 应用程序提供了一种强大的解决方案。本篇文章将深入探讨 "spring-...

    Spring.MVC-A.Tutorial-Spring.MVC学习指南.rar

    Spring MVC是Spring框架中用于Web应用快速开发的一个模块,其中的MVC是Model-View-Controller的缩写。作为当今业界最主流的Web开发框架,Spring MVC已经成为当前最热门的开发技能,同时也广泛用于桌面开发领域。 ...

    Spring MVC 学习代码

    在"Spring MVC 2.* Tutorial"的学习代码中,我们可以深入理解其核心概念和工作流程。 1. **MVC架构** - **Model**:模型层负责处理业务逻辑,通常由 Java 对象组成,它们与数据库交互并处理数据。 - **View**:视...

    spring mvc注释文档

    ### Spring MVC注释文档知识点详解 #### 概述 随着技术的发展与演进,软件开发领域不断出现新的设计理念和技术框架。Spring MVC作为Spring框架...3. [Spring MVC实战](https://www.baeldung.com/spring-mvc-tutorial)

    spring-mvc-tutorial-protobuf:ProtocolBuffers + Spring MVC 4.1

    使用 ProtocolBuffers + Spring MVC 的示例应用程序 获取protobuf $ curl -v http://localhost:8080/person &gt; GET /person HTTP/1.1 &gt; User-Agent: curl/7.30.0 &gt; Host: localhost:8080 &gt; Accept: * / * &gt; &lt; ...

    spring 学习 tutorial例子

    在提供的`tutorial`文件中,你可能会找到一系列逐步引导的示例,包括如何设置Spring项目、配置Bean、实现AOP、使用Spring MVC以及整合其他技术。通过这些实例,你可以亲手操作,加深对Spring的理解。 总的来说,...

Global site tag (gtag.js) - Google Analytics