diff options
author | Kjetil Ørbekk <orbekk@pvv.ntnu.no> | 2010-09-02 00:34:33 -0400 |
---|---|---|
committer | Kjetil Ørbekk <orbekk@pvv.ntnu.no> | 2010-09-02 00:34:33 -0400 |
commit | 699b451675830da041d09a6e32045772788ad66e (patch) | |
tree | cc3e46670503599dd546dbc1652189dd2b4fc02e /src/lq |
Framework for Lino Quotes
Diffstat (limited to 'src/lq')
-rw-r--r-- | src/lq/Redirect.java | 23 | ||||
-rw-r--r-- | src/lq/ViewQuotes.java | 14 |
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!"); + } +} |