开发者

StripesRuntimeException: Multiple event parameters

Sorry my poor English.

I’m using Stripes Web Framework and recently I’ve had the following error:

Multiple event parameters [save, managementPreview] are present in this request. Only one event parameter may be specified per request. Otherwise, Stripes would be unable to determine which event to execute. net.sourceforge.stripes.exception.StripesRuntimeException: Multiple event parameters [save, managementPreview] are present in this request. Only one event parameter may be specified per request. Otherwise, Stripes would be unable to determine which event to execute.

Inside my f开发者_Go百科orm I’ve one <button type=”submit” /> to activate de “managementPreview” event and one <input type=”submit” /> to activate the “save” event.

Anyone know why Stripes submits two events? It may be a browser problem (as far as I know this doesn’t happen in FF and IE 7 & 8)?

Thanks for your help.

Best regards.

José Perdigão


Stripes is a server side technology, it is not involved in submitting the HTML form. Apparently you're HTML is incorrect and as a result it’s handled differently by the different browsers.

For creating a correct HTML form with multiple submit buttons, it's important to give each submit button a name attribute that refers to the correct Stripes event name. Although not mandatory, it's also very convenient to use the Stripes JSP tags for generating correct HTML forms. Here’s some example code:

<%@taglib prefix="s" uri="http://stripes.sourceforge.net/stripes.tld" %>
<html>
  <body>
    <s:form beanclass="com.example.MyActionBean">
      <s:submit name="managementPreview” value="Preview" />
      <s:submit name="save" value="Save" />
    </s:form>
  </body>
</html>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜