Last active
December 12, 2015 04:08
DRY with URLs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form:form action="/series/add" method="post" modelAttribute="addSeriesForm"> | |
... | |
</form:form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
driver.get("http://localhost/series/add"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href="/series/add">Добавить серию</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ page import="ru.mystamps.web.Url" %> | |
<spring:url var="addSeriesUrl" value="<%= Url.ADD_SERIES_PAGE %>" /> | |
<a href="${addSeriesUrl}">Добавить серию</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RequestMapping(value = "/series/add", method = RequestMethod.GET) | |
public AddSeriesForm showForm() { | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RequestMapping(value = "/series/add", method = RequestMethod.POST) | |
public String processInput(@Valid AddSeriesForm form, BindingResult result) { | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return "series/add"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RequestMapping(value = Url.ADD_SERIES_PAGE, method = RequestMethod.GET) | |
public AddSeriesForm showForm() { | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<intercept-url pattern="/series/add" access="hasRole('ROLE_USER')" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<definition name="series/add" extends="defaultTemplate"> | |
<put-attribute name="title" value="Добавить серию" /> | |
<put-attribute name="body" value="/WEB-INF/tiles/body/series/add.jsp" /> | |
</definition> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final class Url { | |
public static final String ADD_SERIES_PAGE = "/series/add"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment