Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Code Block
themeEclipse
languagejava
titleNewGameActionBean
firstline1
linenumberstrue
@UrlBinding("/experimental/new/game")
public class NewGameActionBean extends BaseActionBean implements ActionBean {

	private final static String JSP_NEWGAME = "/jsp/experimental/new_game.jsp";
	private Game game = null;

	@DefaultHandler
	public Resolution defaultHandler() {
		return new ForwardResolution(JSP_NEWGAME);
	}

	public Resolution update() {
		if (this.game!=null) {
			this.setDebugString(game.toWebString());
		}
		return new ForwardResolution(JSP_NEWGAME);
	}

	public Resolution save() {
		if (this.game!=null) {
			this.setDebugString(game.toWebString());
		}
		return new ForwardResolution(JSP_NEWGAME);
	}

	public Game getGame() {
		return game;
	}

	@ValidateNestedProperties({
		@Validate(field="mainTitle", required=true, on="update")
	})
	public void setGame(Game game) {
		this.game = game;
	}
}
Code Block
languagehtml/xml
titlenew_game.jsp
firstline1
linenumberstrue
<%@ include file="/WEB-INF/taglibs.jspp"%>

<stripes:layout-render name="/jsp/layout/main.jsp">

<stripes:layout-component name="html_head">
 <link rel="stylesheet" href="${contextPath}/css/easy-accordion.css" />
</stripes:layout-component>

<stripes:layout-component name="contents">

<stripes:form beanclass="org.oregami.action.experimental.NewGameActionBean">
<table class="form">
    <tr><td>
            mainTitle: <stripes:text name="game.mainTitle" class="required"/> 
    </td>
    <td>
        <stripes:errors field="game.mainTitle"></stripes:errors>
    </td></tr>
    <tr><td>
        description: <stripes:text name="game.description"/>
    </td></tr>
    <tr><td colspan="1">
        <stripes:submit name="update"><fmt:message key="aktualisieren"/></stripes:submit>
    </td></tr>
</table>
</stripes:form>   

</stripes:layout-component>
</stripes:layout-render>