Class MVCUtils
- java.lang.Object
-
- fr.paris.lutece.portal.util.mvc.utils.MVCUtils
-
public final class MVCUtils extends java.lang.ObjectUtils for MVC components
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPARAMETER_ACTIONstatic java.lang.StringPARAMETER_PAGEstatic java.lang.StringPARAMETER_VIEW
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddDownloadHeaderToResponse(javax.servlet.http.HttpServletResponse response, java.lang.String strFilename, java.lang.String strContentType)Add download headers to the responsestatic java.lang.reflect.MethodfindActionAnnotedMethod(javax.servlet.http.HttpServletRequest request, java.lang.reflect.Method[] methods)Find the method that provide a given actionstatic java.lang.reflect.MethodfindDefaultViewMethod(java.lang.reflect.Method[] methods)Find the method that provide the default viewstatic java.lang.reflect.MethodfindViewAnnotedMethod(javax.servlet.http.HttpServletRequest request, java.lang.reflect.Method[] methods)Find the method that provide a given viewstatic java.lang.StringgetAction(javax.servlet.http.HttpServletRequest request)Get the action parameter or any parameter with the prefix 'action_'static org.apache.logging.log4j.LoggergetLogger()Return the MVC loggerstatic java.lang.StringgetView(javax.servlet.http.HttpServletRequest request)Get the view parameter
-
-
-
Field Detail
-
PARAMETER_VIEW
public static final java.lang.String PARAMETER_VIEW
- See Also:
- Constant Field Values
-
PARAMETER_ACTION
public static final java.lang.String PARAMETER_ACTION
- See Also:
- Constant Field Values
-
PARAMETER_PAGE
public static final java.lang.String PARAMETER_PAGE
- See Also:
- Constant Field Values
-
-
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 requestmethods- 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 requestmethods- 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 responsestrFilename- The name of the file to downloadstrContentType- The content type of the downloaded file
-
getLogger
public static org.apache.logging.log4j.Logger getLogger()
Return the MVC logger- Returns:
- THe logger
-
-