问题描述
在jsp文件中,加入随string类型的长度判断if语句之后,表单无法正常显示出来。问题代码如下:
问题代码
<body>
<%
HttpSession sessionId=request.getSession();
if (session.isNew()){
response.getWriter().println("session创建成功,session的id是:"+sessionId);
}else {
response.getWriter().println("服务器已经存在该session了,session的id是:"+sessionId);
}
String str = request.getParameter("boy");
/*---------------------问题部分--------------------*/
if (str.length()==0){
response.getWriter().println("session的id是:"+sessionId);
session.setAttribute("txt",new String());
}else {