Hi,
In one of my JSPs I am trying to compare a character to a
string to see if there is an occurance, if so, I display an Input text box in html if not process the else for a different string as such--
<% if (" A&J".indexOf(lL200C.getMc__Commit__Until__Dt__A()) > 0) { %>
<INPUT TYPE="text" NAME="mc__Commit__Until__Dt_I" ID="mc__Commit__Until__Dt_I" SIZE="8" MAXLENGTH="8" VALUE="<%=lL200C.getMc__Commit__Until__Dt().trim() %>" >
<% } else %>
<% if ("HIQR".indexOf(lL200C.getMc__Commit__Until__Dt__A()) > 0) { %>
<INPUT TYPE="text" style="color: #ff0033;" NAME="mc__Commit__Until__Dt_I" ID="mc__Commit__Until__Dt_I" SIZE="8" MAXLENGTH="8" VALUE="<%=lL200C.getMc__Commit__Until__Dt().trim() %>" >
<% } else %>
<% if ("%_@'".indexOf(lL200C.getMc__Commit__Until__Dt__A()) > 0) { %>
<INPUT TYPE="text" style="color: #00ff66;background-color: #999999;" NAME="mc__Commit__Until__Dt_I" ID="mc__Commit__Until__Dt_I" SIZE="8" MAXLENGTH="8" VALUE="<%=lL200C.getMc__Commit__Until__Dt().trim() %>" READONLY>
<% } else %>
<% if ("-/01".indexOf(lL200C.getMc__Commit__Until__Dt__A()) > 0) { %>
<INPUT TYPE="text" style="background-color: #999999;" NAME="mc__Commit__Until__Dt_I" ID="mc__Commit__Until__Dt_I" SIZE="8" MAXLENGTH="8" VALUE="<%=lL200C.getMc__Commit__Until__Dt().trim() %>" READONLY>
<% } else %>
<% if ("YZ89".indexOf(lL200C.getMc__Commit__Until__Dt__A()) > 0) { %>
<INPUT TYPE="text" style="color: #ff0033;background-color: #999999;" NAME="mc__Commit__Until__Dt_I" ID="mc__Commit__Until__Dt_I" SIZE="8" MAXLENGTH="8" VALUE="<%=lL200C.getMc__Commit__Until__Dt().trim() %>" READONLY>
<% } else if ("<(*)".indexOf(lL200C.getMc__Commit__Until__Dt__A()) > 0) { %>
<INPUT TYPE="text" style="color:#00ff66;" NAME="mc__Commit__Until__Dt_I" ID="mc__Commit__Until__Dt_I" SIZE="8" MAXLENGTH="8" VALUE="<%=lL200C.getMc__Commit__Until__Dt().trim() %>" >
<% } %>
The problem is my if-else is not getting proceesed right and the control just goes to the last if....I am logging the value for
lL200C.getMc__Commit__Until__Dt__A()) which is ' '(space, but the first condition is not getting executed.
I am using Websphere
test environment and the debugging is extremely slow...is there a better way to debug this code to see where my if is failing???
Thanks in advance!