Class MVCUtils
java.lang.Object
fr.paris.lutece.portal.util.mvc.utils.MVCUtils
Utils for MVC components
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConstant defining a value for no default - as a replacement fornullwhich we cannot use in annotation attributes.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddDownloadHeaderToResponse(jakarta.servlet.http.HttpServletResponse response, String strFilename, String strContentType) Add download headers to the responsestatic MethodfindActionAnnotedMethod(jakarta.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(jakarta.servlet.http.HttpServletRequest request, Method[] methods) Find the method that provide a given viewstatic StringgetAction(jakarta.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(jakarta.servlet.http.HttpServletRequest request) Get the view parameter
-
Field Details
-
MARK_ERRORS
- See Also:
-
MARK_INFOS
- See Also:
-
MARK_WARNINGS
- See Also:
-
MARK_MESSAGE_BOX
- See Also:
-
PARAMETER_VIEW
- See Also:
-
PARAMETER_ACTION
- See Also:
-
PARAMETER_PAGE
- See Also:
-
DEFAULT_NONE
Constant defining a value for no default - as a replacement fornullwhich we cannot use in annotation attributes.This is an artificial arrangement of 16 unicode characters, with its sole purpose being to never match user-declared values.
- 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(jakarta.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(jakarta.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(jakarta.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
-