jsp里面放的java代码,总是出错,给看看

    <% if(${porfiles.bdb}.equals("0")){
    %>
        <td> <input type="hidden"/></td>    
    
<%}else if(){
    %>
 <td><a href="javascript:;" onclick="bigmoments('${porfiles.jeq },${porfiles.jgr },${porfiles.iwn },${porfiles.jyf }')"><img
                                            src="img/penyou.jpg" style="width: 36;height: 36"></a> <input
                                        type="hidden" id="eeq" value="${porfiles.jeq }" /></td>    
    
    <%};%>
    
    
    

错误::
org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 344 in the jsp file: /siteuser.jsp
Syntax error, insert ") Statement" to complete IfStatement
341: <td>${porfiles.jyf }</td>
342: <td>${porfiles.jaddress }</td>
343:
344: <% if(${porfiles.bdb}.equals("0")){
345: %>
346: <td> <input type="hidden"/></td>
347:
An error occurred at line: 348 in the jsp file: /siteuser.jsp
Syntax error, insert "}" to complete Block
345: %>
346: <td> <input type="hidden"/></td>
347:
348: <%}else if(){
349: %>
350: <td><img
351:
An error occurred at line: [507] in the generated java file: [D:apache-tomcat-7.0.42workCatalinalocalhostimfenceorgapachejspsiteuser_jsp.java]
Syntax error on token "}", { expected

给看看这是什么错,明明觉得没有错误!

阅读 5.1k
5 个回答
<% if(${porfiles.bdb}.equals("0")){
}

语法错误,看错误提示明显是jsp编译错误
这个地方的语法是有问题的
jsp里面<% //这里面正常java语法 有就说说不会识别你这种写法 el表达式之类的%>
你想使用el表达式就不要在<%%>里面使用
在外面使用就好了

<%}else if(){
    %>

这里,if 的条件呢?

除了上边说的,字符串0放前边靠谱点吧,要不容易前边的报空

永远不要写这种代码,可读性可维护性都是0零〇。!

换成C标写,这种乱糟糟的也很难找

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题