Ternary operator in JSTL/EL

I tested the following page in Tomcat 5.59, JSP 2.0 and JSTL 1.1. It ran without any errors. <%@taglib uri=”http://java.sun.com/jsp/jstl/core” prefix=”c”%> <c:set var=”value” scope=”request” value=”someValue”/> <c:out default=”None” escapeXml=”true” value=”${not empty value ? value : ‘None’}” /> <c:out default=”None” escapeXml=”true” value=”${empty value ? ‘None’ : value}” /> <c:set var=”value” scope=”request” value=”” /> <br/> <c:out default=”None” escapeXml=”true” … Read more

Why would you use the ternary operator without assigning a value for the “true” condition (x = x ?: 1)

This is permitted in GNU as an obscure extension to C 5.7 Conditionals with Omitted Operands The middle operand in a conditional expression may be omitted. Then if the first operand is nonzero, its value is the value of the conditional expression. Therefore, the expression x ? : y has the value of x if … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)