JSP:tag文件不能传值出来,求大佬帮看哪里错了

login2.jsp

<%@page contentType="text/html;charset=utf-8" %>
<%@taglib tagdir="/WEB-INF/tags" prefix="test"%>
<html><body bgcolor=pink>
<% String user=request.getParameter("user");
      String password=request.getParameter("password");
       session.setAttribute("user",user);
       session.setAttribute("password",password);
%>
<login2:test user=<%=user %> password=<%=password %> />
 <p style="font-size:20;color:#911005">当前登录状态:<%=message %>
<%  if(message.startWith("登录成功!")) {
%>         <br><a href="shop1.jsp">点击访问商品1购物页面</a>
               <br><a href="shop2.jsp">点击访问商品2购物页面</a>
<%   }
         else  {
%>          <p style="font-size:20;color:#911005">用户名或密码错误
                <br><a href="login1.jsp">点击返回登录页面</a>
<%   }
%>
</body></html>

test.tag

<%@ tag pageEncoding="utf-8" %>
<%@ attribute name="user" required="true" type="java.lang.String" %>
<%@ attribute name="password" required="true" type="java.lang.String" %>
<%@ variable name-given="message"  scope="AT_END" %>
        <%   String message=" ";
                   String realpassword="1234"
                   String admin="admin";
                   String user1="user1";
                   boolean boo=true;
                   try{    user.equals(admin) || user.equals(user1);
                   }
                   catch(Exception exp) {
                               boo=false;
                   }
                   if(boo) {
                           if(password.equals(realpassword)) {
                                  message="登录成功!";}
                           else if(trypassword !=password) {
                                  message="登陆失败";}
                           jspContext.setAttribute("message",message);
                   }
                   else{
                        jspContext.setAttribute("message","请重新输入用户名和密码");
                   }
%>

 

message后面是不是多了空格?还有你jsp页面是取不到传过来的值吗?

request.getAttribute(“message”) 用这个取一下看看