Class HypermediaService
java.lang.Object
com.invirgance.convirgance.web.service.HypermediaService
- All Implemented Interfaces:
Service
Provides a Hypermedia view for a resource, including handling of REST-like
calls routed through verbs to account for only GET/POST being supported by
HTML forms. Verbs are computed as the last component of the path and optionally
provide both a view and a service handler. POST requests to a verb will call
a configured service to handle the request and then redirect to a GET request to
complete the Hypermedia rendering.
Parameters configured by this service will be received by pages called as regular HTTP request parameters. This allows configured parameters to be accessed by JSP pages as if they were in the url query string. e.g.
Parameters configured by this service will be received by pages called as regular HTTP request parameters. This allows configured parameters to be accessed by JSP pages as if they were in the url query string. e.g.
${param.id}
,
<%= request.getParameter("id") %>, etc.- Author:
- jbanes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
execute
(HttpRequest request, HttpResponse response) Executes the service, processing the HTTP request and generating a response.getPage()
The default JSP or Servlet path to render for GET requests.Gets the list of parameters to extract from the request.getVerbs()
List of configured verbs for handling special requests like editing and creating records.void
Set a path to the default JSP or Servlet to render for GET requests.void
setParameters
(List<Parameter> parameters) Sets the list of parameters to extract from the request.void
setVerbs
(List<HypermediaVerb> verbs) Set a list of configured verbs for handling special requests like editing and creating records.
-
Constructor Details
-
HypermediaService
public HypermediaService()
-
-
Method Details
-
getParameters
Gets the list of parameters to extract from the request.- Returns:
- The parameters list
-
setParameters
Sets the list of parameters to extract from the request.- Parameters:
parameters
- The parameters list
-
getPage
The default JSP or Servlet path to render for GET requests. The page will receive all parameters configured by this service as request parameters.- Returns:
- the path to the JSP or servlet or null if no page has been set
-
setPage
Set a path to the default JSP or Servlet to render for GET requests. The page will receive all parameters configured by this service as request parameters.- Parameters:
page
- the path to a JSP or servlet
-
getVerbs
List of configured verbs for handling special requests like editing and creating records.- Returns:
- list of configured verbs
-
setVerbs
Set a list of configured verbs for handling special requests like editing and creating records.- Parameters:
verbs
- list of verbs
-
execute
Description copied from interface:Service
Executes the service, processing the HTTP request and generating a response.
-