Class HeFQUINServlet
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
se.liu.ida.hefquin.service.HeFQUINServlet
- All Implemented Interfaces:
jakarta.servlet.Servlet
,jakarta.servlet.ServletConfig
,Serializable
public class HeFQUINServlet
extends jakarta.servlet.http.HttpServlet
Servlet for handling SPARQL queries via HTTP GET and POST requests.
Supports multiple result formats and integrates with the HeFQUIN engine.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doGet
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Handles HTTP GET requests containing a SPARQL query passed via the 'query' parameter.protected void
doPost
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Handles HTTP POST requests containing SPARQL queries.void
init
(jakarta.servlet.ServletConfig config) Initializes the servlet.Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
Methods inherited from class jakarta.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Constructor Details
-
HeFQUINServlet
public HeFQUINServlet()
-
-
Method Details
-
init
public void init(jakarta.servlet.ServletConfig config) throws jakarta.servlet.ServletException Initializes the servlet.- Specified by:
init
in interfacejakarta.servlet.Servlet
- Overrides:
init
in classjakarta.servlet.GenericServlet
- Parameters:
config
- the servlet configuration- Throws:
jakarta.servlet.ServletException
- if the engine initialization fails
-
doPost
protected void doPost(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException Handles HTTP POST requests containing SPARQL queries. Supports both 'application/sparql-query' and 'application/x-www-form-urlencoded'.- Overrides:
doPost
in classjakarta.servlet.http.HttpServlet
- Parameters:
request
- the HTTP requestresponse
- the HTTP response- Throws:
IOException
-
doGet
protected void doGet(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException Handles HTTP GET requests containing a SPARQL query passed via the 'query' parameter.- Overrides:
doGet
in classjakarta.servlet.http.HttpServlet
- Parameters:
request
- the HTTP requestresponse
- the HTTP response- Throws:
IOException
-