How to compare a single character from url request parameter in Struts 2
I am reading the url parameter which has a single character. It will either be Y or N . I have to write a condition to check if it Y or N and do something accordingly. This is what I wrote but does not seem to work (always goes to else). The url is http://wwww.helloworld.com/showInfo?thecountry=us&theconditionTypeInUrl=Y <s:set var="theUrl" value="%{#parameters.theconditionTypeInUrl}" /> <s:if test="%{#theUrl == 'Y'}"> </s:if> <s:else> </s:else> I also tried <s:set var="theUrl" value='%{#parameters.theconditionTypeInUrl}' /> <s:if test='%{#theUrl == "Y"}'> </s:if> <s:else> </s:else> the struts