jsp部分乱码(并不是没有设置编码的问题)
2024-09-08 15:29:43
当页面跳转的时候,还是有中文的乱码存在,最后发现我没有写页面的提交方式,
<form action = "show.jsp">
用户名:<input type="text" name = "uname"><br/>
密码:<input type="password" name = "upwd"><br/>
年龄:<input type = "text" name = "uage"><br/>
爱好:<br/>
<input type = "checkbox" name = "uhobbies" value="乒乓球"/>乒乓球
<input type = "checkbox" name = "uhobbies" value="足球"/>足球
<input type = "checkbox" name = "uhobbies" value="篮球"/>篮球<br/>
<input type = "submit" value="注册">
</form>
这就是之前的页面的语句,会出现跳转似的乱码,
<form action = "show.jsp" method="post">
用户名:<input type="text" name = "uname"><br/>
密码:<input type="password" name = "upwd"><br/>
年龄:<input type = "text" name = "uage"><br/>
爱好:<br/>
<input type = "checkbox" name = "uhobbies" value="乒乓球"/>乒乓球
<input type = "checkbox" name = "uhobbies" value="足球"/>足球
<input type = "checkbox" name = "uhobbies" value="篮球"/>篮球<br/>
<input type = "submit" value="注册">
</form>
加上method之后就没有乱码了,好了 问题解决了,原因是:
当我把代码中的post改为get之后,页面的乱码问题又出现了
如果不写指定method的话,默认是使用get方式提交。
get的限制表单的数据集为ASCII码。
而Post支持整个ISO10646字符集,默认是用ISO-8859-1
如果表单不显示的声明method为post,则默认为get。
最新文章
- [leetcode] 题型整理之数字加减乘除乘方开根号组合数计算取余
- CSS3 perspecitve属性
- WP8.1中C++的winodws运行时组件位移操作的差异
- .NET平台下的微信SDK(Rabbit.WeiXin)开源发布
- The Dataflow Model 论文
- LeetCode Basic Calculator
- 使用node-webkit开发exe窗口程序
- Win7在CMD命令行中使用管理员权限运行命令
- DataSet DataTable操作
- linux kernel API and google android compile guide
- Http协议、线程、线程池
- 2013 ACM/ICPC 成都网络赛解题报告
- C陷阱与缺陷代码分析之第1章词法陷阱
- Object-C iOS纯代码布局 一堆代码可以放这里!
- phpadmin增加使得项目能连接数据库
- 升级Centos 7/6内核版本到4.12.4的方法
- APACHE 安装
- 总结Unity 初学者容易犯的编译与运行时错误
- Ikki&#39;s Story IV - Panda&#39;s Trick POJ - 3207(水2 - sat 在圈内 还是 在圈外)
- linux基础练习题(1)
热门文章
- vue3 学习笔记(九)——script setup 语法糖用了才知道有多爽
- c# System.Text.Json 精讲
- Codeforces 840E - In a Trap(树分块+trie)
- Codeforces 983E - NN country(贪心+倍增优化)
- CF Edu Round 71
- 有关[Http持久连接]的一切,撕碎给你看
- python20判断变量是否存在
- 学习java的第五天
- 游戏案例|Service Mesh 在欢乐游戏的应用演变和实践
- Spark基础:(四)Spark 数据读取与保存