utf-8-annotation.AnnotationMethodHandlerAdapter?

问题描述

annotation.AnnotationMethodHandlerAdapter?

下面这段代码,大致知道什么意思!求解释下这是用在哪里的?

  <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
        <property name="messageConverters">
            <list>
                <bean class="org.springframework.http.converter.StringHttpMessageConverter">
                <property name="supportedMediaTypes">
                <list>
                    <value>text/html;charset=UTF-8</value>
                </list>
                </property>
                </bean>
            </list>
        </property>
    </bean>

解决方案

https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/servlet/mvc/annotation/AnnotationMethodHandlerAdapter.html

https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/http/converter/StringHttpMessageConverter.html

public class StringHttpMessageConverter
extends AbstractHttpMessageConverter
Implementation of HttpMessageConverter that can read and write strings.
By default, this converter supports all media types (*/*), and writes with a Content-Type of text/plain. This can be overridden by setting the supportedMediaTypes property.

Since:
转换请求编码媒体

时间: 2024-09-20 00:20:38

utf-8-annotation.AnnotationMethodHandlerAdapter?的相关文章

请教一个关于spring mvc hbiernate 的annotation定义事务的配置 位置的问题

问题描述 最近在学习Springmvc和hibernate集合,遇到个问题求大神赐教Spingmvc有两个xml文件,一个是spring-servlet.xml这个是spring相关模板配置,还有一个applicationContext.xml配置数据库,事务.我把<!--使用annotation定义事务--><tx:annotation-driventransaction-manager="transactionManager"proxy-target-class=

android-http请求:pad和浏览器之间有什么区别吗?

问题描述 http请求:pad和浏览器之间有什么区别吗? 20C public Object downFile(String filepath HttpServletRequest request HttpServletResponse response) { response.addHeader(""Access-Control-Allow-Origin""*""); JsonResult jsonResult = new JsonResult

spring通过annotation实例化sessionfactory失败

问题描述 错误日志:严重:Exceptionsendingcontextinitializedeventtolistenerinstanceofclassorg.springframework.web.context.ContextLoaderListenerorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'helloControllor':Injectionofautowiredd

javaweb-springmvc项目中springmvc.xml文件配置错误?

问题描述 springmvc项目中springmvc.xml文件配置错误? org.springframework.beans.factory. BeanCreationException: Error creating bean with name 'houseChangeInfoController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.facto

socket连接,偶尔发生这个异常,是什么原因引起的?

问题描述 socket连接,偶尔发生这个异常,是什么原因引起的? java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:196) at java.net.SocketInputStream.read(SocketInputStream.java:122) at java.net.SocketInputStream.read(SocketInputSt

java-spring注入activiti的接口问题???

问题描述 spring注入activiti的接口问题??? spring注入@Autowiredprotected RepositoryService repositoryService; 代码把注入的接口转换为子类RepositoryServiceImpl repositoryServiceImpl=(RepositoryServiceImpl) repositoryService; 抛出的:严重: Servlet.service() for servlet spring3 threw exc

利用AnnotationMethodHandlerAdapter对Spring的Controller注入session对象

在利用spring的mvc开发过程中,需要将User对象从session中取出来使用.参照网上的做法,我利用 了AnnotationMethodHandlerAdapter来解决这个问题.下面是XML代码,放到web-inf下面的springMVC配 置文件中: <bean id="userArgumentResolver" class="com.greatwall.module.yhqxgl.interceptor.UserArgumentResolver"

SpringMVC3 AnnotationMethodHandlerAdapter与mvc:annotation-driven冲突的解决方案

1.问题 在使用SpringMVC3时,需要对response到页面的数据进行编码设置则需要自定义注解数据格式化类来对页面传过来的字符串进行格式化. 编码设置: <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" > <property name="messageConverters"> <list>

补课了,30分钟让你学会java自定义annotation

自定义Annotation概念篇 来看一个最简单的annotation package com.cts.elt.annotation; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; importjava.lang.annotation.RetentionPolicy; import java.lang.a