isUserInRole() - return boolean from custom tag?
Hello
Im writing some custom tags extending TagSupport. At the moment my tags just create some collection and put it in the page scope for the jsp to access. (see example below)
I have a tag however that I would like to return a boolean for. This is specifically for checking isUserInRole();
I cant quite get my head around the idea of manipulating the page body or not and how this impacts writing the custom tags. If I want to return some value directly from my tag ie. a boolean value from isUserInRole(); is this manipulating the page body?
Is TagSupport the correct class to extend if I want to return a boolean value from my tag call.
Id appreciate any advice.
Thanks
Jon
-
public class refSuppliersTag extends TagSupport {
public int doStartTag() throws JspException {
try {
.................
HashMap supplierMap = new HashMap();
supplierMap = (HashMap) referenceData.getSuppliers();
pageContext.setAttribute("suppliers", supplierMap);
} catch (Exception e) {
throw new JspException(e.toString());
}
return EVAL_PAGE;
}
.................

