Don’t look where you fall, but where you slipped
Bear Bibeault wrote:Scriptlets are never the proper way of doing anything in a JSP. This is no longer 2001. Have you looked through the EL built-in variables to see if there's anything useful?
Don’t look where you fall, but where you slipped
Bear Bibeault wrote:Do you have a cookie named name? If, so then ${cookie.name} resolves to the cookie instance. But that's not what you are after, is it?
Don’t look where you fall, but where you slipped
Bear Bibeault wrote:Of course it works. It gives you the cookie instance as evidenced by the output. But is the toString() of the instance what you are after? Think of the cookie instance as a bean.
Don’t look where you fall, but where you slipped
Bosun (SCJP, SCWCD).
So much trouble in the world -- Bob Marley
Bosun Bello wrote:You may want to read up on thus stuff. Try this
${cookie["name"].value}
Don’t look where you fall, but where you slipped
Bear Bibeault wrote:Do you understand why that works? And ${cookie.name.value} would be a simpler syntax.
Don’t look where you fall, but where you slipped
Don’t look where you fall, but where you slipped
Bear Bibeault wrote:Quote the value. Always quote attribute values. Just because HTML lets us be sloppy, it's never a good idea to not quote attributes.
Don’t look where you fall, but where you slipped
Bear Bibeault wrote:Put quotes around all attribute values.
><input type="text" name="pass" value="${cookie.pass.value}"
Don’t look where you fall, but where you slipped