Class MVCUtils
java.lang.Object
fr.paris.lutece.portal.util.mvc.utils.MVCUtils
Utils for MVC components
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddDownloadHeaderToResponse(javax.servlet.http.HttpServletResponse response, String strFilename, String strContentType) Add download headers to the responsestatic MethodfindActionAnnotedMethod(javax.servlet.http.HttpServletRequest request, Method[] methods) Find the method that provide a given actionstatic MethodfindDefaultViewMethod(Method[] methods) Find the method that provide the default viewstatic MethodfindViewAnnotedMethod(javax.servlet.http.HttpServletRequest request, Method[] methods) Find the method that provide a given viewstatic StringgetAction(javax.servlet.http.HttpServletRequest request) Get the action parameter or any parameter with the prefix 'action_'static org.apache.logging.log4j.LoggerReturn the MVC loggerstatic StringgetView(javax.servlet.http.HttpServletRequest request) Get the view parameter
-
Field Details
-
PARAMETER_VIEW
- See Also:
-
PARAMETER_ACTION
- See Also:
-
PARAMETER_PAGE
- See Also:
-
-
Method Details
-
getView
Get the view parameter- Parameters:
request- The HTTP request- Returns:
- The view parameter or null if not found
-
getAction
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 requestmethods- 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 requestmethods- The methods list- Returns:
- The method
-
findDefaultViewMethod
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 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
-