黑马程序员技术交流社区
标题:
JSP文件不能文本格式化的问题
[打印本页]
作者:
25343215
时间:
2013-12-7 21:51
标题:
JSP文件不能文本格式化的问题
本帖最后由 25343215 于 2013-12-7 22:00 编辑
MyEclipse8.5 工程缺省编码utf-8 ,在一些JSP文件中无法使用 format Ctrl+Alt+F。然后文件还不报错。而且这错误只在个别JSP文件中有。虽然出现这个问题,但是工程一切正常,JSP界面照常使用
一格式化,就出现下图中的错误:
360软件小助手截图20131207214835.jpg
(66.01 KB, 下载次数: 32)
下载附件
2013-12-7 21:49 上传
这是出现错误的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>
<script type="text/javascript">
function change(){
//切换验证码 这里为什么要传递时间?
document.getElementById("myimg").src="/day09user/checkcode?"+new Date().getTime();
}
</script>
</head>
<body>
<h1>
用户注册
</h1>
<!-- 错误信息回显 -->
<h3 style="color: red">
${requestScope.msg}
</h3>
<!-- ${pageContext.request.contextPath} -->
<form action="/day09user/regist" method="post">
<table>
<tr>
<td>
用户名
</td>
<!-- 这里name属性的值,需要和javabean属性名称对应 -->
<td>
<input type="text" name="username">
</td>
</tr>
<tr>
<td>
密码
</td>
<td>
<input type="password" name="password">
</td>
</tr>
<tr>
<td>
确认密码
</td>
<td>
<input type="password" name="repassword">
</td>
</tr>
<tr>
<td>
邮箱
</td>
<td>
<input type="text" name="email">
</td>
</tr>
<tr>
<td>
验证码
</td>
<td>
<input type="text" name="checkcode">
<img src="/day09user/checkcode" id="myimg" onclick="change();"
style="cursor: pointer;" />
</td>
</tr>
<tr>
<td colspan="2">
<input type="submit" value="注册">
</td>
</tr>
</table>
</form>
</body>
</html>
复制代码
作者:
25343215
时间:
2013-12-8 14:24
{:soso_e101:}
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/)
黑马程序员IT技术论坛 X3.2