Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package pl.matisoft.soy.global.runtime.resolvers;
 
 
Created with IntelliJ IDEA. User: mati Date: 01/11/2013 Time: 17:08
    private String prefix = "_request.context.";
    @Inject
    private ServletContext servletContext;
    @Override
    public void resolveData(final HttpServletRequest requestfinal HttpServletResponse responsefinal Map<String, ? extends Objectmodelfinal SoyMapData root) {
        final RequestContext requestContext = new RequestContext(requestresponse, (Map<StringObject>) model);
        if (requestContext.getContextPath() != null) {
            root.put( + "contextPath"requestContext.getContextPath());
        }
        if (requestContext.getPathToServlet() != null) {
            root.put( + "pathToServlet"requestContext.getPathToServlet());
        }
        if (requestContext.getQueryString() != null) {
            root.put( + "queryString"requestContext.getQueryString());
        }
        if (requestContext.getRequestUri() != null) {
            root.put( + "requestUri"requestContext.getRequestUri());
        }
        if (requestContext.getLocale() != null) {
            root.put( + "locale"requestContext.getLocale().toString());
        }
    }
    public void setPrefix(String prefix) {
        this. = prefix;
    }
    public String getPrefix() {
        return ;
    }
    @Override
    public void setServletContext(final ServletContext servletContext) {
        this. = servletContext;
    }
New to GrepCode? Check out our FAQ X