Package javax.servlet.jsp

Examples of javax.servlet.jsp.JspException


public final class UiFormEnterKeyboardHandlerTag extends UiFormKeyboardHandlerTag {
  /**
   * Throw an exception on attempt to set key. This tag supports "enter" only!
   */
  public void setKey(String key) throws JspException {
    throw new JspException("You may not set key for the enter handler tag!");
  }
View Full Code Here


  /**
   * @see #setKey
   */
  public void setKeyCode(String keyCode) throws JspException {
    throw new JspException("You may not set keyCode for the enter handler tag!");
  }
View Full Code Here

    super.before(out);
   
    Map tagMapping = UiStdWidgetCallUtil.getContainer(pageContext).getTagMapping(pageContext);
   
    if(tagMapping == null)
      throw new JspException("The tag mapping was not found!.");
   
    formViewModel = (FormWidget.ViewModel)readAttribute(UiFormTag.FORM_VIEW_MODEL_KEY_REQUEST, PageContext.REQUEST_SCOPE);
    FormWidget form = (FormWidget)readAttribute(UiFormTag.FORM_KEY_REQUEST, PageContext.REQUEST_SCOPE);
   
    //In case the tag is in formElement tag
    if (id == null && getAttribute(UiFormElementTag.ID_KEY_REQUEST, PageContext.REQUEST_SCOPE) != null)
      id = (String) getAttribute(UiFormElementTag.ID_KEY_REQUEST, PageContext.REQUEST_SCOPE);
    if (id == null) throw new UiMissingIdException(this);
    formElementViewModel =
      (FormElement.ViewModel) UiWidgetUtil.traverseToSubWidget(form, id)._getViewable().getViewModel();  
   
    // Get control 
    controlViewModel = formElementViewModel.getControl();
   
    FormElementViewSelector viewSelector =
      (FormElementViewSelector) formElementViewModel.getProperties().get(
          FormElementViewSelector.FORM_ELEMENT_VIEW_SELECTOR_PROPERTY);
   
    if(viewSelector == null)
      throw new JspException("The form element view selector was not passed!.");
   
    TagInfo tagInfo = (TagInfo) tagMapping.get(viewSelector.getTag());
   
    if(tagInfo == null)
      throw new JspException("Unexistant tag was passed to form element view selector!.");   
   
    Class tagClass = Class.forName(tagInfo.getTagClassName());
   
    controlTag = (UiFormElementTagInterface) tagClass.newInstance();
   
View Full Code Here

  protected final int before(Writer out) throws Exception {
    super.before(out);
    if (StringUtils.isBlank(handler)) {
      // One of elemenId/event must be specified
      if ((elementId == null && fullElementId == null) || event == null)
        throw new JspException("You must specify handler or elementId/event for UiFormKeyboardHandlerTag (elementId=" + elementId + ", fullElementId=" + fullElementId + ", event=" + event + ",subscope=" + subscope);

      // Only one of elementId/fullElementId must be specified
      if (!(elementId == null ^ fullElementId == null))
        throw new JspException("Either elementId or fullElementId must be specified, not both.");

      // If elementId was given, translate to fullElementId
      if (fullElementId == null)
        fullElementId = elementIdToFullElementId(pageContext, elementId);
      handler = createHandlerToInvokeJavascriptEvent(fullElementId, event);
    }
    else {
      // None of the elementId/event attributes may be specified
      if (fullElementId != null || elementId != null || event != null)
        throw new JspException("You should specify either handler or event for UiFormKeyboardHandlerTag (handler=" + handler + ")");
    }

    // Scope here means the analogue of "scope" attribute in UiKeyboardHandlerTag
    // It must be prefixed by componentId when the surrounding systemForm's "scope" is "screen".
    String scope = (String) pageContext.getAttribute(UiFormTag.FORM_SCOPED_FULL_ID_KEY_REQUEST,
View Full Code Here

    }
    catch(JspException e) {
      throw e;   
    }
    catch(Exception e) {
      throw new JspException(e);
    }
  }
View Full Code Here

    }
    catch(JspException e) {
      throw e;   
    }   
    catch(Exception e) {
      throw new JspException(e);
    }
  }
View Full Code Here

   */
  protected int before(Writer out) throws Exception {
    super.before(out);
   
    if (!(keyCode == null ^ key == null))
      throw new JspException("Either key or keyCode must be specified for a keyboard handler tag.");
   
    if (keyCode == null) {
      int iKeyCode = keyToKeyCode(key);
      if (iKeyCode == 0) throw new JspException("Invalid key alias specified (" + key + ")");
      keyCode = String.valueOf(iKeyCode);
    }
   
    return SKIP_BODY;
  }
View Full Code Here

   * @see #setScope
   * @see #setKeyCode
   * @see #setHandler
   */
  public static final void writeRegisterKeypressHandlerScript(Writer out, String scope, String keyCode, String handler) throws JspException, IOException {
  if (StringUtils.isBlank(handler)) throw new JspException("handler may not be empty in the UiKeyboardHandlerTag");
  if (StringUtils.isBlank(scope)) scope = "";
   
 
  UiUtil.writeStartTag(out, "script");
  out.write("uiRegisterKeypressHandler('");
View Full Code Here

    }
    catch(JspException e) {
      throw e;   
    }   
    catch(Exception e) {
      throw new JspException(e);
    }   
  }
View Full Code Here

      try {
         if (bundle != null) {
            result = bundle.getObject(key);
         }
      } catch (MissingResourceException e) {
         throw new JspException("Unable to load resource for key " + key, e); //$NON-NLS-1$
      }
      return result;
   }
View Full Code Here

TOP

Related Classes of javax.servlet.jsp.JspException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.