新手请教高手:JSP编译问题

来源:百度知道 编辑:UC知道 时间:2024/06/07 16:03:13
比如我用JSP程序中的request.getParameter()获取(*.HTML)中的用户名和密码,当我点击"提交"按钮时并没有发回Tomcat服务器的回执信息,而是直接打开了我编写的JSP的源代码?请问这是为什么呀?怎么解决?急切!
谢谢!
下面是我的F:\Tomcat5.5\Tomcat 5.5\webapps\ROOT两个源程序:
request.html:
<%@page langnage="java" contentType="text/html;charset=gb2312" %>
<form mothod="post" action="2.jsp">
用户名:<input type="text" name="Name">
密  码:<input type="password" name="pass">
<input type="submit" value="提交">
<input type="reset" value="重填">
</form>

2.jsp
<% String s=request.getParameter("Name");
String a=request.getParameter("pass");
%>
怎么取不到值呢?急切!

补充,你运行时,浏览器里的地址是什么?
两个请都给出。
==================
请发源代码。或者你运行的方式不正确。

2.jsp就给了这两行么???

你要在那里看s和a 的值!!!

你要明白现在 s和a 是一个临时变量哦!!! 这个明白么???

最好不要在ROOT里面建立你的文件

重新整一个名字 然后应该输入http://localhost:8080/工程名字/request.html