jsp 代码不知写的是否正确?请大家指点!

来源:百度知道 编辑:UC知道 时间:2024/09/22 18:20:21
我自己写的一段,用户登录的代码?不知道写的是哪里有错,运行时没有说语句错误,但是出现提示异常,
“HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP: ”
大家帮看看指点指点,主页面我就不贴出来了,反正是html的,我的代码如下:
<%@ page contentType="text/html; charset=gbk"%>
<html>
<head><title>用户登录</title></head>
<body bgcolor="aycn">
<center>
<font color="#ff0000" size="5">
<%
String name= request.getParameter("username");
String pwd= request.getParameter("password");
request.setCharacterEncoding("GBK");
%>
<%
if(name.trim().length()==0 && (name.trim().length()>10) || (name.trim().length()<2)){
%>
<jsp:forward page="error1.jsp"/&

是不是你最后一个"}"写掉了?
还有就是indexOf()方法里面的参数
"a-z"只能作为一个字符串传递,并不能表示a和z之间的所有字母

我发现你最后一个判断:
if (....) { 没有配对的}