Codota Logo
GuicedServletKeys
Code IndexAdd Codota to your IDE (free)

How to use
GuicedServletKeys
in
com.jwebmp.guicedservlets

Best Java code snippets using com.jwebmp.guicedservlets.GuicedServletKeys (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: com.jwebmp/jwebmp-core

/**
 * When to perform any commands
 */
@Override
public void perform()
{
  HttpServletRequest request = GuiceContext.get(GuicedServletKeys.getHttpServletRequestKey());
  FileTemplates.getFileTemplate(JWScriptServlet.class, JWScriptServlet.FILE_TEMPLATE_NAME, "siteloader");
  FileTemplates.getTemplateVariables()
         .put("SITEADDRESSINSERT", new StringBuilder(request.getRequestURL()
                                  .toString()
                                  .replace("jwscr", "")));
  StringBuilder output = FileTemplates.renderTemplateScripts(JWScriptServlet.FILE_TEMPLATE_NAME);
  writeOutput(output, StaticStrings.HTML_HEADER_JAVASCRIPT, StaticStrings.UTF8_CHARSET);
}
origin: com.jwebmp/jwebmp-core

/**
 * When to perform any commands
 */
@Override
public void perform()
{
  HttpServletResponse response = GuiceContext.get(GuicedServletKeys.getHttpServletResponseKey());
  sendPage(response);
}
origin: com.jwebmp/jwebmp-core

/**
 * Reads the variables into the HTTP session
 *
 * @param request
 *         The physical request
 *
 * @throws com.jwebmp.core.exceptions.MissingComponentException
 *         If something is wrong with the page
 */
@SuppressWarnings("WeakerAccess")
protected void readRequestVariables(HttpServletRequest request) throws MissingComponentException
{
  Page currentPage = getPageFromGuice();
  HttpSession session = GuiceContext.get(GuicedServletKeys.getHttpSessionKey());
  if (currentPage == null)
  {
    throw new MissingComponentException("[No Page]-[getPage() returning null in servlet class]");
  }
  if (session.isNew())
  {
    JWDefaultServlet.log.log(Level.FINER, "[SessionID]-[{0}];[Name]-[User Login];[Action]-[Session Page Added];", request.getSession()
                                                               .getId());
  }
}
origin: com.jwebmp.jre10/guiced-servlets

  @Override
  public void onStartup()
  {
    GuicedServletKeys.setHttpServletRequestKey(Key.get(HttpServletRequest.class));
    GuicedServletKeys.setHttpServletResponseKey(Key.get(HttpServletResponse.class));
    GuicedServletKeys.setHttpSessionKey(Key.get(HttpSession.class));
    GuicedServletKeys.setServletContextKey(Key.get(ServletContext.class));
    GuicedServletKeys.setServletRequestKey(Key.get(ServletRequest.class));
    GuicedServletKeys.setServletResponseKey(Key.get(ServletResponse.class));
  }
}
origin: com.jwebmp/guiced-servlets

  @Override
  public void onStartup()
  {
    GuicedServletKeys.setHttpServletRequestKey(Key.get(HttpServletRequest.class));
    GuicedServletKeys.setHttpServletResponseKey(Key.get(HttpServletResponse.class));
    GuicedServletKeys.setHttpSessionKey(Key.get(HttpSession.class));
    GuicedServletKeys.setServletContextKey(Key.get(ServletContext.class));
    GuicedServletKeys.setServletRequestKey(Key.get(ServletRequest.class));
    GuicedServletKeys.setServletResponseKey(Key.get(ServletResponse.class));

    log.fine("Bound HttpServletResponse Key");
    log.fine("Bound HttpServletRequest Key");
    log.fine("Bound HttpSession Key");
    log.fine("Bound ServletContext Key");
    log.fine("Bound ServletRequest Key");
    log.fine("Bound ServletResponse Key");
  }
}
origin: com.jwebmp.jre10/jwebmp-core

/**
 * When to perform any commands
 */
@Override
public void perform()
{
  HttpServletRequest request = GuiceContext.get(GuicedServletKeys.getHttpServletRequestKey());
  FileTemplates.getFileTemplate(JWScriptServlet.class, JWScriptServlet.FILE_TEMPLATE_NAME, "siteloader");
  FileTemplates.getTemplateVariables()
         .put("SITEADDRESSINSERT", new StringBuilder(request.getRequestURL()
                                  .toString()
                                  .replace("jwscr", "")));
  StringBuilder output = FileTemplates.renderTemplateScripts(JWScriptServlet.FILE_TEMPLATE_NAME);
  writeOutput(output, StaticStrings.HTML_HEADER_JAVASCRIPT, StaticStrings.UTF8_CHARSET);
}
origin: com.jwebmp.jre11/jwebmp-core

/**
 * When to perform any commands
 */
@Override
public void perform()
{
  HttpServletResponse response = GuiceContext.get(GuicedServletKeys.getHttpServletResponseKey());
  sendPage(response);
}
origin: com.jwebmp.jre10/jwebmp-core

/**
 * Reads the variables into the HTTP session
 *
 * @param request
 *         The physical request
 *
 * @throws com.jwebmp.core.exceptions.MissingComponentException
 *         If something is wrong with the page
 */
@SuppressWarnings("WeakerAccess")
protected void readRequestVariables(HttpServletRequest request) throws MissingComponentException
{
  Page currentPage = getPageFromGuice();
  HttpSession session = GuiceContext.get(GuicedServletKeys.getHttpSessionKey());
  if (currentPage == null)
  {
    throw new MissingComponentException("[No Page]-[getPage() returning null in servlet class]");
  }
  if (session.isNew())
  {
    JWDefaultServlet.log.log(Level.FINER, "[SessionID]-[{0}];[Name]-[User Login];[Action]-[Session Page Added];", request.getSession()
                                                               .getId());
  }
}
origin: com.jwebmp.jre11/jwebmp-core

/**
 * When to perform any commands
 */
@Override
public void perform()
{
  HttpServletRequest request = GuiceContext.get(GuicedServletKeys.getHttpServletRequestKey());
  FileTemplates.getFileTemplate(JWScriptServlet.class, JWScriptServlet.FILE_TEMPLATE_NAME, "siteloader");
  FileTemplates.getTemplateVariables()
         .put("SITEADDRESSINSERT", new StringBuilder(request.getRequestURL()
                                  .toString()
                                  .replace("jwscr", "")));
  StringBuilder output = FileTemplates.renderTemplateScripts(JWScriptServlet.FILE_TEMPLATE_NAME);
  writeOutput(output, StaticStrings.HTML_HEADER_JAVASCRIPT, StaticStrings.UTF8_CHARSET);
}
origin: com.jwebmp.jre10/jwebmp-core

/**
 * When to perform any commands
 */
@Override
public void perform()
{
  HttpServletResponse response = GuiceContext.get(GuicedServletKeys.getHttpServletResponseKey());
  sendPage(response);
}
origin: com.jwebmp.jre11/jwebmp-core

/**
 * Reads the variables into the HTTP session
 *
 * @param request
 *         The physical request
 *
 * @throws com.jwebmp.core.exceptions.MissingComponentException
 *         If something is wrong with the page
 */
@SuppressWarnings("WeakerAccess")
protected void readRequestVariables(HttpServletRequest request) throws MissingComponentException
{
  Page currentPage = getPageFromGuice();
  HttpSession session = GuiceContext.get(GuicedServletKeys.getHttpSessionKey());
  if (currentPage == null)
  {
    throw new MissingComponentException("[No Page]-[getPage() returning null in servlet class]");
  }
  if (session.isNew())
  {
    JWDefaultServlet.log.log(Level.FINER, "[SessionID]-[{0}];[Name]-[User Login];[Action]-[Session Page Added];", request.getSession()
                                                               .getId());
  }
}
origin: com.jwebmp/jwebmp-core

  @Override
  public void perform()
  {
    StringBuilder scripts = new StringBuilder();
    Page page = GuiceContext.get(Page.class);
    readBrowserInformation(GuiceContext.get(GuicedServletKeys.getHttpServletRequestKey()));
    StringBuilder css = page.getBody()
                .renderCss(0);
    scripts.append(css);
    writeOutput(css, StaticStrings.HTML_HEADER_CSS, StaticStrings.UTF8_CHARSET);
  }
}
origin: com.jwebmp.jre10/jwebmp-core

  @Override
  public void perform()
  {
    StringBuilder scripts = new StringBuilder();
    Page page = GuiceContext.get(Page.class);
    readBrowserInformation(GuiceContext.get(GuicedServletKeys.getHttpServletRequestKey()));
    StringBuilder css = page.getBody()
                .renderCss(0);
    scripts.append(css);
    writeOutput(css, StaticStrings.HTML_HEADER_CSS, StaticStrings.UTF8_CHARSET);
  }
}
origin: com.jwebmp.jre11/jwebmp-core

  @Override
  public void perform()
  {
    StringBuilder scripts = new StringBuilder();
    Page page = GuiceContext.get(Page.class);
    readBrowserInformation(GuiceContext.get(GuicedServletKeys.getHttpServletRequestKey()));
    StringBuilder css = page.getBody()
                .renderCss(0);
    scripts.append(css);
    writeOutput(css, StaticStrings.HTML_HEADER_CSS, StaticStrings.UTF8_CHARSET);
  }
}
origin: com.jwebmp.jre10/jwebmp-core

/**
 * When to perform any commands
 */
@Override
@SuppressWarnings("unchecked")
public void perform()
{
  HttpServletRequest request = GuiceContext.get(GuicedServletKeys.getHttpServletRequestKey());
  String componentID = request.getParameter("component");
  StringBuilder responseString = new StringBuilder();
  try
  {
    Class<? extends IDataComponent> clazz = (Class<? extends IDataComponent>) Class.forName(
        componentID.replace(StaticStrings.CHAR_UNDERSCORE, StaticStrings.CHAR_DOT));
    IDataComponent component = GuiceContext.getInstance(clazz);
    StringBuilder renderData = component.renderData();
    responseString.append(renderData);
  }
  catch (Exception e)
  {
    Page p = getErrorPageHtml(e);
    writeOutput(new StringBuilder(p.toString(0)), StaticStrings.HTML_HEADER_DEFAULT_CONTENT_TYPE, StaticStrings.UTF8_CHARSET);
    return;
  }
  GuiceContext.get(DataCallInterceptorKey)
        .forEach(DataCallIntercepter::intercept);
  writeOutput(responseString, StaticStrings.HTML_HEADER_JSON, StaticStrings.UTF8_CHARSET);
}
origin: com.jwebmp/jwebmp-core

/**
 * When to perform any commands
 */
@Override
@SuppressWarnings("unchecked")
public void perform()
{
  HttpServletRequest request = GuiceContext.get(GuicedServletKeys.getHttpServletRequestKey());
  String componentID = request.getParameter("component");
  StringBuilder responseString = new StringBuilder();
  try
  {
    Class<? extends IDataComponent> clazz = (Class<? extends IDataComponent>) Class.forName(
        componentID.replace(StaticStrings.CHAR_UNDERSCORE, StaticStrings.CHAR_DOT));
    IDataComponent component = GuiceContext.getInstance(clazz);
    StringBuilder renderData = component.renderData();
    responseString.append(renderData);
  }
  catch (Exception e)
  {
    Page p = getErrorPageHtml(e);
    writeOutput(new StringBuilder(p.toString(0)), StaticStrings.HTML_HEADER_DEFAULT_CONTENT_TYPE, StaticStrings.UTF8_CHARSET);
    return;
  }
  GuiceContext.get(DataCallInterceptorKey)
        .forEach(DataCallIntercepter::intercept);
  writeOutput(responseString, StaticStrings.HTML_HEADER_JSON, StaticStrings.UTF8_CHARSET);
}
origin: com.jwebmp.jre11/jwebmp-core

/**
 * When to perform any commands
 */
@Override
@SuppressWarnings("unchecked")
public void perform()
{
  HttpServletRequest request = GuiceContext.get(GuicedServletKeys.getHttpServletRequestKey());
  String componentID = request.getParameter("component");
  StringBuilder responseString = new StringBuilder();
  try
  {
    Class<? extends IDataComponent> clazz = (Class<? extends IDataComponent>) Class.forName(
        componentID.replace(StaticStrings.CHAR_UNDERSCORE, StaticStrings.CHAR_DOT));
    IDataComponent component = GuiceContext.getInstance(clazz);
    StringBuilder renderData = component.renderData();
    responseString.append(renderData);
  }
  catch (Exception e)
  {
    Page p = getErrorPageHtml(e);
    writeOutput(new StringBuilder(p.toString(0)), StaticStrings.HTML_HEADER_DEFAULT_CONTENT_TYPE, StaticStrings.UTF8_CHARSET);
    return;
  }
  GuiceContext.get(DataCallInterceptorKey)
        .forEach(DataCallIntercepter::intercept);
  writeOutput(responseString, StaticStrings.HTML_HEADER_JSON, StaticStrings.UTF8_CHARSET);
}
origin: com.jwebmp.jre10/jwebmp-core

.toProvider(() ->
        HttpServletRequest request = GuiceContext.get(GuicedServletKeys.getHttpServletRequestKey());
        String headerInformation = request.getHeader("User-Agent");
        return GuiceContext.get(UserAgentStringParser.class)
origin: com.jwebmp.jre11/jwebmp-core

.toProvider(() ->
        HttpServletRequest request = GuiceContext.get(GuicedServletKeys.getHttpServletRequestKey());
        String headerInformation = request.getHeader("User-Agent");
        return GuiceContext.get(UserAgentStringParser.class)
origin: com.jwebmp/jwebmp-core

.toProvider(() ->
        HttpServletRequest request = GuiceContext.get(GuicedServletKeys.getHttpServletRequestKey());
        String headerInformation = request.getHeader("User-Agent");
        return GuiceContext.get(UserAgentStringParser.class)
com.jwebmp.guicedservletsGuicedServletKeys

Javadoc

Keys holder for Guice Servlet items - Exists purely to override in test cases

Most used methods

  • getHttpServletRequestKey
    Method getHttpServletRequestKey returns the HttpServletRequestKey of this GuicedServletKeys object.
  • getHttpServletResponseKey
    Method getHttpServletResponseKey returns the HttpServletResponseKey of this GuicedServletKeys object
  • getHttpSessionKey
    Method getHttpSessionKey returns the HttpSessionKey of this GuicedServletKeys object. The key to get
  • setHttpServletRequestKey
    Method setHttpServletRequestKey sets the HttpServletRequestKey of this GuicedServletKeys object. The
  • setHttpServletResponseKey
    Method setHttpServletResponseKey sets the HttpServletResponseKey of this GuicedServletKeys object. T
  • setHttpSessionKey
    Method setHttpSessionKey sets the HttpSessionKey of this GuicedServletKeys object. The key to get th
  • setServletContextKey
    Method setServletContextKey sets the ServletContextKey of this GuicedServletKeys object. The key to
  • setServletRequestKey
    Method setServletRequestKey sets the ServletRequestKey of this GuicedServletKeys object. The key to
  • setServletResponseKey
    Method setServletResponseKey sets the ServletResponseKey of this GuicedServletKeys object. The key t

Popular in Java

  • Reactive rest calls using spring rest template
  • notifyDataSetChanged (ArrayAdapter)
  • onRequestPermissionsResult (Fragment)
  • runOnUiThread (Activity)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • FileWriter (java.io)
    Convenience class for writing character files. The constructors of this class assume that the defaul
  • String (java.lang)
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Table (org.hibernate.mapping)
    A relational table
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registery of org.quartz
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now