
springMVC
JSON_ZJS
热爱生活,热爱编程。
展开
-
Spring开启注解AOP的支持放置的位置
放在springmvc的aop,需要在springmvc的配置文件中写开启aop,而不是spring的配置文件最近使用aop来记录controller的日志.但是发现没有起作用.后来发现是因为我的 aop 是写在controller层(在springmvc的容器中 -web中)而开启aop配置却写在spring(applicationContext.xml)中,所以不起作用,需要在springmvc.xml的配置文件中也开启才行...原创 2021-01-10 18:41:03 · 495 阅读 · 0 评论 -
Spring配置文件约束头
Spring applicationContext.xml<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/sche原创 2020-12-24 14:49:13 · 233 阅读 · 0 评论 -
SpringMVC上传文件
<%-- Created by IntelliJ IDEA. User: Administrator Date: 2020/12/20 Time: 23:57 To change this template use File | Settings | File Templates.--%><%@ page contentType="text/html;charset=UTF-8" language="java" %><html><head原创 2020-12-22 21:14:38 · 138 阅读 · 0 评论 -
@ResponseBody导致的返回值中文乱码
新人学习springMVC开发框架,用到ajax 通过 @ResponseBody 来获取返回值。不得不说 @ResponseBody的功能很强大,可以直接将返回类打包成json格式省却了很多事,但是如果返回值是String类型的话,就会出现中文乱码问题,自己试着做了一些调整,并在网上查看了许多方法,在这里总结一下。1.添加注解 produces = {“application/json;charset=UTF-8”}@RequestMapping(value = “/method.do”, p原创 2020-06-02 09:30:01 · 434 阅读 · 0 评论 -
SpringMVC跨服务器上传文件中出现405错误
解决引用地址SpringMVC跨服务器上传文件中出现405错误原创 2020-02-11 20:13:36 · 551 阅读 · 0 评论 -
使用Jersey跨服务器上传图片 报405 Method Not Allowed错误
springMVC跨服务器上传 报错:HTTP Status 500 – Internal Server ErrorType 异常报告消息 Request processing failed; nested exception is com.sun.jersey.api.client.UniformInterfaceException: PUT http://localhost:9090/...原创 2020-02-11 20:10:16 · 631 阅读 · 0 评论