客户端程序:
<html>
<head>
<title>简单登录界面</title>
</head>
<body>
<form action="1-4.jsp" method="post">
<table width="203" border="0" cellpadding="5" cellspacing="0">
<tr>
<td width="67">用户名: </td>
<td width="114"><input name="name" type="text" id="name" size="15"></td>
</tr>
<tr>
<td>密码:</td>
<td><input name="password" type="password" id="passwd" size="15"></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="确定">
<input name="reset" type="reset" value="取消"></td>
</tr>
</table>
</form>
</body>
</html>服务器端程序:
<%
String nn=request.getParameter("name");
String pw=request.getParameter("passwd");
out.println("Your name is: "+nn+"<br>");
out.println("Your password is: "+pw);
%> 问题:当单击确定时,出现打开或保存jsp文件。
请各位大侠帮忙解决,怎样实现对客户端的处理。
<html>
<head>
<title>简单登录界面</title>
</head>
<body>
<form action="1-4.jsp" method="post">
<table width="203" border="0" cellpadding="5" cellspacing="0">
<tr>
<td width="67">用户名: </td>
<td width="114"><input name="name" type="text" id="name" size="15"></td>
</tr>
<tr>
<td>密码:</td>
<td><input name="password" type="password" id="passwd" size="15"></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="确定">
<input name="reset" type="reset" value="取消"></td>
</tr>
</table>
</form>
</body>
</html>服务器端程序:
<%
String nn=request.getParameter("name");
String pw=request.getParameter("passwd");
out.println("Your name is: "+nn+"<br>");
out.println("Your password is: "+pw);
%> 问题:当单击确定时,出现打开或保存jsp文件。
请各位大侠帮忙解决,怎样实现对客户端的处理。
你用对服务器了吗?你应该不会用的是iis或一般的web吧?
服务器端程序:
<%
String nn=request.getParameter("name");
String pw=request.getParameter("passwd");
out.println("Your name is: "+nn+"<br>");
out.println("Your password is: "+pw);
%>
就有问题了,没有文件头
1-4.Jsp
1-4.jSp
1-4....
String nn=request.getParameter("name");
String pw=request.getParameter("passwd");
out.println("Your name is: "+nn+"<br>");
out.println("Your password is: "+pw);
%>
这一段放在 1-4.jsp 这个文件中
<%@ page contentType="text/html; charset=GBK" %>
--------
就像上位仁兄说的那样
<%@ page contentType="text/html;charset=UTF-8"%>