Today I came across an interesting behaviour while trying to pass an object to tag attribute via scripting. Basically I wanted to test if both formats of scripting expression are identical in behaviour. From the output, I feel like they aren't. Not sure if this is correct behaviour or not.
So I passed two attributes (using dynamic attributes) one with the usual syntax: <%=application.getAttribute("obj")%> and the other with <jsp:expression>application.getAttribute("obj")</jsp:expression>. The tag file simply prints the attributes with the details like name, value, type etc.
JSP that calls my tag file. It simply passes two attributes with same values. The only difference is the syntax elements used to pass the objects.
Tag file code is simple. It just iterates thru all the dynamic attributes and prints the name and value to the output stream along with their class type of the attribute value.
Please note that the mymodel.Dog's toString() method has been overriden to print the default implementation value (the object class@hashcode) + the name of the property in the object which is dalmatian by default as in this case.