Class WebPage

    • Constructor Detail

      • WebPage

        protected WebPage()
        Constructor. Having this constructor public means that your page is 'bookmarkable' and hence can be called/ created from anywhere.
      • WebPage

        protected WebPage​(PageParameters parameters)
        Constructor which receives wrapped query string parameters for a request. Having this constructor public means that your page is 'bookmarkable' and hence can be called/ created from anywhere. For bookmarkable pages (as opposed to when you construct page instances yourself, this constructor will be used in preference to a no-arg constructor, if both exist. Note that nothing is done with the page parameters argument. This constructor is provided so that tools such as IDEs will include it their list of suggested constructors for derived classes. Please call this constructor if you want to remember the pageparameters Page.getPageParameters(). So that they are reused for stateless links.
        Parameters:
        parameters - Wrapped query string parameters.
    • Method Detail

      • getMarkupType

        public MarkupType getMarkupType()
        Gets the markup type for a WebPage, which is "html" by default. Support for pages in another markup language, such as VXML, would require the creation of a different Page subclass in an appropriate package under org.apache.wicket.markup. To support VXML (voice markup), one might create the package org.apache.wicket.markup.vxml and a subclass of Page called VoicePage.
        Overrides:
        getMarkupType in class Page
        Returns:
        Markup type for HTML
      • onRender

        protected void onRender()
        Description copied from class: Component
        Implementation that renders this component.
        Overrides:
        onRender in class Page
      • renderXmlDecl

        protected void renderXmlDecl()
        The rules if and when to insert an xml decl in the response are a bit tricky. Allow the user to replace the default per page and per application.
      • configureResponse

        protected void configureResponse​(WebResponse response)
        Set-up response with appropriate content type, locale and encoding. The locale is set equal to the session's locale. The content type header contains information about the markup type (@see #getMarkupType()) and the encoding. The response (and request) encoding is determined by an application setting (@see ApplicationSettings#getResponseRequestEncoding()). If null, no xml decl will be written.
        Parameters:
        response - The WebResponse object
      • setHeaders

        protected void setHeaders​(WebResponse response)
        Subclasses can override this to set there headers when the Page is being served. By default these headers are set:
         response.setHeader("Date", "[now]");
         response.setHeader("Expires", "[0]");
         response.setHeader("Pragma", "no-cache");
         response.setHeader("Cache-Control", "no-cache");
         
        So if a Page wants to control this or doesn't want to set this info it should override this method and don't call super.
        Parameters:
        response - The WebResponse where set(Date)Header can be called on.
      • reportMissingHead

        protected void reportMissingHead​(CharSequence collectedHeaderOutput)
        Reports an error that there is no <head> and/or <body> in the page and there is no where to write the header response.
        Parameters:
        collectedHeaderOutput - The collected response that should have been written to the <head>
        See Also:
        validateHeaders()
      • homePageLink

        protected final BookmarkablePageLink<VoidhomePageLink​(String id)
        Creates and returns a bookmarkable link to this application's home page.
        Parameters:
        id - Name of link
        Returns:
        Link to home page for this application
      • dirty

        public final void dirty​(boolean isInitialization)
        Prevents page from get dirty inside an AJAX request.
        Overrides:
        dirty in class Page
        Parameters:
        isInitialization - a flag whether this is a page instantiation