You can easily code new tags to be used with Kawai by implementing the KCode interface. Then all you have to do is register your new tag in the WEB-INF/conf/default/appManager.properties file:
# kCodes Tags kcodes = Code, ContextPath, PageLink, Image, Download
Below is the source code of the Image tag to give you an idea:
package org.kawai.tag.kcode; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.jsp.JspException; import javax.servlet.jsp.PageContext; public class Image implements KCode { @Override public String getTag() { return "img"; } @Override public boolean hasBody() { return false; } @Override public String process(PageContext pageContext, Map<String, String> attributes, String body) throws JspException { if (body != null) throw new JspException("contextPath tag cannot have a body!"); String filename = attributes.get("file"); if (filename == null) throw new JspException("file attribute is mandatory!"); HttpServletRequest req = (HttpServletRequest) pageContext.getRequest(); String cp = req.getContextPath(); return "<img src=\"" + cp + "/uploads/images/" + filename + "\" border=\"0\" />"; } }