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.TestMessageTag1.java

private void runMyTest(String whichTest, Locale locale) {
    pageContext.setAttribute(Globals.LOCALE_KEY, locale, PageContext.SESSION_SCOPE);
    request.setAttribute("runTest", whichTest);
    try {//from   ww w . j  a  v  a  2  s.co m
        pageContext.forward("/test/org/apache/struts/taglib/bean/TestMessageTag1.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.TestMessageTag1.java

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

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

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

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

public void testMessageTag1ArgNamePropertySessionScopeDefaultBundle_fr() {
    pageContext.setAttribute("key", new SimpleBeanForTesting("default.bundle.message.1"),
            PageContext.SESSION_SCOPE);
    runMyTest("testMessageTag1ArgNamePropertySessionScopeDefaultBundle", new Locale("fr", "fr"));
}

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

public void testMessageTag1ArgNamePropertySessionScopeAlternateBundle_fr() {
    pageContext.setAttribute("key", new SimpleBeanForTesting("alternate.bundle.message.1"),
            PageContext.SESSION_SCOPE);
    runMyTest("testMessageTag1ArgNamePropertySessionScopeAlternateBundle", new Locale("fr", "fr"));
}

From source file:org.apache.struts.taglib.bean.TestMessageTag2.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  a2 s .c  o m*/
        pageContext.forward("/test/org/apache/struts/taglib/bean/TestMessageTag2.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.TestMessageTag2.java

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

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

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

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

public void testMessageTag2ArgNamePropertySessionScopeDefaultBundle_fr() {
    pageContext.setAttribute("key", new SimpleBeanForTesting("default.bundle.message.2"),
            PageContext.SESSION_SCOPE);
    runMyTest("testMessageTag2ArgNamePropertySessionScopeDefaultBundle", new Locale("fr", "fr"));
}

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

public void testMessageTag2ArgNamePropertySessionScopeAlternateBundle_fr() {
    pageContext.setAttribute("key", new SimpleBeanForTesting("alternate.bundle.message.2"),
            PageContext.SESSION_SCOPE);
    runMyTest("testMessageTag2ArgNamePropertySessionScopeAlternateBundle", new Locale("fr", "fr"));
}