@Test public void withInvalidList() throws Exception { this.tag.setPath("country"); this.tag.setItems(new TestBean()); this.tag.setItemValue("isoCode"); try { this.tag.doStartTag(); fail("Must not be able to use a non-Collection typed value as the value of 'items'"); } catch (JspException expected) { String message = expected.getMessage(); assertTrue(message.contains("items")); assertTrue(message.contains("org.springframework.tests.sample.beans.TestBean")); } }
@Override protected String buildErrorIdentity() { try { return "name=" + name + " select_tag=" + selectTag().getProperty(); } catch (JspException e) { return "name=" + name + " select_tag=" + e.getMessage(); } }
pOut.println ("Causes an error: " + exc.getMessage ());
pOut.println ("Causes an error: " + exc.getMessage ());
pOut.println ("Causes an error: " + exc.getMessage ());
pOut.println ("Causes an error: " + exc.getMessage ());
pOut.println ("Causes an error: " + exc.getMessage ());
pOut.println ("Causes an error: " + exc.getMessage ());
protected String validateExpression( String elem, String att, String expr) { // let's just use the cache kept by the ExpressionEvaluatorManager ExpressionEvaluator current; try { current = ExpressionEvaluatorManager.getEvaluatorByName( ExpressionEvaluatorManager.EVALUATOR_CLASS); } catch (JspException ex) { // (using JspException here feels ugly, but it's what EEM uses) return ex.getMessage(); } String response = current.validate(att, expr); if (response == null) return response; else return "tag = '" + elem + "' / attribute = '" + att + "': " + response; }
protected String validateExpression( String elem, String att, String expr) { // let's just use the cache kept by the ExpressionEvaluatorManager ExpressionEvaluator current; try { current = ExpressionEvaluatorManager.getEvaluatorByName( ExpressionEvaluatorManager.EVALUATOR_CLASS); } catch (JspException ex) { // (using JspException here feels ugly, but it's what EEM uses) return ex.getMessage(); } String response = current.validate(att, expr); if (response == null) return response; else return "tag = '" + elem + "' / attribute = '" + att + "': " + response; }
protected String validateExpression( String elem, String att, String expr) { // let's just use the cache kept by the ExpressionEvaluatorManager ExpressionEvaluator current; try { current = ExpressionEvaluatorManager.getEvaluatorByName( ExpressionEvaluatorManager.EVALUATOR_CLASS); } catch (JspException ex) { // (using JspException here feels ugly, but it's what EEM uses) return ex.getMessage(); } String response = current.validate(att, expr); if (response == null) return response; else return "tag = '" + elem + "' / attribute = '" + att + "': " + response; }
protected String validateExpression( String elem, String att, String expr) { // let's just use the cache kept by the ExpressionEvaluatorManager ExpressionEvaluator current; try { current = ExpressionEvaluatorManager.getEvaluatorByName( ExpressionEvaluatorManager.EVALUATOR_CLASS); } catch (JspException ex) { // (using JspException here feels ugly, but it's what EEM uses) return ex.getMessage(); } String response = current.validate(att, expr); if (response == null) return response; else return "tag = '" + elem + "' / attribute = '" + att + "': " + response; }
protected String validateExpression( String elem, String att, String expr) { // let's just use the cache kept by the ExpressionEvaluatorManager ExpressionEvaluator current; try { current = ExpressionEvaluatorManager.getEvaluatorByName( ExpressionEvaluatorManager.EVALUATOR_CLASS); } catch (JspException ex) { // (using JspException here feels ugly, but it's what EEM uses) return ex.getMessage(); } String response = current.validate(att, expr); if (response == null) return response; else return "tag = '" + elem + "' / attribute = '" + att + "': " + response; }
protected String validateExpression( String elem, String att, String expr) { // let's just use the cache kept by the ExpressionEvaluatorManager ExpressionEvaluator current; try { current = ExpressionEvaluatorManager.getEvaluatorByName( ExpressionEvaluatorManager.EVALUATOR_CLASS); } catch (JspException ex) { // (using JspException here feels ugly, but it's what EEM uses) return ex.getMessage(); } String response = current.validate(att, expr); if (response == null) return response; else return "tag = '" + elem + "' / attribute = '" + att + "': " + response; }
/** * implementation of AuthenticationTag * * @return DOCUMENT ME! * * @throws IllegalArgumentException DOCUMENT ME! */ public String getPrincipal() { MyAuthenticationTag authenticationTag = new MyAuthenticationTag(); authenticationTag.setOperation("username"); try { authenticationTag.doStartTag(); } catch (JspException je) { je.printStackTrace(); throw new IllegalArgumentException(je.getMessage()); } return authenticationTag.getLastMessage(); }
throw new TemplateModelException(e.getMessage(), e);
throw new IllegalArgumentException(je.getMessage());
/** * implementation of AclTag * * @param domainObject DOCUMENT ME! * @param permissions DOCUMENT ME! * * @return DOCUMENT ME! * * @throws IllegalArgumentException DOCUMENT ME! */ public boolean hasPermission(Object domainObject, String permissions) { MyAclTag aclTag = new MyAclTag(); aclTag.setPageContext(null); aclTag.setContext(getAppCtx()); aclTag.setDomainObject(domainObject); aclTag.setHasPermission(permissions); int result = -1; try { result = aclTag.doStartTag(); } catch (JspException je) { throw new IllegalArgumentException(je.getMessage()); } if (Tag.EVAL_BODY_INCLUDE == result) { return true; } else { return false; } }
log.debug(e.getMessage()); throw e;