求解下面问题

来源:3-10 response对象

慕容9162802

2018-10-10 15:23

我在eclipse中代码是:

<%@ page language="java" import="java.util.*,java.io.*" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8" %>
 <%
    response.setContentType("text/html;charset=utf-8");  //设置响应的MIMI类型
    out.println("<h1>response内置对象</h1>");
    out.println("<hr>");
   // out.flush();
    PrintWriter outer= response.getWriter(); //获得输出流对象
    outer.println("大家好,我是response对象生成的输出流outer对象");
    response.sendRedirect("Reg.jsp");//请求重定向会跳转到指定的jsp页面中
     %>

运行后,总是出现下述界面

HTTP Status 404 – Not Found


Type Status Report

Message /JspInnerObjectDemo/response.jsp

Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.


Apache Tomcat/7.0.8.5.33

写回答 关注

4回答

  • 大侠木头人
    2019-06-10 16:03:08

    你写没有写Reg.jsp页面呢?它重定向到这个页面了.....这俩页面是不是在一个文件夹下呢?

  • qq_Bluememory_0
    2019-03-26 15:24:03

    重建一个

  • 慕容9162802
    2018-10-16 10:18:29

    按照要求去掉 pageEncoding="utf-8",还是出现上面的页面,问题没有解决

  • 奥特曼干死小怪兽
    2018-10-10 16:28:11

     pageEncoding="utf-8" 去掉

JAVA遇见HTML——JSP篇

Java Web入门级教程JSP,带你轻松的学习JSP基础知识

248279 学习 · 3119 问题

查看课程

相似问题