Example usage for org.apache.wicket.protocol.http PageExpiredException PageExpiredException

List of usage examples for org.apache.wicket.protocol.http PageExpiredException PageExpiredException

Introduction

In this page you can find the example usage for org.apache.wicket.protocol.http PageExpiredException PageExpiredException.

Prototype

public PageExpiredException(final String message) 

Source Link

Usage

From source file:wicketdnd.DragSource.java

License:Apache License

/**
 * Get the drag source of the given request.
 * /*from   ww  w.j  a  v  a2s.  com*/
 * @param request
 *            request on which a drag happened
 * @return drag source
 */
final static DragSource read(Page page, Request request) {
    String path = request.getRequestParameters().getParameterValue("path").toString();
    Component component = page.get(path);
    if (component == null) {
        throw new PageExpiredException("No drag source found " + path);
    }

    int behavior = request.getRequestParameters().getParameterValue("behavior").toInt();
    return (DragSource) component.getBehaviorById(behavior);
}

From source file:wicketdnd.util.MarkupIdVisitor.java

License:Apache License

/**
 * Get the given container's descendent by markup id.
 * //w w  w.  j  a va 2 s  .  c  o m
 * @param container
 *            container to find descendent of
 * @param id
 *            markup id
 * @return component
 * @throws PageExpiredException
 *             if no descendent has the given markup id
 */
public static Component getComponent(MarkupContainer container, String id) {
    if (id.equals(container.getMarkupId(false))) {
        return container;
    }

    Component component = container.visitChildren(new MarkupIdVisitor(id));

    if (component == null) {
        throw new PageExpiredException("No component with markup id " + id);
    }

    return component;
}