Class MVCUtils


  • public final class MVCUtils
    extends java.lang.Object
    Utils for MVC components
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void addDownloadHeaderToResponse​(javax.servlet.http.HttpServletResponse response, java.lang.String strFilename, java.lang.String strContentType)
      Add download headers to the response
      static java.lang.reflect.Method findActionAnnotedMethod​(javax.servlet.http.HttpServletRequest request, java.lang.reflect.Method[] methods)
      Find the method that provide a given action
      static java.lang.reflect.Method findDefaultViewMethod​(java.lang.reflect.Method[] methods)
      Find the method that provide the default view
      static java.lang.reflect.Method findViewAnnotedMethod​(javax.servlet.http.HttpServletRequest request, java.lang.reflect.Method[] methods)
      Find the method that provide a given view
      static java.lang.String getAction​(javax.servlet.http.HttpServletRequest request)
      Get the action parameter or any parameter with the prefix 'action_'
      static org.apache.logging.log4j.Logger getLogger()
      Return the MVC logger
      static java.lang.String getView​(javax.servlet.http.HttpServletRequest request)
      Get the view parameter
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getView

        public static java.lang.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 java.lang.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 java.lang.reflect.Method findViewAnnotedMethod​(javax.servlet.http.HttpServletRequest request,
                                                                     java.lang.reflect.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 java.lang.reflect.Method findActionAnnotedMethod​(javax.servlet.http.HttpServletRequest request,
                                                                       java.lang.reflect.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 java.lang.reflect.Method findDefaultViewMethod​(java.lang.reflect.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,
                                                       java.lang.String strFilename,
                                                       java.lang.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