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
In JSP EL 2.0, you can do that using the ternary operator. For instance:
First option
What it does is it checks JSP's param's number variable. If it's 1, then selected is substituted. otherwise, nothing.
param
number