/*
 * 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. codevs 1213 解的个数(我去年打了个表 - -)

    #include<iostream> #include<cstdio> #include<cstring> using namespace std; int T,x ...

  2. jquery对同级的td做radio限制

    <html> <head> <title></title> <script src="http://libs.baidu.com/jqu ...

  3. C# 自定义线程修改UI(一)

    在Wpf中界面显示数据的修改,都是通过UI线程完成,如果尝试从其他线程中直接修改控件的值回抛出异常,“调用线程无法访问此对象,因为另一个线程拥有该对象”. 例如:http://www.cnblogs. ...

  4. 图解MonoForAndroid开发环境搭建

    电脑系统:windows 8.1 企业版 预装VS:2010旗舰版+2013 with update2旗舰版 ==================================== 1.1 安装ja ...

  5. NSURLConnection下载

    @interface AppDelegate () <NSURLConnectionDataDelegate> {    NSMutableData *mData;} @end @impl ...

  6. (转)你知道Android也有安全模式吗?(地球人都知道了吧)

    使用PC时,我们习惯在安全模式下解决驱动的各种兼容性问题.而你是否又知道,Android手机同样存在安全模式,帮你解决APP的各种冲突问题. 很多Android手机用户都遇到过下面这种极端情况:因为第 ...

  7. table 表格隔行换色实现

    table 表格隔行换色实现 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "htt ...

  8. js监控键盘大小写事件

    JavaScript键盘事件侦听    在使用JavaScript做WEB键盘事件侦听捕获时,主要采用onkeypress.onkeydown.onkeyup三个事件进行出来.该三个事 件的执行顺序如 ...

  9. rename 后缀

    for file in $(find . -name "*.del" -type f);do mv "$file" "${file%.del}&quo ...

  10. Python 函数传递list,传递dict 以及*args和**kargs

    函数之间传递list: def show(ll): for i in ll: print(i) show(['chen','hang','wang','yadan']) #============== ...