jsp页面利用get方式提交到后台的数据为乱码格式的解决办法
来源:互联网 发布:淘宝先锋乒羽商城 编辑:程序博客网 时间:2024/05/22 00:19
java小白一枚,希望各位大佬多多指点
这是这两天写的一个分页查询跟模糊查询,这篇文章的主题是标红部分,这个值一传到后台就是乱码
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>${u.username }</title>
</head>
<body><center><h1>总页面</h1><h1>欢迎<font color="red">${u.username }</font>先生</h1>
<form action="show" method="post">
电影类型:<input type="text" name="type" size="2px">
上映时间:<input type="text" name="date" size="2px">
<input type="submit" value="查询">
<input type="button" value="添加" onclick="location.href='addUI'">
</form>
<table border="1px">
<tr>
<th>电影姓名</th>
<th>电影类型</th>
<th>电影时间</th>
<th>上映时间</th>
<th>用户评价</th>
<th>操作</th>
</tr>
<c:forEach items="${list.list}" var="m">
<tr>
<th>${m.mname }</th>
<th>${m.mtype}</th>
<th>${m.datee }</th>
<th>${m.date }</th>
<th>${m.grade }</th>
<th>
<input type="button" value="删除" onclick="location.href='dele?id=${m.id}'">
<input type="button" value="修改" onclick="location.href='updateUI?id=${m.id}'">
</th>
</tr>
</c:forEach>
</table>
<input type="button" value="首页" onclick="location.href='show?pagenum=${list.firstPage}&type=${list.type }'">
<c:if test="${list.pageNum>1}">
<input type="button" value="上一页" onclick="location.href='show?pagenum=${list.prePage}&type=${list.type }'">
</c:if>
<c:if test="${list.pageNum<list.lastPage}">
<input type="button" value="下一页" onclick="location.href='show?pagenum=${list.nextPage}&type=${list.type }'">
</c:if>
<input type="button" value="尾页" onclick="location.href='show?pagenum=${list.lastPage}&type=${list.type }'">
共${list.lastPage }页
<form action="show" method="post">
<input type="submit" value="跳到"><input type="text" size="1px" name="pagenum">页
</form>
</center>
</body>
</html>
解决办法:
找到 tomcat下边的conf文件
编辑 server.xml
往里边加一行 URIEncoding="UTF-8"
就OK啦。
- jsp页面利用get方式提交到后台的数据为乱码格式的解决办法
- 解决jsp页面传递通过get方式提交中文到后台乱码的问题
- post方式与get方式提交到Jsp页面中文乱码的处理
- jsp中Get提交方式的中文乱码解决办法
- jsp中Get提交方式的中文乱码解决办法
- jsp中Get提交方式的中文乱码解决办法
- jsp中Get提交方式的中文乱码解决办法
- jsp中Get提交方式的中文乱码解决办法
- jsp数据传递到后台为中文乱码的解决方法
- tomcat中页面利用get方式提交的参数中的中文乱码问题
- JSP中Get提交方式的中文乱码解决
- JSP下get方式提交请求乱码解决办法
- 如何在jsp页面下载后台服务器返回的数据并保存为txt格式
- 关于jsp页面上中文数据传递到后台成乱码的解决方法
- jsp页面传到后台的参数为乱码
- Android通过Get方式提交数据的乱码处理
- jsp 页面的提交方式
- JSP页面输入汉字为乱码的解决办法
- 软件地址
- EventBus
- SSMA
- Java继承中的构造方法
- Java中的控制语句
- jsp页面利用get方式提交到后台的数据为乱码格式的解决办法
- 面向对象(下)
- vim中末行去掉^M
- 无法将类型为“Microsoft.Office.Interop.Excel.ApplicationClass”的 COM 对象强制转换为接口类型“Microsoft.Office.Interop.Ex
- 【数据结构】二叉树!!!
- VTK学习-坐标系统
- 【学以致用】android功能实现3---UIautomator 2.0(2)
- glide框架的简单使用
- 欢迎使用CSDN-markdown编辑器