/*
 * Copyright 2002-2014 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.web.bind.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.springframework.stereotype.Controller;

/**
 * A convenience annotation that is itself annotated with {@link Controller @Controller}
 * and {@link ResponseBody @ResponseBody}.
 * <p>
 * Types that carry this annotation are treated as controllers where
 * {@link RequestMapping @RequestMapping} methods assume
 * {@link ResponseBody @ResponseBody} semantics by default.
 *
 * @author Rossen Stoyanchev
 * @author Sam Brannen
 * @since 4.0
 */
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Controller
@ResponseBody
public @interface RestController {

/**
     * The value may indicate a suggestion for a logical component name,
     * to be turned into a Spring bean in case of an autodetected component.
     * @return the suggested component name, if any
     * @since 4.0.1
     */
    String value() default "";

}

@RestController的更多相关文章

  1. @Controller和@RestController的区别?

    @Controller和@RestController的区别?官方文档:@RestController is a stereotype annotation that combines @Respon ...

  2. @Controller和@RestController的区别

    1. Controller, RestController的共同点 都是用来表示spring某个类的是否可以接收HTTP请求 2.  Controller, RestController的不同点 @C ...

  3. spring 4 @RestController 小试

    在建立好基本的spring框架后,可以尝试实现一下简单的rest风格请求 1.需要引入的包,部分pom.xml文件 <dependency> <groupId>org.code ...

  4. RestController 和Controller的区别

    restful风格,restcontroller与controller 初步接触springmvc的时候,被要求使用restful风格,彼时一头雾水,不懂何谓restful,参阅了很多资料,慢慢的接触 ...

  5. @RestController注解下返回到jsp视图页面

    spring4.1中添加了@RestController注解很方便,集成了@ResponseBody注解,无需再在每个方法前添加了..但是却发现个问题..之前用@Controller注解的时候经常会如 ...

  6. restController与Controller-待续

    restController包含controller和responseBody, restController返回一个对象时,会自动转换成json格式的数据,如果要返回视图和对象的那只能用contro ...

  7. Spring中@Controller和@RestController之间的区别

    1. Controller, RestController的共同点 都是用来表示Spring某个类的是否可以接收HTTP请求 2.  Controller, RestController的不同点 @C ...

  8. @RestController注解下返回到jsp视图页面(转)(转)

    这个问题我也遇到过,下面的方法可以试试 蓝萝卜blu @RestController注解下返回到jsp视图页面 spring4.1中添加了@RestController注解很方便,集成了@Respon ...

  9. SpringMVC中Controller和RestController

    项目中的@Controller下有的是返回String类型的(比如getAllBook),有的是void的,当然,String类型是转发的页面,在void中用的是pringwrite,我今天想做一件事 ...

  10. Spring 的@Controller 和@RestController的区别

    @RestController Spring 4.0中新增的特性 @RestController 继承自 @Controller,相当于@ResponseBody + @Controller   1. ...

随机推荐

  1. Android省电开发 浅析

    相信对于Android App省电的开发,一切性能优化都可以达到App的省电开发,所以一个省电的Android应用,性能优化占据很重要的位置.除此之外整理了几点关于Android应用省电的开发技巧. ...

  2. 操作iis

    以后研究 try { string method = "Recycle"; string AppPoolName = "z.chinabett.com"; Di ...

  3. ecshop首页调用指定商品分类下的商品品牌列表

    转之--http://www.16css.com/ecshop/735.html 通过二次开发可以实现ECSHOP首页调用指定分类下的品牌列表. 第一步: 打开根目录下的index.php 在最后面 ...

  4. iOS之多线程开发NSThread、NSOperation、GCD

    原文出处: 容芳志的博客   欢迎分享原创到伯乐头条 简介iOS有三种多线程编程的技术,分别是:(一)NSThread(二)Cocoa NSOperation(三)GCD(全称:Grand Centr ...

  5. StartCoroutine/StopCoroutineInvoke

    本文由博主(YinaPan)原创,转载请注明出处:http://www.cnblogs.com/YinaPan/p/Unity_Coroutine.html using UnityEngine; us ...

  6. 一个小玩具:NDK编译FFmpeg的例子

    FFmpeg NDK编译 和最简单的APK 准备 硬件: 一台电脑,实验在Lenovo T430上 一个Android设备,实验在 三星S3/A7 编译环境: Ubuntu 14.04 (ant\ja ...

  7. 在PyQt4中使用matplotlib

    matplotlib作为Python中著名的数据可视化工具,其官网也提供了在PyQt4中使用的源码,这里举一个应用实例,以备不时之需. 1) 利用Qt Designer创建GUI界面 Demo的GUI ...

  8. [Struts2学习笔记] -- 环境配置

    在创建好WebProject后,就可以开始进行Struts2的环境配置,可以到Struts2官网下载,本环境使用struts-2.3.24.1版本. 首先导入必要的jar包到WebProject的/W ...

  9. ARM内核和架构都是什么意思,它们到底是什么关系?

    ARM产品越来越丰富,命名也越来越多.很多朋友提问: ARM内核和架构都是什么意思?内核和架构的关系是什么?比如ARMv7架构,这个架构指的是什么?小编选出了几个精彩回答!希望对嵌友们在选择设计电路时 ...

  10. ORACLE数据库操作基本语句

    1.登陆SPL*PLUS [username/password] [@server] as [sysdba|sysoper] eg. system/password or connect sys/pa ...