Package org.apache.tapestry

Examples of org.apache.tapestry.ApplicationRuntimeException


        {
            return _fileItem.getInputStream();
        }
        catch (IOException ex)
        {
            throw new ApplicationRuntimeException(
                Tapestry.format("UploadPart.unable-to-open-content-file", _fileItem.getName()),
                ex);
        }
    }
View Full Code Here


        {
            _fileItem.write(file);
        }
        catch (Exception ex)
        {
            throw new ApplicationRuntimeException(
                Tapestry.format("UploadPart.write-failure", file, ex.getMessage()),
                ex);
        }
    }
View Full Code Here

                {
                    externalValue = getDataSqueezer().squeeze(value);
                }
                catch (IOException ex)
                {
                    throw new ApplicationRuntimeException(ex.getMessage(), this, null, ex);
                }
            }
            else
                externalValue = (String) getValueBinding().getObject("value", String.class);

            String id = getElementId();
            //if we would like to test the IForm.addHiddenValue(name, externalValue) method with
            //Hidden JUnit test the following code must be default. But from the performance issue
            //I don't use the id parameter clauses. 
/*      if(id == null || id.length() == 0){
        form.addHiddenValue(name, externalValue);
            }else{
        form.addHiddenValue(name, id, externalValue);
            }
*/
      form.addHiddenValue(name, id, externalValue);
           

            return;
        }

        String externalValue = cycle.getRequestContext().getParameter(name);
        Object value = null;

        if (getEncode())
        {
            try
            {
                value = getDataSqueezer().unsqueeze(externalValue);
            }
            catch (IOException ex)
            {
                throw new ApplicationRuntimeException(ex.getMessage(), this, null, ex);
            }
        }
        else
            value = externalValue;

View Full Code Here

                upload.setHeaderEncoding(encoding);
            parts = upload.parseRequest(request, _thresholdSize, _maxSize, _repositoryPath);
        }
        catch (FileUploadException ex)
        {
            throw new ApplicationRuntimeException(
                Tapestry.format("DefaultMultipartDecoder.unable-to-decode", ex.getMessage()),
                ex);
        }

        int count = Tapestry.size(parts);

        for (int i = 0; i < count; i++)
        {
            FileItem uploadItem = (FileItem) parts.get(i);

            if (uploadItem.isFormField())
            {
                try
                {
                    String name = uploadItem.getFieldName();
                    String value;
                    if (encoding == null)
                        value = uploadItem.getString();
                    else
                        value = uploadItem.getString(encoding);
                       
                    ValuePart valuePart = (ValuePart) partMap.get(name);
                    if (valuePart != null)
                    {
                        valuePart.add(value);
                    }
                    else
                    {
                        valuePart = new ValuePart(value);
                        partMap.put(name, valuePart);
                    }
                }
                catch (UnsupportedEncodingException ex)
                {
                    throw new ApplicationRuntimeException(
                        Tapestry.format("illegal-encoding", encoding),
                        ex);
                }
            }
            else
View Full Code Here

        {
            externalValue = getDataSqueezer().squeeze(value);
        }
        catch (IOException ex)
        {
            throw new ApplicationRuntimeException(
                Tapestry.format("ListEdit.unable-to-convert-value", value),
                this,
                null,
                ex);
        }
View Full Code Here

        {
            return getDataSqueezer().unsqueeze(value);
        }
        catch (IOException ex)
        {
            throw new ApplicationRuntimeException(
                Tapestry.format("ListEdit.unable-to-convert-string", value),
                this,
                null,
                ex);
        }
View Full Code Here

    protected void prepareForRender(IRequestCycle cycle)
    {
        super.prepareForRender(cycle);

        if (cycle.getAttribute(ATTRIBUTE_NAME) != null)
            throw new ApplicationRuntimeException(
                Tapestry.getMessage("Form.forms-may-not-nest"),
                this,
                null,
                null);
View Full Code Here

            return;

        Body body = Body.get(cycle);

        if (body == null)
            throw new ApplicationRuntimeException(
                Tapestry.getMessage("Form.needs-body-for-event-handlers"),
                this,
                null,
                null);
View Full Code Here

    }

    public void setEncodingType(String encodingType)
    {
        if (_encodingType != null && !_encodingType.equals(encodingType))
            throw new ApplicationRuntimeException(
                Tapestry.format(
                    "Form.encoding-type-contention",
                    getExtendedId(),
                    _encodingType,
                    encodingType),
View Full Code Here

    {
        IForm form = getForm(cycle);
        IValidationDelegate delegate = form.getDelegate();

        if (delegate == null)
            throw new ApplicationRuntimeException(
                Tapestry.format(
                    "ValidField.no-delegate",
                    getExtendedId(),
                    getForm().getExtendedId()),
                this,
View Full Code Here

TOP

Related Classes of org.apache.tapestry.ApplicationRuntimeException

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.