qq_浩然_9
2019-03-17 10:01
<body>
<h1>request内置对象</h1>
<%
request.setCharacterEncoding("utf-8");//解决中文乱码问题,无法解决URL传递中文乱码问题。
%>
用户名:<%=request.getParameter("username")%>
密码:<%=request.getParameter("password") %>
爱好:<%
String[] favorites = request.getParameterValues("favorite");
for(int i = 0;i < favorites.length;i++){
out.println(favorites[i]+" ");
}
%>
</body>
for(int i = 0;i < favorites.length;i++) i<后面多了个空格
三月 17, 2019 10:02:59 上午 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [jsp] in context with path [/MyJspProject] threw exception [java.lang.ClassNotFoundException: org.apache.jsp.request_jsp] with root cause
java.lang.ClassNotFoundException: org.apache.jsp.request_jsp
Stacktrace:] with root cause
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: [17] in the jsp file: [/request.jsp]
Syntax error on token "Invalid Character", delete this token
14: 瀵嗙爜:<%=request.getParameter("password") %>
15: 鐖卞ソ:<%
16: String[] favorites = request.getParameterValues("favorite");
17: for(int i = 0;i <銆?favorites.length;i++){
18: out.println(favorites[i]+" ");
19: }
20: %>
我只要把这段代码替换成老师,就没有任何问题。
JAVA遇见HTML——JSP篇
248278 学习 · 3071 问题
相似问题