0 Replies - 412 Views - Last Post: 18 March 2017 - 05:51 AM

#1 newJavaCoder  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 82
  • Joined: 15-March 15

JSP choose when otherwise

Posted 18 March 2017 - 05:51 AM

        <c:choose>
                <c:when test="${code != null}">
                        <input type="text" name="code" size="10"
                               value="${code}"/><br>
                </c:when>
                <c:otherwise>
                    <input type="text" name="code" size="10"
                               value="${product.code}"/><br>
                </c:otherwise>   
            </c:choose>


I am running this code here.

I am trying to find if the textbox is empty. If there are words in it, i need to make it readonly. If it's empty, people can type in it. The only section that works is the otherwise statement....why? How do I fix this headache?

I found my error. The test should be on product.code not code.

Is This A Good Question/Topic? 0
  • +

Page 1 of 1