Resolves special pages, JSPs and Commands on behalf of a WikiEngine. CommandResolver will automatically resolve page names with singular/plural variants. It can also detect the correct Command based on parameters supplied in an HTTP request, or due to the JSP being accessed.
CommandResolver's static {@link #findCommand(String)} method isthe simplest method; it looks up and returns the Command matching a supplied wiki context. For example, looking up the request context view
returns {@link PageCommand#VIEW}. Use this method to obtain static Command instances that aren't targeted at a particular page or group.
For more complex lookups in which the caller supplies an HTTP request, {@link #findCommand(HttpServletRequest,String)} willlook up and return the correct Command. The String parameter defaultContext
supplies the request context to use if it cannot be detected. However, note that the default wiki context may be over-ridden if the request was for a "special page."
For example, suppose the WikiEngine's properties specify a special page called UserPrefs
that redirects to UserPreferences.jsp
. The ordinary lookup method {@linkplain #findCommand(String)} using a suppliedcontext view
would return {@link PageCommand#VIEW}. But the {@linkplain #findCommand(HttpServletRequest,String)} method,when passed the same context (view
) and an HTTP request containing the page parameter value UserPrefs
, will instead return {@link WikiCommand#PREFS}.
|
|