I have some old JSP files with tags such as
<mytag:editbox name="SEL_1" param="onclick='clickit();" param="size='4'" />.
These JSP runs very well in Websphere 5.0. When I move it into Websphere 8.0, something is wrong. The java source compiled by JSP like this:
editbox.setName("SEL_1");
editbox.setParam("size='4'"); //replaced by the last one
editbox.setParam("size='4'");
The last [attributes] overwrites those before it. I also test the JSP in Websphere 6.0 and Tomcat. WAS6 is same as 8.0, and Tomcat says:
org.apache.jasper.JasperException: /index.jsp (line: 17, column: 20) Attribute qualified names must be unique within an element
The attribute of tag can't be set more than once.
Is this the requirement of JSP 2.0+ specification? (I think the JSP container in WAS5.0 is JSP 1.2 .)
I can merge the two param attribute into one to correct the problem, but how to get the correct result without changing the JSP source?
Having multiple attributes with the same name was never supported by the JSP spec. If it worked on Websphere 5 then that would have depended on proprietary behaviour permissible by that server version, and not by any others. I take it the tag class does something like adding the values to a collection, or some such.
You'll need to refactor the tag to be spec-compliant, either by using a delimited string, or using nested tags.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With