// You often pass on the request, response, and application even if
// not all the objects are used, since they may be used later
try {
Template view = getTemplate("toolview.wm");
String state = context.getRequest().getParameter("state");
if (state == null) {
state = (String)view.getParam("defaultState");
}
if (state == null) {
context.put("tools", getTools());
}
else {
context.put("tools", getTools(state));
}
return view;
}
catch (WebMacroException e) {
log.exception(e);
throw new HandlerException(e.getMessage());
}
catch (IOException e) {
log.exception(e);
throw new HandlerException(e.getMessage());
}