[英]Internet explorer browser not submitting data correctly but ok in firefox and chrome
I have a JSP page that displays a field called a company , and this company field has the characters "á é ó ú". 我有一个显示名为公司领域的JSP页面,而这个公司字段中的字符“A Eóú”。 I have a company.jsp page that displays the company name correctly on internet explorer browser. 我有一个company.jsp页面,可在Internet Explorer浏览器上正确显示公司名称。
However when the user clicks submit button from the company.jsp with debug mode enabled in eclipse, the field company is replaced with ????. 然而,当用户点击从在Eclipse中启用调试模式company.jsp 提交按钮,该领域的公司被替换????。 Based on the online resources it looks like an encoding issue. 根据在线资源,它看起来像是一个编码问题。
The following line is used to retrieve the company: 以下行用于检索公司:
request.getParameter("companyName")
I have added the following config: 我添加了以下配置:
<%@page contentType="text/html" pageEncoding="UTF-8"%>
this is added in the jsp page. UTF-8配置- <%@page contentType="text/html" pageEncoding="UTF-8"%>
这已添加到jsp页面中。 request.setCharacterEncoding("UTF-8")
- This is added to the methods that retrieves the company field. request.setCharacterEncoding("UTF-8")
-这被添加到检索公司字段的方法中。 <parameter-encoding default-charset="UTF-8" />
in the glassfish-web.xml file. 由于我正在使用glassfish,因此在glassfish-web.xml文件中添加了<parameter-encoding default-charset="UTF-8" />
。 The data is displayed correctly but the same data is submitted it is replaced by question marks on IE. 数据正确显示,但提交的数据相同,但已被IE上的问号代替。
I am not sure how to solve the above issue any advice, please? 我不确定如何解决上述问题有任何建议吗?
实际上,这似乎是编码问题,但是您提交后是否检查公司名称是否确实在请求对象中?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.