You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Christophe Thi�baud <ct...@stylo.it> on 2001/02/19 10:00:45 UTC

tag and cancel functionality

I am now using in my application the <struts-html:image> tag to produce
graphical buttons.

This tag writes a HTML tag <input type="image" name="aaa">.

the problem with the <input type="image"> tag is that it submits "aaa.x" and
"aaa.y" parameters rather than the usual "aaa" parameter.

Thus I cannot use the <struts-html:image> for a cancel function because the
ActionServlet tests for Constants.CANCEL_PROPERTY, 
in a request that include only Constants.CANCEL_PROPERTY.x  and
Constants.CANCEL_PROPERTY.y parameters.

would it be feasible to change slightly this test ?

For example, in place of: (ActionServlet.java:1851)

	if (request.getParameter(Constants.CANCEL_PROPERTY) != null) {
		...

to have :

	if (request.getParameter(Constants.CANCEL_PROPERTY) != null
	   || 
               request.getParameter(Constants.CANCEL_PROPERTY+".x") != null) {
		...

thanks

Christophe