jsp中 if else,else也是遵循一个if一个else的原则 当else找不到if就会报错 解决办法 <% if()(%> xxxxxx <% } else { %> <% } %> … 在if后加个{,else加个}就可以