首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

Servlet跳转进来JSP页面什么都不显示

2012-09-11 
Servlet跳转进入JSP页面什么都不显示?servlet代码:Java codepublic class TestServlet extends HttpServle

Servlet跳转进入JSP页面什么都不显示?
servlet代码:

Java code
public class TestServlet extends HttpServlet {        private static final long serialVersionUID = 5222793251610509039L;    public void doPost(HttpServletRequest request, HttpServletResponse response)            throws ServletException, IOException {        response.setContentType("text/html;charset=UTF-8");        request.setCharacterEncoding("UTF-8");            }    public void doGet(HttpServletRequest request, HttpServletResponse response)            throws ServletException, IOException {        doPost(request,response);    }    }


JSP代码:
HTML code
<%@ page language="java" import="java.util.*" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%><%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html>  <head>    <base href="<%=basePath%>">        <title>My JSP 'index.jsp' starting page</title>    <meta http-equiv="pragma" content="no-cache">    <meta http-equiv="cache-control" content="no-cache">    <meta http-equiv="expires" content="0">        <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">    <meta http-equiv="description" content="This is my page">    <script>        window.onload=function(){            alert("");        }    </script>  </head>  <body>用户名:<input type="text" id="username" onblur=""/><label id="msg"></label>  </body></html>


加入小脚本就可以显示,但加入js和html代码都无法显示,怎么会这样呢?

[解决办法]
没理解楼主的意思

热点排行