Created
October 1, 2019 04:42
-
-
Save d3ep4k/60e31b726def8cf972ef75832b7f45c2 to your computer and use it in GitHub Desktop.
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
<jsp:directive.include file="../fragments/mason-init.jspf"/> | |
<m:resource> | |
<m:request method="GET"> | |
<sql:query var="result" dataSource="${datasource}"> | |
SELECT * FROM movie | |
</sql:query> | |
<c:set target="${output}" property="output" value="${result}"/> | |
</m:request> | |
<m:request method="GET" item="true"> | |
<sql:query var="result" dataSource="${datasource}"> | |
SELECT * from movie where id=? | |
<sql:param value="${mtgReq.id}"/> | |
</sql:query> | |
<c:set target="${output}" property="getReq2" value="${result}"/> | |
</m:request> | |
<m:request method='POST'> | |
<sql:update var="result" dataSource="${datasource}"> | |
INSERT INTO movie (name,rating) values (?,?) | |
<sql:param value="${mtgReq.params['name']}"/> | |
<sql:param value="${mtgReq.params['rating']}"/> | |
</sql:update> | |
<c:set target="${output}" property="postResult" value="${result}"/> | |
</m:request> | |
<m:request method='PUT' item="true"> | |
<sql:update var="result" dataSource="${datasource}"> | |
UPDATE movie SET rating=? where id=? | |
<sql:param value="${mtgReq.params['rating']}"/> | |
<sql:param value="${mtgReq.id}"/> | |
</sql:update> | |
<c:set target="${output}" property="putResult" value="${result}"/> | |
</m:request> | |
<m:request method='DELETE' item="true"> | |
<sql:update var="result" dataSource="${datasource}"> | |
DELETE FROM movie WHERE id=? | |
<sql:param value="${mtgReq.id}"/> | |
</sql:update> | |
<c:set target="${output}" property="deleteResult" value="${result}"/> | |
</m:request> | |
</m:resource> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment