关于页面的跳转

myeclipse上建了一个web progect

然后又建了一个index.html
一个test.jsp


index.html的代码是:
<html>
<head>
<title>index</title>
</head>

<body>
<form action = "test.jsp" method = "get" name ="form1">
用户名:<input type = "text" name = "username"/><br>
密 码:<input type = "password" name = "userpass"/><br>
<input type = "submit" value = "提交"/>
<input type = "reset" value = "重置"/>
</form>
</body>
</html>


test.jsp的代码是:
<%@ page language="java" import="java.util.*,java.text.*" contentType="test/html; charset=gbk"%>
<html>
<head>
<title>test</title>
</head>

<body>
你输入的用户名是:<%=request.getParameter("username") %><br>
你输入的密码是:<%=request.getParameter("userpass") %><br>
你好! <br>
今天是
<%
Date now =new Date();
SimpleDateFormat formater = new SimpleDateFormat("yyyy/MM/dd/");
String strCurrentTime = formater.format(now);
out.println(strCurrentTime);
%>
</body>
</html>


我想从index.html跳转到test.jsp上

可是出现两个问题:
1 我用http://localhost:8080/Y2JAVAEE/index.html 不能登入(tomcat我启动的了)
2.我直接双击index.html这个文件可以显示内容,跳转到test.jsp上,不能输出<%=request.getParameter("username") %>和<%=request.getParameter("userpass") %> 这两个部分,我以为是没有传递数据过来,就添加了下面的一段显示时间的代码,结果还是不能显示。
有没有哪个大大知道这是什么原因?
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值