Cannot set JSP tag attribute more than once?

I have some old JSP files with tags like

<mytag:editbox name="SEL_1" param="onclick='clickit();" param="size='4'" />.

These JSPs work very well in Websphere 5.0. When I move it to Websphere 8.0, something is wrong. The java source compiled by JSP as follows:

editbox.setName("SEL_1");
editbox.setParam("size='4'");  //replaced by the last one
editbox.setParam("size='4'");

The last [attributes] overwrite those that were before it. I also test JSP in Websphere 6.0 and Tomcat. WAS6 is similar to 8.0, and Tomcat says:

org.apache.jasper.JasperException: /index.jsp (line: 17, column: 20) Attribute qualified names must be unique within an element

A tag attribute cannot be set more than once.

Is this a JSP 2.0+ specification requirement? (I think the JSP container in WAS5.0 is JSP 1.2.)

I can combine the two param attributes into one to fix the problem, but how to get the correct result without changing the JSP source?

+5
source share
4 answers

JSP. Websphere 5, , , - . , - .

, , , .

+5

JSP- - XML-. XML . IMHO, Websphere, , - JSP.

+3

WAS 8, JSP (ibm-ext-web.xmi):

allowMultipleAttributeValues true.

Or set the custom property of the web container com.ibm.wsspi.jsp.allowMultipleAttributeValuesto true.

Source: http://www-01.ibm.com/support/docview.wss?uid=swg1PM65454

0
source

I had the same problem. I used location tags with tag tags library tags at the same time, so I ran into this problem. As soon as I chose one to use, the error disappeared. Using the same tags from two different libraries is ambiguous.

0
source

All Articles