Regarding Session Scope

Hi
I am using jdev 11.1.2.1.0
I am setting session variable on my login page by using
ADFContext.getCurrent().getSessionScope().put("u_name", rs.getString("empname"));
And using in template title by using #{sessionScope.u_name}
After login on first page it is displaying correctly but when i navigate to other page by using command link or image command link it is not displaying the value .
Please Solve this problem
Thanks

Does a getId() on the forwarded page and the page forwarded from return the same value?

Similar Messages

  • TopLink Essentials: Using spring session scope on the EntityManagerFactory

    Hi,
    In one of our projects we are trying to utilize the 2nd level cache of TopLink Essentials. The server code is using the Spring (2.0.7) and is deployed to a web container. We are using a Java client and serializes every object between the client and the server.
    When a client is started a lot of "static/common" data is read from the server. The first client started will therefor pay some extra performance cost, but additional clients should hopefully be able to perform better due to the cache. Most of the static data is accessed not using JPQL and should therefor not bypass the cache.
    If we configure the EntityManagerFactory using default Spring scoping (singleton) it seems like we are not able to utilize the cache. We can see from the log files that each time a client is started a lot of SQL is executed towards the database (Oracle).
      <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
        <property name="dataSource" ref="dataSource" />
        <property name="jpaVendorAdapter">
          <bean class="org.springframework.orm.jpa.vendor.TopLinkJpaVendorAdapter">
            <property name="showSql" value="false" />
            <property name="generateDdl" value="$repository{toplink.generateDdl}" />
            <property name="database" value="$repository{toplink.database}" />
          </bean>
        </property>
        <property name="jpaProperties">
          <props>
            <prop key="toplink.weaving">static</prop>
            <prop key="toplink.logging.level">FINEST</prop>
          </props>
        </property>
      </bean>When we changes the scoping to spring session the behavior is very different. Then we can see that the first client generates a lot of SQL towards the database and pays a startup cost, while subsequently clients seems to be able to utilize the cache.
      <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" scope="session">
        <aop:scoped-proxy />
        <property name="dataSource" ref="dataSource" />
        <property name="jpaVendorAdapter">
          <bean class="org.springframework.orm.jpa.vendor.TopLinkJpaVendorAdapter">
            <property name="showSql" value="false" />
            <property name="generateDdl" value="$repository{toplink.generateDdl}" />
            <property name="database" value="$repository{toplink.database}" />
          </bean>
        </property>
        <property name="jpaProperties">
          <props>
            <prop key="toplink.weaving">static</prop>
            <prop key="toplink.logging.level">FINEST</prop>
          </props>
        </property>
      </bean>Having read the documentation of the spring session scope I'm having a hard time explaining this behavior. As I understand it the EntityManagerFactory will be stored in the HTTP session resulting in a new EntityManagerFactory for each session. I cannot understand how this may result in that we are able to utilize the 2nd level cache? What are the relationship between the EntityManagerFactory and the 2nd level cache?
    Is this an accepted way of configuring the EntityManagerFactory or will there be a downside?
    I hope someone are able to explain this behavior for me:-)
    Best regards,
    Rune

    Hi Rune,
    To understand the shared cache behavior you actually need to understand more about what TopLink Essentials does than what Spring does. When a new factory is created, TopLink Essentials actually just proxies the server session with a factory instance, so the same server session is used. This is why you are seeing the same cache used across multiple factories of the same session.
    In the first case, if you are not using JPQL then what are you using to load the data and why are you thinking that it will not bypass the cache?
    Using a factory instance for each session is not what I would recommend doing as there are some additional costs associated with establishing a factory (even though the session already exists). The first way should be the correct way, I am just not sure what the circumstances are that are causing your cache to not be warmed. You may want to post more details about that so people can better help you out with that angle.
    -Mike

  • Synchronizing session-scope objects?

              Hi,
              I have this problem, using Weblogic 5.1 SP8:
              In a JSP-file I use a java-object with the useBean-directive and
              session-scope.
              The problem occur when a user (for some strange reason) decides
              to double-click in his browser on a link pointing to this
              JSP-page.
              This makes the weblogic server start two separate request-threads to the same page
              in the same session. This will sometimes screw up tha data that the java-object holds
              since both threads at the same time uses the same object.
              The only solution that I have found is to put synchronized blocks in the JSP-file
              either synchronizing the java-object or the session-object.
              Does anyone have any similar problems or perhaps any opinions?
              regards/
              H Waller
              

              The problem we discussed (and fixed)was specifically in
              WLCS 3.2.
              If you are not using WLCS, you will not experience THAT problem.
              If you are using member servlet, member JSP variables or static
              variables, you will see a similar problem - don't.
              If it is data in the httpSession - you have to rethink your
              design.
              Mike
              "Ashutosh Khandelwal" <[email protected]> wrote:
              >
              >Hello Ture and Mike,
              >
              >I have been experiencing problems when a user decides to double-click
              >in the browser
              >pointing to a servlet. This makes the weblogic server start two seperate
              >request-thread
              >to the same page in the same session. This always screws up the data.
              >I am using
              >WLS 5.1 with SP8.
              >
              >According to your previous emails, this was only a problem with WLCS3.2,
              >which
              >uses PipelineSession. You have also indicated that this should not be
              >happening
              >with WLS 5.1 or 6.0 with SP8 or above.
              >
              >Well, I continue to have this problem with WLS5.1. Do you have any suggestions/opinion,
              >etc.
              >
              >regards,
              >
              >Ashu
              >
              >
              >
              >"Mike Reiche" <[email protected]> wrote:
              >>
              >>Thanks for the fast turn-around.
              >>
              >>- Mike
              >>
              >>Ture Hoefner <[email protected]> wrote:
              >>>Hello Mike,
              >>> As you know, a WLCS 3.2 (Commerce Server)
              >>>patch now exists for this problem. I thought
              >>>that I should post the details here to clear
              >>>up any confusion in the WebLogic user
              >>>community.
              >>> The problem that Mike experienced was that
              >>>the WLCS PipelineSession was keeping all
              >>>request-scoped attributes in a single bucket,
              >>>so concurrent requests from a single session
              >>>were experiencing naming collisions. Also,
              >>>one pipeline would empty the bucket when
              >>>finished, but other concurrent piplines may
              >>>have been using the bucket. This was not a
              >>>problem with WLS. It was a limitation of the
              >>>design of WLCS 3.2 PipelineSession, which is
              >>>not used in WLS 5.1 or 6.0.
              >>> Our engineering team has quickly responded:
              >>> they have designed and implemented a
              >>>PipelineSessionExtended that uses multiple buckets.
              >>> Each bucket is associated with a
              >>>request using a unique requestId.
              >>> A patch and details of the design fix and
              >>>use of the patch are available from support.
              >>>Please reference CR043462 when requesting the
              >>>patch.
              >>>
              >>>Mike Reiche wrote:
              >>>
              >>>> I don't mind that the HttpSession is shared,
              >>>my problem
              >>>> is that the PipelineSession is shared - because
              >>>that
              >>>> breaks <pipeline:getProperty > tags. When
              >>>I save a Pipeline
              >>>> propert as REQUEST_SCOPE, that's exactly what
              >>>I expect. But
              >>>> apparently, it's scope is beyond a request.
              >>>>
              >>>> What about a PageContext? That's not shared
              >>>between requests,
              >>>> is it? Maybe that's where REQUEST_SCOPE variables
              >>>should be
              >>>> stored.
              >>>>
              >>>> Mike
              >>>>
              >>>> Robert Patrick <[email protected]>
              >>>wrote:
              >>>> >Hmm...
              >>>> >
              >>>> >I always thought that it was browser specific
              >>>whether
              >>>> >the multiple browser windows
              >>>> >shared or did not share the same session
              >>>(and the Netscape
              >>>> >and IE do exactly the
              >>>> >opposite thing here). Regardless of the
              >>>multiple window
              >>>> >scenario, this can and will
              >>>> >happen if you have multiple frames in the
              >>>same window
              >>>> >making requests concurrently (or
              >>>> >possibly if you double-click on a link causing
              >>>the browser
              >>>> >to generate two requests to
              >>>> >WebLogic).
              >>>> >
              >>>> >Anyway, the crux of the matter is that your
              >>>servlets/JSPs
              >>>> >must be prepared to deal with
              >>>> >multiple requests from the same user accessing
              >>>the same
              >>>> >session. The servlet/JSP spec
              >>>> >doesn't, to my knowledge, address this issue.
              >>> You will
              >>>> >probably need to add
              >>>> >synchronization code somewhere, I would just
              >>>make sure
              >>>> >that you are synchronizing on an
              >>>> >object that is only used by one user (e.g.,
              >>>session) and
              >>>> >keep the synchronization
              >>>> >blocks as short as possible...
              >>>> >
              >>>> >Hope this helps,
              >>>> >Robert
              >>>> >
              >>>> >Michael Reiche wrote:
              >>>> >
              >>>> >> BEA says that's just your imagination....
              >>>> >>
              >>>> >> FR: nelson
              >>>> >>
              >>>> >> CASE_ID_NUM: 222714
              >>>> >> MESSAGE:
              >>>> >> Hi Michael,
              >>>> >>
              >>>> >> The Commerce Server is nothing more then
              >>>an application
              >>>> >riding
              >>>> >> on top of WebLogic Server.
              >>>> >> The HTTPSession is still being managed
              >>>by the WebLogic
              >>>> >Server,
              >>>> >> and not the Commerce Server.
              >>>> >> As I mentioned on my previous email, prior
              >>>to and including
              >>>> >SP6
              >>>> >> for WLS 5.1, the spawning of a child browser
              >>>window,
              >>>> >does create
              >>>> >> a shared HTTPSession, thus creating a shared
              >>>PipelineSession.
              >>>> >>
              >>>> >> If you have indeed upgraded to SP8 for
              >>>WLS 5.1, then
              >>>> >this should
              >>>> >> not be happening.
              >>>> >> Can you tell us exactly how you are spawning
              >>>the new
              >>>> >browser window,
              >>>> >> such that both requests are being sent
              >>>almost concurrently.
              >>>> >> Also, can you send us a copy of your "weblogic.log"
              >>>> >file from the
              >>>> >> Commerce Server as an attachment. If it
              >>>is large, please
              >>>> >zip it.
              >>>> >>
              >>>> >> Regards,
              >>>> >> Nelson Paiva
              >>>> >> WLCS DRE
              >>>> >>
              >>>> >> **********
              >>>> >> If you are replying to this email, please
              >>>DO NOT modify
              >>>> >the subject
              >>>> >> of
              >>>> >> this email in order to ensure that your
              >>>reply is processed
              >>>> >automatically.
              >>>> >>
              >>>> >> You can now "AskBEA" Customer Support questions
              >>>on the
              >>>> >web and
              >>>> >> get
              >>>> >> immediate responses. "AskBEA" is available
              >>>on http://www.bea.com/support/index.html
              >>>> >> **********
              >>>> >>
              >>>> >> "H Waller" <[email protected]>
              >>>wrote:
              >>>> >> >
              >>>> >> >Hi,
              >>>> >> >
              >>>> >> >I have this problem, using Weblogic 5.1
              >>>SP8:
              >>>> >> >
              >>>> >> >In a JSP-file I use a java-object with
              >>>the useBean-directive
              >>>> >> >and
              >>>> >> >session-scope.
              >>>> >> >The problem occur when a user (for some
              >>>strange reason)
              >>>> >> >decides
              >>>> >> >to double-click in his browser on a link
              >>>pointing to
              >>>> >this
              >>>> >> >
              >>>> >> >JSP-page.
              >>>> >> >This makes the weblogic server start two
              >>>separate request-threads
              >>>> >> >to the same page
              >>>> >> >in the same session. This will sometimes
              >>>screw up tha
              >>>> >> >data that the java-object holds
              >>>> >> >since both threads at the same time uses
              >>>the same object.
              >>>> >> >
              >>>> >> >The only solution that I have found is
              >>>to put synchronized
              >>>> >> >blocks in the JSP-file
              >>>> >> >either synchronizing the java-object or
              >>>the session-object.
              >>>> >> >
              >>>> >> >Does anyone have any similar problems
              >>>or perhaps any
              >>>> >opinions?
              >>>> >> >
              >>>> >> >regards/
              >>>> >> >H Waller
              >>>> >
              >>>
              >>>--
              >>>Ture Hoefner
              >>>BEA Systems, Inc.
              >>>2590 Pearl St.
              >>>Suite 110
              >>>Boulder, CO 80302
              >>>www.bea.com
              >>>
              >>>
              >>
              >
              

  • How to convert processScope to Session Scope.

    Hi,
    Could you please tell me any one, how to convert processScope to Session Scopde.
    because i need to pass 1 processScope value to Servlet. but servlets don't know ProcessScope value. for this i need to convert processScope value into Session scope value.
    Thanks and Regards,
    M. Ramu.

    Hi,
    Could you please tell me, what are the main configurations i need to done about this issue.
    The main requirement is, from Jspx page i need to pass one value to Servlet through xml file.
    as of now i am using processScope in Jspx page, but i passing through xml page to Servlet. As servlet cannot understand processscope, it is throwing null pointer exception.
    Thanks and Regards,
    M. Ramu.

  • How to remove session scope?

    Hi,
    I instantiated a bean using the JSP useBean tag and set its session scope to session. I want to at one point be able to remove the bean from session, how can I do this?
    regards
    Siliconbt

    you make the bean object null then u can remove the session.
    the above answer given in my view
    if any pls forward to me

  • How to get a parameter from each request in a session scope BackingBean

    While calling my JSF page, I pass an id as parameter in the URL, and in the Backing bean I retrieve it from the request.
    On each request I need to get the id and populate the page accordingly.
    But I am forced to create my Backing Bean in session scope b'cos otherwise ValueChangeListener method does not work properly.
    So where and how do I get the id on each request?
    Pls. help

    What you can do is create it in the request scope like this:
    <managed-bean>
          <managed-bean-name>personBean</managed-bean-name>
          <managed-bean-class>
            com.PersonBean
          </managed-bean-class>
          <managed-bean-scope>request</managed-bean-scope>
           <managed-property>
                 <property-name>id</property-name>
                 <property-class>java.lang.Long</property-class>
              <value>#{param.id}</value>
          </managed-property>
    </managed-bean>And then in the page use a hidden field to set the id in case of a postback (validation error):
    <h:inputHidden id="id" value="#{personBean.id}"/>Does that help you?
    Thomas

  • Session scope managed bean is not instantiating?

    We have the need to use a session bean (rather than pageFlowScope) in our application.  But it looks like the session beans are not being instantiated at run time like other beans are.  I created a simple test case to verify.  One bean, named "MySessionBean", defined in the task flow as Session scope, then referenced in a view with an input text box, value:  #{sessionScope.MySessionBean.value1}. When I run the application,  I just get PropertyNotFoundException, Target Unreachable, 'MySessionBean' returned null.
    If I simply change the bean to use pageFlowScope, everything works fine.   I have debug code in the bean constructor, and it never gets called.   Is there some other step I am missing to have ADF instantiate the session bean?

    No luck, I tried it in both adfc-config.xml, and faces-config.xml.  I also tried moving the call to my view, from my bounded taskflow, into the adfc-config unbounded task flow, and then I ran that instead.  Still got the same error.    Here is my code from the the last round of tests with the view called in the main adfc-config.xml unbounded taskflow:
    adfc-config.xml:
    <?xml version="1.0" encoding="windows-1252" ?>
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
          <view id="testView">
                <page>/testView.jspx</page>
          </view>
          <managed-bean id="__2">
          <managed-bean-name id="__5">MySessionBean</managed-bean-name>
          <managed-bean-class id="__4">test.MySessionBean</managed-bean-class>
          <managed-bean-scope id="__3">session</managed-bean-scope>
        </managed-bean>
    </adfc-config>
    testView.jspx:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <jsp:directive.page contentType="text/html;charset=UTF-8"/>
      <f:view>
        <af:document id="d1">
          <af:form id="f1">
            <af:inputText label="Label 1" id="it1"
                          value="#{sessionScope.MySessionBean.value1}"/>
          </af:form>
        </af:document>
      </f:view>
    </jsp:root>
    MySessionBean.java:
    package test;
    public class MySessionBean {
        private String value1="Hello World";
        public MySessionBean() {
            super();
        public void setValue1(String value1) {
            this.value1 = value1;
        public String getValue1() {
            return value1;

  • Problem with beans in session scope

    Hello,
    I developped a website using JSP/Tomcat and I can't figure out how to fix this problem.
    I am using beans in session scope to know when a user is actualy logged in or not and to make some basic informations about him avaible to the pages. I then add those beans to an application scope bean that manages the users, letting me know how many are logged in, etc... I store the user beans in a Vector list.
    The problem is that the session beans never seem to be destroyed. I made a logout page which use <jsp:remove/> but all it does is to remove the bean from the scope and not actualy destroying it. I have to notify the application bean that the session is terminated so I manualy remove it from its vector list.
    But when a user just leave the site without using the logout option, it becomes a problem. Is there a way to actualy tell when a session bean is being destroyed ? I tried to check with my application bean if there are null beans in the list but it never happens, the user bean always stays in memory.
    Is there actualy a way for me to notify the application bean when the user quits the website without using the logout link ? Or is the whole design flawed ?
    Thanks in advance.
    Nicolas Jaccard

    I understand I could create a listener even with my current setup Correct, you configure listeners in web.xml and they are applicable to a whole web application irrespective of whether you use jsp or servlets or both. SessionListeners would fire when a session was created or when a session is about to be dropped.
    but I do not know how I could get a reference of the application bean in >question. Any hint ?From your earlier post, I understand that you add a UserBean to a session and then the UserBean to a vector stoed in application scope.
    Something like below,
    UserBean user = new UserBean();
    //set  bean in session scope.
    session.setAttribute("user", user);
    //add bean to a Vector stored in application scope.
    Vector v = (Vector)(getServletContext().getAttribute("userList"));
    v.add(user);If you have done it in the above fashion, you realize, dont you, that its the same object that's added to both the session and to the vector stored in application scope.
    So in your sessionDestroyed() method of your HttpSessionListener implementation,
    void sessionDestroyed(HttpSessionEvent event){
         //get a handle to the session
         HttpSession session = event.getSession();
          //get a handle to the user object
          UserBean user = (UserBean)session.getAttribute("user");
           //get a handle to the application object
          ServletContext ctx = session.getServletContext();
           //get a handle to the Vector storing the user objs in application scope
            Vector v = (Vector)ctx.getAttribute("userList");
           //now remove the object from the Vector passing in the reference to the object retrieved from the Session.
            v.removeElement(user);
    }That's it.
    Another approach would be to remove the User based on a unique identifier. Let's assume each User has a unique id (If your User has no such feature, you could still add one and set the user id to the session id that the user is associated with)
    void sessionDestroyed(HttpSessionEvent event){
         //get a handle to the session
         HttpSession session = event.getSession();
          //get a handle to the user object
          UserBean user = (UserBean)session.getAttribute("user");
           //get the unique id of the user object
           String id = user.getId();
           //get a handle to the application object
          ServletContext ctx = session.getServletContext();
           //get a handle to the Vector storing the user objs in application scope
            Vector v = (Vector)ctx.getAttribute("userList");
           //now iterate all user objects in the Vector
           for(Iterator itr = v.iterator(); itr.hasNext()) {
                   User user = (User)itr.next();               
                    if(user.getId().equals(id)) {
                           //if user's id is same as id of user retrieved from session
                           //remove the object
                           itr.remove();
    }Hope that helps,
    ram.

  • Session scope and request scope

    Hi,
    I've a manage bean in session scope and within this bean I've a reference of another
    object (class person) . My question is, do i have to register this class in my faces-config-xml and if yes which scope should it have? session or request?
    Or it isn't necessary to register it?
    thanks
    class MymanageBean{
    private Person myPerson;
    }

    helllo,
    can someone tell me what the line in the preceding coed means?
    <meta http-equiv="refresh" content="<%= session.getMaxInactiveInterval() %>;url=login.jsp">
    -- session_expiry_test.jsp --
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
            <meta http-equiv="refresh" content="<%= session.getMaxInactiveInterval() %>;url=dummy_login.jsp">
        </head>
        <body>
        <h1>Welcome, dude with a session!</h1>
        Your session will expire in <%= session.getMaxInactiveInterval() %> seconds
        at which time your browser will be redirected to the login page and any
        and all unsaved changes will be lost.
        <br>
        Thank you for your cooperation!
        </body>
    </html>

  • How to use Session scope in jsp page

    Hello, I have login form, where user provides username and password. Then click on submit, it will forward to validation.jsp. Where it will check in database make sure username and password exit. Now i can also retrive accountid of perticular user. I want to put that username and accountid in session scope. so all other pages can use that username and accountid. How can i do that. I'm new at this, so please provide me example too. Here is my code for login.jsp and validation.jsp..
    Validation.jsp
    <%@ page import="java.util.*" %>
    <%@ page import="java.sql.*" %>
    //String name = request.getParameter( "username" );//
    //session.setAttribute( "accountID",accountID );//
    <%
    String connURL = "jdbc:oracle:thin:@orca.csc.ncsu.edu:1521:ORCL";
         Connection conn = null;
         Statement stmt = null;
         ResultSet rs = null;
    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
    conn = DriverManager.getConnection(connURL, "vapatel","pjdas");
    stmt = conn.createStatement();
    String user=request.getParameter("userName");
    String password=request.getParameter("password");
    boolean entrance=false;
    stmt.excuteQuery("SELECT AccountID From Password WHERE USERNAME='"+user+"'");
    rs = stmt.executeQuery("SELECT * FROM Password WHERE USERNAME='"+user+"' AND PASSWORD='"+password+"'");
    while(rs.next()){
    String dbUser = rs.getString("USERNAME");
    String dbPassword= rs.getString("PASSWORD");
    if ((user.equals(dbUser)) && (password.equals(dbPassword))){
    entrance=true;
    if (entrance==true){%>
    <jsp:forward page="form.jsp"/>
    <%}
    else{%>
    <jsp:forward page="login.jsp"/>
    <%}
    %>

    hi,
    to put something into session scope in a jsp page use:
    session.setAttribute("counter", Integer.toString(5));to retrieve is from a jsp page use:
    String counterAttribute = (String)session.getAttribute("counter");

  • Cant able to get the output while using session scope

    Hi
    I am using jdeveloper 11.1.1.5
    As i posted in the previous post i had made some changes still i am not getting proper output
    These are steps that i had followed for developing login page
    1.I had created a TaskFlow in adfc-config.xml such that if the login is success it navigates to the other page pls verfiy the link
    http://www.4shared.com/photo/5PNrf1hd/E028_2.html
    2.I had also changed the scope to session in adfc-config.xml
    http://www.4shared.com/photo/HtVVOw_B/E029.html
    3.This was my Welcome.jspx code
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <jsp:directive.page contentType="text/html;charset=UTF-8"/>
      <f:view>
        <af:document id="d1" binding="#{sessionScope.backing_welcome.d1}">
          <af:form id="f1" binding="#{sessionScope.backing_welcome.f1}">
            <af:inputText label="UserName" binding="#{backing_welcome.it1}"
                          id="it1" value="#{sessionScope.backing_welcome.auser}"/>
            <af:inputText label="Password" binding="#{backing_welcome.it2}"
                          id="it2"
                          value="#{sessionScope.backing_welcome.apassword}"/>
            <af:commandButton text="Login"
                              binding="#{backing_welcome.cb1}" id="cb1"
                              action="#{backing_welcome.cb9_action}"/>
          </af:form>
        </af:document>
      </f:view>
      <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_welcome-->
    </jsp:root>3.This was my welcome.java backing bean for welcome.jspx page
        public String getAuser() {
            return auser;
        public void setApassword(String apassword) {
            this.apassword = apassword;
        public String getApassword() {
            return apassword;
        public String cb9_action() {
            String returnStr="error";
            System.out.println("Inside loginBtn_action");
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding = bindings.getOperationBinding("checkLoginCredentials1");
            operationBinding.getParamsMap().put("p_user", auser);
            operationBinding.getParamsMap().put("p_pwd", apassword);
        operationBinding.execute();
        Object result = operationBinding.execute();
        if (!operationBinding.getErrors().isEmpty()) {
            returnStr= "success";
        System.out.println("returnStr= " + returnStr);
               return returnStr;
        }While i run my program no output is displayed!! No logs also been recorded!!
    Could any body pls help me!!

    thank you jhon!
    If i am not using any binding i m getting error as
    javax.el.PropertyNotFoundException: Target Unreachable, 'backing_welcome' returned nullI had used this jspx code
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <jsp:directive.page contentType="text/html;charset=UTF-8"/>
      <f:view>
        <af:document id="d1" >
          <af:form id="f1" >
            <af:inputText label="UserName"
                          id="it1" value="#{sessionScope.backing_welcome.auser}"/>
            <af:inputText label="Password"
                          id="it2"
                          value="#{sessionScope.backing_welcome.apassword}"/>
            <af:commandButton text="Login"
                               id="cb1"
                              action="#{sessionScope.backing_welcome.cb9_action}"/>
          </af:form>
        </af:document>
      </f:view>
      <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_welcome-->
    </jsp:root>Give me some guide how to use session scope!! Since i read all the documents i m not getting any proper output

  • Question about navigation in session scope

    Hi.
    I dont know how to resolve a problem or how to focus this stuff.
    I'll try to explain myself.
    Let say I have a page (a.jsf) with several links, all this links navigates to the same page (b.jsf) which shows the results.
    For each link in a.jsf I have attached a bean with a logic, so If I click in link 1 I go to the b.jsf showing data read from the database.table1. If I clik in link2 I go to b.jsf showing data read from database.table2, and so on...
    The beans are in session scope (and must be).
    The first time works ok because I initialize the bean in b.jsf, read data and I show using a selecManyListBox to show it, but if I go back and select another link it goes to b.jsf, but it shows the old data, the data read the first time, because it never calls again the init method.
    Somebody has talked about using an additional bean to control this but once the bean in b.jsf is created I don't know how to call again the init method in beanB (b.jsf)..
    I have attached a very simple project to deploy in eclipse 3.3 and tomcat 6.0. In this example instead of read from database I read from an structure created in memory to simulate this.
    Somebody could take a look and comment something about it.
    http://rapidshare.com/files/197755305/_session-forms.war
    Thanks

    Hi.
    I understand is the same doing in the action method in a button or a commnad, the project is just an example, my real app is a tree, so is not a question about a button or a command, is about the logic being in session scope. I don't know how to face it.
    thanks

  • Tables and session scope

    Im using session scope for my managed beans but Im looking for a way to use request scope instead. The bean constructors loads some tables from a remote system. I dont want to reload the tables on postback which is why I put the beans on session scope. How can I put the beans on request scope and have the tables survive a postback?
    Alternatively is there any way to remove the beans individually from session scope once the "conversation" is over? Im using jsf 1.2. Btw im building hundres of pages so any solution that requires lots of custom code per page is a no go.

    user12117002 wrote:
    Im using session scope for my managed beans but Im looking for a way to use request scope instead. The bean constructors loads some tables from a remote system. I dont want to reload the tables on postback which is why I put the beans on session scope. How can I put the beans on request scope and have the tables survive a postback? Use two beans; one request scoped, one view/session scoped. Inject the session scoped one into your request scoped one to have easy access to its data.

  • Session-scope variable for JSP page used in a frame

    Hi,
    I don't know if there's a way to do this at the same time:
    (1)- assign session scope to a variable (in order to be able to retrieve recurrently the previous value each time the JSP is called);
    (2)- set its visibility in a way that it could be accessed only by the page that defines it. The JSP is used in a frameset along with an other JSP that can potentially define identical session-scoped variable (You understand why I want to keep them separate)
    session.setAttribute():
    seems not to be the thing I need
    pageContext.setAttribute():
    with SESSION_SCOPE, it behaves the same way as session.setAttribute(). with PAGE_SCOPE, condition (1) can't be satisfied.
    Does anybody have an idea ?
    Thanx in advance.

    I can see that you will not want to maintain two different files for every possible page on the site!
    It may be possible to do something like <frameset rows="*" cols="50%,*">
      <frame name="content1" src="file.jsp?frame=one" >
      <frame name="content2" src="file.jsp?frame=two" >
    </frameset>and then in the jsp<%
    String frame=request.getParameter("frame");
    session.setAttribute(frame+"AttributeName",attributeValue);
    %>This will set up two session attributes - "oneAttributeName" and "twoAttributeName". Depending on how many variables you have, this may prove just as difficult to maintain.
    You may end up having to simply pass url parameters between pages to maintain state within the individual frames, which is far from elegant also.
    I am interested in how you end up solving this one.

  • How to setup session scope in servlet?

    bean tag can be used in jsp to setup its scop, like
    <jsp:usebean id="abc" class="def" scope="session"/>
    but is it possible to setup session scope to divide two users in order not to use the same bean? becuase i encounter a problem that, when using bean in servlet, seemly A user would access the data that B user just store in; at first, i try to compare if session == null or session.isNew(), but finally find out that their session.getId() is difference, thus i suppose that if i am able to decide via users' session id to limit their access to the bean just as jsp:usebean does!
    is that right? or in what way is better?(i am now to rewrite my original code, it's a little bit complicate for some reasons, so i think, if possible, that via compare session id, that i do not know how, would be a better way!)
    thanks in advice,

    If each user has a separate session, then each one
    should get their own instance of the bean. Is it
    possible that that you store and retrieve a reference
    to the bean in a servlet instance variable? That
    would cause the problem you describe.do you mean by putting variable in situation like A) ; yes i did, but if i put bean in the body of doPost method, each time when bean are "new"ed, there may be error occurred, accounting for i hope to instantize with default value, but default constructor do nothing; thus if by only construct with default constructor, error would occurred and so a new constructor with parameters i put in the position you refferred to! would you like to tell me what's the right way for i am not so familiar with servlet.
    thanks in advice,
    A)
    public class MyClassName extends HttpServlet {
    BeanClass myBean = new BeanClass();
    ... doGet(...){}
    ... doPost(...){...}

Maybe you are looking for

  • Header and Footer in Table

    Hi, Invoice Smartforms: I create main window with an table with header and footer. In this table they are a loop to the different billing item. When they are lot of billing item, the table continue in the next page. The Header of the table is display

  • Question about setting up external HD?

    I have a 2TB OWC external HD, I use it as my main iTunes Library. It is getting pretty full. If I get a second 2TB external HD, is there a way to setup the 2x2TB as one big 4TB using OSX? I would like to keep my iTunes Lib on one volume if possible.

  • Creating a JButton for each line in a txt file

    I need to know how to creating a JButton for each line in a txt file then add an actionListener to the number of buttons (note they are in a JTable). Here is a clipet of code thanx for the help (note that this is one part of a program i am making the

  • Flash Player 10:  Adobe Misses the Mark

    When I heard about the Flash Player 10 launch, I was initially excited: there was some buzz about GPU optimization. However, when I saw the new product demo, I was very disappointed. Yes, there is GPU compositing, (useful for video and alpha channel

  • Indesign CS2 mit InCopy CS2 stürzt immer wieder ab.

    Hallo, arbeite seit ca. 2 Monaten im Indesign CS2 und InCopy CS2, immer öfter passiert mir, dass ich Texte vom In Copy trenne und so wie ich dann das Indesign Dokument speichere stürzt das Programm ab und das Dokument lässt sich nicht mehr öffnen. Ha