What't the difference between this two statements <c:out value="${param}"/> and ${param}? Is not exactly the same if you don't use the scapeXml attribute? Is there any special reason to use the c tag?
<c: out> tag has one attribute i.e. default that is get printed to output if value spacified is null.
e.g.
suppose we are printing userName in to first page of appliation.
if user come from login then we put his/her name in session as "userName"
else we want to print guest.
then simply put,
<c: out value='${sessionScope. userName}' default='guest' />
if userName in session it will prints name of user else guest.
to do this by EL we need to if else condition for checking userName.
I forgot completly about the default attribute. Thanks.
I asked this because in the application I am working I have seen several times things like <c:out value="${param}"/> that makes not to much sense for me if they are alone.
Bear Bibeault wrote:The primary purpose of using <c:out> is to take advantage of the automatic HTML-encoding. It should be used for all non-trusted data.
Ok, thanks for your answer ;)
Don't get me started about those stupid light bulbs.