19 package org.turro.elephant.web.tags;
21 import java.io.IOException;
22 import javax.servlet.ServletException;
23 import javax.servlet.annotation.WebServlet;
24 import javax.servlet.http.HttpServlet;
25 import javax.servlet.http.HttpServletRequest;
26 import javax.servlet.http.HttpServletResponse;
27 import org.turro.collections.KeyValueMap;
28 import org.turro.elephant.context.ElephantContext;
29 import org.turro.elephant.context.IConstructor;
30 import org.turro.elephant.web.ElContext;
31 import org.turro.elephant.web.ElContextMap;
32 import org.turro.marker.MarkerHelper;
33 import org.turro.path.Path;
34 import org.turro.string.Strings;
40 @WebServlet(name =
"TagsEl", urlPatterns = {
"/tag_/*"})
43 private static final String CONTEXT_TO =
"elctxnav";
55 if(Strings.isBlank(path)) {
57 if(!Strings.isBlank(backTag)) {
68 protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
71 if(kvm.containsKey(
"tag"))
SessionTags.
get(request, response).
add(kvm.get(
"tag"));
73 if(kvm.containsKey(
"path")) {
74 response.sendRedirect(request.getContextPath() + kvm.get(
"path"));
78 Path path = Path.pathFrom(request.getPathInfo());
81 response.setStatus(HttpServletResponse.SC_FOUND);
82 response.sendRedirect(request.getContextPath() + context.
getPath());
87 protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
88 processRequest(request, response);
92 protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
93 processRequest(request, response);
98 return "WebTags for Elephant";
static String getRootWebPath()
static ElContext getContextFromWebTag(String webTag)
static KeyValueMap getObfuscatedParameters()
static String setObfuscatedPars(String parameters)