Class AbstractPageHandler

  • Direct Known Subclasses:
    ManageProxiesCreatePage, ManageProxiesEditPage, ManageProxiesListPage, UserAccountsPage

    public abstract class AbstractPageHandler
    extends Object
    A base class with some utility routines for page handler (created by controller classes. The controller logic is often complicated by the fact that the servlet must be multi-threaded. If a "page handler" instance is created for each request, it may share instance variables among its methods, which frequently makes for clearer logic.
    • Constructor Detail

      • AbstractPageHandler

        protected AbstractPageHandler​(VitroRequest vreq)
    • Method Detail

      • getStringParameter

        protected String getStringParameter​(String key,
                                            String defaultValue)
      • getStringParameters

        protected List<String> getStringParameters​(String key)
      • getIntegerParameter

        protected int getIntegerParameter​(String key,
                                          int defaultValue)
      • isFlagOnRequest

        protected boolean isFlagOnRequest​(String key)
        Check for the presence of a parameter, regardless of its value, even if it's an empty string.
      • isParameterAsExpected

        protected boolean isParameterAsExpected​(String key,
                                                String expected)
        Treat the presence of a certain parameter, with a desired value, as a boolean flag. An example would be radio buttons with values of "yes" and "no". The expected value would be "yes".
      • applyMessage

        protected void applyMessage​(javax.servlet.http.HttpServletRequest req,
                                    Map<String,​Object> body)
        If a Message has been set in the session, get it, store its info in the body map under "message", and remove it from the session, so it will not be displayed again.