public class ConfirmationTag extends FreeMarkerTag
<@confirm text="Are you sure you want to delete post: \\\'${post.title}\\\'?" form=post.id>Delete</@confirm>
<@form controller="posts" id=post.id action="delete" method="delete">
<input type="hidden" name="id" value="${post.id}">
</@form>
The code above will generate the following HTML:
<a href="#" onClick="if(confirm('Are you sure you want to delete post: \'ActiveWeb Rocks.\'?')) { $('#' + 17).submit(); return true; } else return false;">Delete</a>
<form action="/kitchensink/posts/delete" method="post" id="17">
<input type='hidden' name='_method' value='delete' /> <input type="hidden" name="id" value="17">
</form>
LOGGER
Constructor and Description |
---|
ConfirmationTag() |
Modifier and Type | Method and Description |
---|---|
protected void |
render(Map params,
String body,
Writer writer)
Implement this method ina concrete subclass.
|
execute, get, getAllVariables, getContextPath, getUnwrapped, getUnwrapped, logger, overrideContext, process, session, sessionObject, validateParamsPresence
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
appContext, context, cookie, cookies, cookieValue, exists, format, getId, getLocale, getRequestHost, getRequestPort, getRequestProperties, getRequestProtocol, getRoute, header, headers, host, ipAddress, ipForwardedFor, isDelete, isGet, isHead, isMethod, isMultipartContent, isPost, isPut, isXhr, locale, method, param, param, params, params, params, params1st, params1st, path, port, protocol, queryString, remoteAddress, remoteHost, requestHas, servletPath, session, session, uri, url, userAgent, xhr
protected void render(Map params, String body, Writer writer) throws Exception
FreeMarkerTag
render
in class FreeMarkerTag
params
- this is a list of parameters as provided to tag in HTML.body
- body of tagwriter
- writer to write output to.Exception
- if anyCopyright © 2022 JavaLite. All rights reserved.