Example usage for javax.servlet.jsp PageContext SESSION_SCOPE

List of usage examples for javax.servlet.jsp PageContext SESSION_SCOPE

Introduction

In this page you can find the example usage for javax.servlet.jsp PageContext SESSION_SCOPE.

Prototype

int SESSION_SCOPE

To view the source code for javax.servlet.jsp PageContext SESSION_SCOPE.

Click Source Link

Document

Session scope (only valid if this page participates in a session): the named reference remains available from the HttpSession (if any) associated with the Servlet until the HttpSession is invalidated.

Usage

From source file:org.apache.struts.taglib.bean.TestMessageTag3.java

private void runMyTest(String whichTest, Locale locale) {
    pageContext.setAttribute(Globals.LOCALE_KEY, locale, PageContext.SESSION_SCOPE);
    request.setAttribute("runTest", whichTest);
    try {//from w w w . ja  v a2s . co  m
        pageContext.forward("/test/org/apache/struts/taglib/bean/TestMessageTag3.jsp");
    } catch (Exception e) {
        e.printStackTrace();
        fail("There is a problem that is preventing the tests to continue!");
    }
}

From source file:org.apache.struts.taglib.bean.TestMessageTag3.java

public void testMessageTag3ArgNamePropertySessionScopeDefaultBundle() {
    pageContext.setAttribute("key", new SimpleBeanForTesting("default.bundle.message.3"),
            PageContext.SESSION_SCOPE);
    runMyTest("testMessageTag3ArgNamePropertySessionScopeDefaultBundle", new Locale("", ""));
}

From source file:org.apache.struts.taglib.bean.TestMessageTag3.java

public void testMessageTag3ArgNamePropertySessionScopeAlternateBundle() {
    pageContext.setAttribute("key", new SimpleBeanForTesting("alternate.bundle.message.3"),
            PageContext.SESSION_SCOPE);
    runMyTest("testMessageTag3ArgNamePropertySessionScopeAlternateBundle", new Locale("", ""));
}

From source file:org.apache.struts.taglib.bean.TestMessageTag3_fr.java

public void testMessageTag3ArgNamePropertySessionScopeDefaultBundle_fr() {
    pageContext.setAttribute("key", new SimpleBeanForTesting("default.bundle.message.3"),
            PageContext.SESSION_SCOPE);
    runMyTest("testMessageTag3ArgNamePropertySessionScopeDefaultBundle", new Locale("fr", "fr"));
}

From source file:org.apache.struts.taglib.bean.TestMessageTag3_fr.java

public void testMessageTag3ArgNamePropertySessionScopeAlternateBundle_fr() {
    pageContext.setAttribute("key", new SimpleBeanForTesting("alternate.bundle.message.3"),
            PageContext.SESSION_SCOPE);
    runMyTest("testMessageTag3ArgNamePropertySessionScopeAlternateBundle", new Locale("fr", "fr"));
}

From source file:org.apache.struts.taglib.bean.TestMessageTag4.java

private void runMyTest(String whichTest, Locale locale) {
    pageContext.setAttribute(Globals.LOCALE_KEY, locale, PageContext.SESSION_SCOPE);
    request.setAttribute("runTest", whichTest);
    try {//  www .j  a  v  a  2  s.com
        pageContext.forward("/test/org/apache/struts/taglib/bean/TestMessageTag4.jsp");
    } catch (Exception e) {
        e.printStackTrace();
        fail("There is a problem that is preventing the tests to continue!");
    }
}

From source file:org.apache.struts.taglib.bean.TestMessageTag4.java

public void testMessageTag4ArgNamePropertySessionScopeDefaultBundle() {
    pageContext.setAttribute("key", new SimpleBeanForTesting("default.bundle.message.4"),
            PageContext.SESSION_SCOPE);
    runMyTest("testMessageTag4ArgNamePropertySessionScopeDefaultBundle", new Locale("", ""));
}

From source file:org.apache.struts.taglib.bean.TestMessageTag4.java

public void testMessageTag4ArgNamePropertySessionScopeAlternateBundle() {
    pageContext.setAttribute("key", new SimpleBeanForTesting("alternate.bundle.message.4"),
            PageContext.SESSION_SCOPE);
    runMyTest("testMessageTag4ArgNamePropertySessionScopeAlternateBundle", new Locale("", ""));
}

From source file:org.apache.struts.taglib.bean.TestMessageTag4_fr.java

public void testMessageTag4ArgNamePropertySessionScopeDefaultBundle_fr() {
    pageContext.setAttribute("key", new SimpleBeanForTesting("default.bundle.message.4"),
            PageContext.SESSION_SCOPE);
    runMyTest("testMessageTag4ArgNamePropertySessionScopeDefaultBundle", new Locale("fr", "fr"));
}

From source file:org.apache.struts.taglib.bean.TestMessageTag4_fr.java

public void testMessageTag4ArgNamePropertySessionScopeAlternateBundle_fr() {
    pageContext.setAttribute("key", new SimpleBeanForTesting("alternate.bundle.message.4"),
            PageContext.SESSION_SCOPE);
    runMyTest("testMessageTag4ArgNamePropertySessionScopeAlternateBundle", new Locale("fr", "fr"));
}