欢迎.JSP文件如何通过从index.html页面获取名称来称呼欢迎用户?

时间:2016-06-22 03:36:07

标签: html jsp

我正在努力做一些非常基本的事情。我创建了一个index.jsp文件

<html>  
<body>  
<form action="welcome.jsp">  
<input type="text" name="uname">  
<input type="submit" value="go"><br/>  
</form>  
</body>  
</html> 

还有welcome.jsp页面

<html>  
<body>  
<%  
String name=request.getParameter("uname");  
out.print("welcome "+name);  
%>  
</form>  
</body>  
</html>

当我尝试运行仅包含这两个文件的应用程序时。然后,我得到index.html页面生成正常。但是,一旦我输入用户名并按提交,它就会出现404错误。

0 个答案:

没有答案