【发布时间】:2017-12-15 10:33:53
【问题描述】:
我正在修改一个 JSP 文件,其中的所有日文字符都没有显示如下。
<input type="submit" name="form" value="ç»é²"> <!-- MEMO æãã¯ãããã£ã¦ãããã<button name="form">ç»é²</button>
<input type=button ãããªã®ã¯åå¨ããªã-->
能恢复吗?
*我添加了更多信息:
编辑:STS
编码:UTF-8
日文的编码已经是UTF-8,所以我什么都没做。
更多示例:
header.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!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>Insert title here</title>
</head>
<body>
loginForm.jsp
<%@include file="/WEB-INF/views/common/header.jsp"%>
<div align="center">
<form action="${pageContext.request.contextPath}/top" method="GET"> <!-- FIXME postã«修æÂ£ -->
<table border="0">
<tr>
<td>ã¦ã¼ã¶ID:</td>
<td><input type="text" name="userId" /></td>
</tr>
<tr>
<td>ãã¹ã¯ã¼ã:</td>
<td><input type="password" name="password" /></td>
</tr>
</table>
<input type="submit" value="ãã°ã¤ã³"/>
【问题讨论】:
-
你用的是什么编辑器? JSP 文件的编码是什么(例如 UTF-8)?你试过在编辑器中切换编码吗?
-
@JozefChocholacek 我添加了更多信息。
-
@JozefChocholacek 我自己解决了。如果我尝试切换编码,我从您的建议中得到了提示。谢谢!
标签: jsp