Class MVCUtils


  • public final class MVCUtils
    extends Object
    Utils for MVC components
    • Method Detail

      • getView

        public static String getView​(javax.servlet.http.HttpServletRequest request)
        Get the view parameter
        Parameters:
        request - The HTTP request
        Returns:
        The view parameter or null if not found
      • getAction

        public static String getAction​(javax.servlet.http.HttpServletRequest request)
        Get the action parameter or any parameter with the prefix 'action_'
        Parameters:
        request - The HTTP request
        Returns:
        The action parameter or null if not found
      • findViewAnnotedMethod

        public static Method findViewAnnotedMethod​(javax.servlet.http.HttpServletRequest request,
                                                   Method[] methods)
        Find the method that provide a given view
        Parameters:
        request - The HTTP request
        methods - The methods list
        Returns:
        The method
      • findActionAnnotedMethod

        public static Method findActionAnnotedMethod​(javax.servlet.http.HttpServletRequest request,
                                                     Method[] methods)
        Find the method that provide a given action
        Parameters:
        request - The HTTP request
        methods - The methods list
        Returns:
        The method
      • findDefaultViewMethod

        public static Method findDefaultViewMethod​(Method[] methods)
        Find the method that provide the default view
        Parameters:
        methods - The methods list
        Returns:
        The method
      • addDownloadHeaderToResponse

        public static void addDownloadHeaderToResponse​(javax.servlet.http.HttpServletResponse response,
                                                       String strFilename,
                                                       String strContentType)
        Add download headers to the response
        Parameters:
        response - The response
        strFilename - The name of the file to download
        strContentType - The content type of the downloaded file
      • getLogger

        public static org.apache.logging.log4j.Logger getLogger()
        Return the MVC logger
        Returns:
        THe logger