Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

NewGameActionBean
@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 Game getGame() {
		return game;
	}

	@ValidateNestedProperties({
		@Validate(field="mainTitle", required=true, on="update")
	})
	public void setGame(Game game) {
		this.game = game;
	}
}

line 1:

@UrlBinding("/experimental/new/game")
Very simple way to determine the URL under which the site will be available.

 

 

new_game.jsp
<%@ 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>
  • No labels