0

在我的jsp页面中

       <s:if test="#alist[0].aboutme!=null"  test="#alist[0].aboutme!=''">
         <div class="info">
            <div class="title">
               About
            </div>
            <div class="value">
               <div class="value_title">
                    <s:property value="alist[0].aboutme"/>
               </div>
            </div>
         </div>
       </s:if>

我正在检查关于我的值的 ArrayList alist[0] 是否为 null 或 '' 它不会显示关于我的文本和值,以前它工作正常,但现在它显示以下异常

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: /pages/profile/about.jsp (line: 67, column: 102)   Attribute qualified names must be unique within an element
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:408)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:89)
org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:171)
org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:153)
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1236)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1452)
org.apache.jasper.compiler.Parser.parse(Parser.java:138)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:242)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:102)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
4

2 回答 2

1

标签中有两个test属性:s:if

<s:if test="#alist[0].aboutme!=null"  test="#alist[0].aboutme!=''">

尝试这个:

<s:if test="%{#alist[0].aboutme!=null and #alist[0].aboutme!=''}">
于 2012-08-01T13:49:46.367 回答
0

您的第一行包含以下内容:

<s:if test="#alist[0].aboutme!=null"  test="#alist[0].aboutme!=''">

test单个if元素不能有两个属性

于 2012-08-01T13:49:48.380 回答