刚用JSP写了一个很很很简单的东西,就是实现以下页面的跳转。
起始页面如下(这个正常显示):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>KingIV图管系统登陆界面</title>
<style type="text/css">
<!--
.STYLE1 {
color: #0000CC;
font-weight: bold;
}
body,td,th {
color: #00CC33;
}
body {
background-color: #CCFF66;
}
-->
</style>
</head>
<body>
<h1 align="center" class="STYLE1">KingIV图书馆信息管理系统</h1>
<form id="loginForm" name="loginForm" method="post" action="mainPage.jsp">
<div align="justify" class="STYLE1">
<p align="center"> 用户名
<input type="text" name="username" />
</p>
<p align="center">密 码
<input type="text" name="password" />
</p>
<p align="center">
<input type="submit" name="login" value="登录" />
<input type="reset" name="cancle" value="取消" />
</p>
</div></form>
<h1 align="center" class="STYLE1"> </h1>
<h1 align="center" class="STYLE1"> </h1>
</body>
</html>
下面是跳转后的页面,就是简单地输出用户名,但怎么结果竟然是源文件出来啦,尴尬~~~
<%@ page contentType="text/html; charset=gb2312"%>
<head>
<title>test</title>
<style type="text/css">
<!--
.STYLE1 {
color: #CC0000;
font-size: xx-large;
}
-->
</style>
</head>
<body>
这是您提交的数据:</br>
用户名<%=request.getParameter("username")%>
</body>
</html>
哪位大虾给指导一下,感激不尽~~~
起始页面如下(这个正常显示):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>KingIV图管系统登陆界面</title>
<style type="text/css">
<!--
.STYLE1 {
color: #0000CC;
font-weight: bold;
}
body,td,th {
color: #00CC33;
}
body {
background-color: #CCFF66;
}
-->
</style>
</head>
<body>
<h1 align="center" class="STYLE1">KingIV图书馆信息管理系统</h1>
<form id="loginForm" name="loginForm" method="post" action="mainPage.jsp">
<div align="justify" class="STYLE1">
<p align="center"> 用户名
<input type="text" name="username" />
</p>
<p align="center">密 码
<input type="text" name="password" />
</p>
<p align="center">
<input type="submit" name="login" value="登录" />
<input type="reset" name="cancle" value="取消" />
</p>
</div></form>
<h1 align="center" class="STYLE1"> </h1>
<h1 align="center" class="STYLE1"> </h1>
</body>
</html>
下面是跳转后的页面,就是简单地输出用户名,但怎么结果竟然是源文件出来啦,尴尬~~~
<%@ page contentType="text/html; charset=gb2312"%>
<head>
<title>test</title>
<style type="text/css">
<!--
.STYLE1 {
color: #CC0000;
font-size: xx-large;
}
-->
</style>
</head>
<body>
这是您提交的数据:</br>
用户名<%=request.getParameter("username")%>
</body>
</html>
哪位大虾给指导一下,感激不尽~~~
转载于:https://blog.51cto.com/wwssttt/382085