summaryrefslogtreecommitdiff
path: root/src/lq
diff options
context:
space:
mode:
Diffstat (limited to 'src/lq')
-rw-r--r--src/lq/Redirect.java23
-rw-r--r--src/lq/ViewQuotes.java14
2 files changed, 37 insertions, 0 deletions
diff --git a/src/lq/Redirect.java b/src/lq/Redirect.java
new file mode 100644
index 0000000..b3414bb
--- /dev/null
+++ b/src/lq/Redirect.java
@@ -0,0 +1,23 @@
+package lq;
+
+import java.io.IOException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+
+public class Redirect extends HttpServlet {
+ private String destination;
+
+ @Override
+ public void init(ServletConfig config) throws ServletException {
+ destination = config.getInitParameter("destination");
+ }
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp)
+ throws IOException {
+ resp.sendRedirect(destination);
+ }
+}
diff --git a/src/lq/ViewQuotes.java b/src/lq/ViewQuotes.java
new file mode 100644
index 0000000..cc03f51
--- /dev/null
+++ b/src/lq/ViewQuotes.java
@@ -0,0 +1,14 @@
+package lq;
+
+import java.io.IOException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public class ViewQuotes extends HttpServlet {
+ public void doGet(HttpServletRequest req, HttpServletResponse resp)
+ throws IOException {
+ resp.setContentType("text/plain");
+ resp.getWriter().println("Hello, World!");
+ }
+}