Sorry if this is a little off topic but I figure there are a few people
out there using the Struts2 version of appfuse and I'm needing some help.

In a pretty simple list page created by an appfuse:gen / appfuse:install
on a new pojo called Game. I have added an extra column to this
gameList.jsp in which I have put a hyperlink to a new page
(displayGame.html). Now, not understanding how this S2 stuff really works
I am getting a problme where when I click on this link I seem to be
getting redirected to the editGame.html page.

I've tried various things in stuts.xml. Currently the entry looks like:

    <action name="displayGame" class="gameAction" method="display">
      <result name="success" type="redirect">displayGame.html</result>
    </action>

The URL reads correctly as displayGame.html but I end up on the
editGame.html.

I added a new method to GameAction as well:

  public String display()
  throws Exception
  {
    System.out.println("display method reached");
    if (id != null) {
      game = gameManager.get(id);
    } else {
      game = new Game();
    }
    return SUCCESS;
  }

Which is pretty much the same as the code in the edit method.

Can anyone explain to me what I need to do to get this seamingly simple
extra page to work?



Regards
Marty


PS. Here is a bigger chunk of the struts.xml file



    <!--GameAction-START-->
    <action name="games" class="gameAction" method="list">
      <result>/WEB-INF/pages/gameList.jsp</result>
    </action>

    <action name="displayGame" class="gameAction" method="display">
      <result name="success" type="redirect">displayGame.html</result>
    </action>

    <action name="editGame" class="gameAction" method="edit">
      <result>/WEB-INF/pages/gameForm.jsp</result>
      <result name="error">/WEB-INF/pages/gameList.jsp</result>
    </action>

    <action name="saveGame" class="gameAction" method="save">
      <result name="input">/WEB-INF/pages/gameForm.jsp</result>
      <result name="cancel" type="redirect">games.html</result>
      <result name="delete" type="redirect">games.html</result>
      <result name="success" type="redirect">games.html</result>
    </action>
    <!--GameAction-END-->

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to