Package org.apache.wiki.ajax
Class WikiAjaxDispatcherServlet
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.apache.wiki.ajax.WikiAjaxDispatcherServlet
- All Implemented Interfaces:
jakarta.servlet.Servlet,jakarta.servlet.ServletConfig,Serializable
This provides a simple ajax servlet for handling /ajax/ requests. HttpServlet classes need to be registered using
registerServlet(WikiAjaxServlet)- Since:
- 2.10.2-svn12
- See Also:
-
Field Summary
Fields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res) CallsperformAction(jakarta.servlet.http.HttpServletRequest, jakarta.servlet.http.HttpServletResponse)voiddoPost(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res) CallsperformAction(jakarta.servlet.http.HttpServletRequest, jakarta.servlet.http.HttpServletResponse)findServletByName(String servletAlias) Find theWikiAjaxServletgiven the servletAlias that it was registered with.getServletName(String path) Get the ServletName from the requestURI "/ajax/", using AjaxUtil.getNextPathPart(java.lang.String, java.lang.String).voidinit(jakarta.servlet.ServletConfig config) This sets the AjaxPath to "/ajax/" as configured in "jspwiki.ajax.url.prefix".static voidregisterServlet(String alias, WikiAjaxServlet servlet) Register aWikiAjaxServletwith a specific alias, and default permissionPagePermission.VIEW.static voidregisterServlet(String alias, WikiAjaxServlet servlet, Permission perm) Regster aWikiAjaxServletgiven an alias, the servlet, and the permission.static voidregisterServlet(WikiAjaxServlet servlet) Register aWikiAjaxServletusing the servlet mapping as the aliasMethods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPatch, doPut, doTrace, getLastModified, isSensitiveHeader, service, serviceMethods inherited from class jakarta.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Constructor Details
-
WikiAjaxDispatcherServlet
public WikiAjaxDispatcherServlet()
-
-
Method Details
-
init
This sets the AjaxPath to "/ajax/" as configured in "jspwiki.ajax.url.prefix". Note: Do not change this without also changing the web.xml file.- Specified by:
initin interfacejakarta.servlet.Servlet- Overrides:
initin classjakarta.servlet.http.HttpServlet- Throws:
jakarta.servlet.ServletException
-
registerServlet
Register aWikiAjaxServletusing the servlet mapping as the alias -
registerServlet
Register aWikiAjaxServletwith a specific alias, and default permissionPagePermission.VIEW. -
registerServlet
Regster aWikiAjaxServletgiven an alias, the servlet, and the permission. This creates a temporary bundle object calledWikiAjaxDispatcherServlet.AjaxServletContainer- Parameters:
alias- the uri link to this servletservlet- the servlet being registeredperm- the permission required to execute the servlet.
-
doPost
public void doPost(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res) throws IOException, jakarta.servlet.ServletException CallsperformAction(jakarta.servlet.http.HttpServletRequest, jakarta.servlet.http.HttpServletResponse)- Overrides:
doPostin classjakarta.servlet.http.HttpServlet- Throws:
IOExceptionjakarta.servlet.ServletException
-
doGet
public void doGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res) throws IOException, jakarta.servlet.ServletException CallsperformAction(jakarta.servlet.http.HttpServletRequest, jakarta.servlet.http.HttpServletResponse)- Overrides:
doGetin classjakarta.servlet.http.HttpServlet- Throws:
IOExceptionjakarta.servlet.ServletException
-
getServletName
Get the ServletName from the requestURI "/ajax/", using AjaxUtil.getNextPathPart(java.lang.String, java.lang.String).- Parameters:
path- The requestURI, which must contains "/ajax/" in the path - Returns:
- The ServletName for the requestURI, or null
- Throws:
jakarta.servlet.ServletException- if the path is invalid
-
findServletByName
Find theWikiAjaxServletgiven the servletAlias that it was registered with.- Parameters:
servletAlias- the value provided toregisterServlet(org.apache.wiki.ajax.WikiAjaxServlet)- Returns:
- the
WikiAjaxServletgiven the servletAlias that it was registered with.
-