一:HttpSeesion session=request.getSession(true)和request.getSession(false)的区别,什么时候用true,什么时候用false?
二:判断两个String字符串,用“==”还是用“equals()”,两者有什么区别?
三:javaw.exe是干什么用的,为什么我一关掉javaw.exe,Myeclipse就自动关掉了。(我有个程序调不出来,别人让我关掉tommcat和Myeclipse,关掉javaw.exe,但是关了之后,还是调不出来)
四:jsp页面
<html>
<head><tilte></title></head>
<body>
<from method="get" action="servlet/TestServlet">
<table>
<tr>
<td><input type="text" name="pass"/></td>
<td><input type="sumbit" name="ok" value="ok"/></td>
</tr>
</table>
</form>
</body>
</html>
TestServlet内容:
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.http.HttpSession;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class RegisterServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {
response.setContentType("text/html;charset=gbk");
PrintWriter out=response.getWriter();
String pass=(String)request.getParameter("pass");
//测试
System.out.println("系统输出");
out.println("hahaha!!!");
out.println(pass);
}
public void doPost(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException { doGet(request,response);}
}
问题:我在jsp页面里输入“123”,为什么输出的是“hahaha!!! null”
而不是“hahaha!!! 123”?