If-then-else inside a JSP expression?

后端 未结 4 1441
臣服心动
臣服心动 2021-02-04 00:15

Can you do an if-then-else statement inside a JSP expression?

EDIT : Specifically I was looking for a JSP solution, not a JSTL solution. But some JSTL s

4条回答
  •  天涯浪人
    2021-02-04 00:56

    You can wrap your html code with jsp tags like this:

    <% if (condition) { %>
    
    Condition is true!
    <% } else { %>
    Condition is false
    <% } %>

提交回复
热议问题