I need a sort of page switch on Struts2.
Like (on index.jsp) if myBean.String="main" include main.jsp else include welcome.jsp
I tried with <s:if> or <c:choose> but looks that they can evalutate only boolean. How can I do it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Not sure about the Struts2 part, but you can just use EL in
<jsp:include>.As to the JSTL
<c:if>or<c:choose>tags, you can just compare strings in EL as follows (like as in JSF which you’re already familiar with, according to your question history! 😉 ):If it are only 2 conditions, then you can also use the conditional operator
?::See also: