这老是报错,我这是UTF-8啊。老师帮我看看吧
来源:5-2 web.xml常用配置(下)
weixin_慕设计3058955
2019-12-30 20:51:50
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>servlet_advanced</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>super</servlet-name>
<servlet-class>com.imooc.servlet.ServletXml</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>super</servlet-name>
<url-pattern>/pattern/*</url-pattern>
</servlet-mapping>
<context-param>
<param-name>name</param-name>
<param-value>小东</param-value>
</context-param>
<error-page>
<error-code>404</error-code>
<location>/error/404.html</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/error/500.html</location>
</error-page>
</web-app>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<h1>没找到相应的服务器</h1>
<h2>nihao</h2>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<h1>编码有误,请核实</h1>
</body>
</html>
1回答
同学你好,同学代码编写的没有问题,老师测试同学的代码也是正确的,具体如下:
同学所描述的The word 'nihao' is not correctly spelled并不是错误哦,而是一个警告,表示同学这个单词拼写的不正确,是没有关系的。
如果我的回答解决了你的疑惑,请采纳!祝学习愉快!
相似问题