struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Conner <>
Subject Best practice for passing success/error message to another dispatch (struts2)?
Date Tue, 12 Aug 2008 19:05:42 GMT
I have an action with two dispatch methods.
I have a single JSP that renders a list and also have an import file field.
On import failure, I want to populate the list with an error message.

It looks like validation for the list() method is wiping the errors from the import() method.

Example struts.xml:
    <action name="*Role" class="RoleAction" method="list">
      <result name="input">/</result>
      <result name="success">/</result>

    <action name="importRole" class="RoleAction" method="import">
      <result name="input" type="chain">listRole</result>
      <result name="success" type="chain">listRole</result>

Example pseudo code:
public String list() {
  // sql lookup, populate list
  return "success";

public String import() {
  // do import
  If (fail) {
  return "success";

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message