[求助]我的程序代码
<%@ page contentType="text/html; charset=gb2312"%>
<%@ page import ="Register"%>
<% !
public String codeString(String s)
{
String str=s;
try{byte b[]=str.getBytes("ISO-8859-1");
str=new String(b);
return str;
}
catch(Exception e)
{
return str;
}
}
%>
<html>
<head>
<title>注册信息</title>
</head>
<body>
<%@ include file="head.txt"%>
<% String str=response.encodeURL("userRegister.jsp");%>
<p>输入你的注册信息。其中带*号的必须填写:
<form action="<%=str%>" Method = "post">
<br>登录名称<input type=text name="logname">*<br>
<br>真实姓名<input type=text name="realname">*<br>
<br>设置密码<input type=password name="password">*<br>
<br>电子邮件<input type=text name="email">*<br>
<br>联系电话<input type=text name="phone">*<br>
<br>通信地址<input type=text name="address">*<br>
<br><input type=submit name="g" value="提交">
</form>
<jsp:useBean id="login" class="Register" scope="request">
</jsp:useBean>
<%
String logname="",realname="",password="",email="",phone="",address="";
if(!(session.isNew()))
{
logname=request.getParameter("logname");
if(logname==NULL)
{
logname="";
}
logname=codeString(logname);
password=request.getParameter("password");
if(password==null)
{
password="";
}
password=codeString(password);
email=request.getParameter("email");
if(email==null)
{
email="";
}
email=codeString(email);
phone=request.getParameter("phone");
if(phone==null)
{
phone="";
}
phone=codeString(phone);
address=request.getParameter("address");
if(address==null)
{
address="";
}
address=codeString(address);
}
%>
<%
if (!(logname.equals(""))&&!(address.equals(""))&&!(phone.equals(""))&&!(realname.equals(""))!&&(password("")))
{ %>
<jsp:setProperty name="login" property="logname" value="<%=logname%>"/>
<jsp:setProperty name="login" property="realname" value="<%=realname%>"/>
<jsp:setProperty name="login" property="password" value="<%=password%>"/>
<jsp:setProperty name="login" property="email" value="<%=email%>"/>
<jsp:setProperty name="login" property="phone" value="<%=phone%>"/>
<jsp:setProperty name="login" property="address" value="<%=address%>"/>
<%
login.addItem();
}
else
{
out.print("sorry,you should do it again");
}
%>
<%
if(!(session.isNew()))
{
%>
<jsp:getProperty name="login" property="message" />
<%
}
%>
</body>
</html>
我自己看了好几遍了,找不到分号括号什么的不匹配啊!晕了,谢谢斑竹的解答,但是能否麻烦帮我查下错