Regarding sessions in Jsp

Hi All,
I have developed one web application using JSP's, which is accessed by more than 500 employees at a time. today i noticed that some employees getting another employee data, who is also accessing at same time. i am not able understand what is reason behind this? while retrieving data from database, i am checking with employee code every where.
and one more thing, my JSP having three frames in a single page. sometimes one frame is refreshing and another frame is not refreshing.
is this situation related sessions or cookies or cache data....
i am using Tomcat 6 as my web server.
please suggest me, what are the precautions i need to take while releasing a application into the web.
regards
Visisht.

NareshParimi wrote:
I have developed one web application using JSP's, which is accessed by more than 500 employees at a time. today i noticed that some employees getting another employee data, who is also accessing at same time. i am not able understand what is reason behind this? while retrieving data from database, i am checking with employee code every where. The code is not thread safe. This can only be caused by poor written code logic without solid background knowledge. For example holding a request/session scoped reference as a servlet instance variable, or as a static variable or as an application scoped bean, etcetera.

Similar Messages

  • Session in JSP page

    Hi all,
    i built a web application now i want to use session in JSP pages to remember some variable such as password and entered date because i need them in later pages and i also don't want to send them via HTML hidden field. I actually don't know how to use session. Can anyone please just tell me how to create a session and store a variable and also how to retrieve the data from the session.
    Another thing is guys can anyone tell me please that say i am user and i selected some items from a HTML select list and i submitted that and logged off the system now when i login later again i want to see those choices selected by default , i know it might have been done by sessions can anyone please tell me.
    THANKS VERY MUCH

    This is the way u can set and retrieve values from session
    <% session.setAttribute("key","value"); %>
    <% String user=(String)session.getAttribute("user");
    %>
    regards
    Shanu

  • Want to get ApEx session in JSP

    Hi Pals,
    From my ApEx application, I am calling a JSP by providing a direct URL.
    THe JSP does some specific function here.
    If the user get the JSP url by right click and view source, they can very well use this outside my ApEx application.
    I want to apply security like, the JSP url only works inside my ApEx application.
    My thought, if I can share ApEx session with JSP session I can impose the security check in JSP level.
    Any idea would be appreciable.

    Hi,
    Im using below method to call jsp page and passing UserName, application id and Session as
    <iframe src="http://apex.oracle.com/pls/otn/...javaapplication.jsp?userId=&USER.&appId=&APP_ID.&sessId=&SESSION."></iframe>
    Vailidation is done against the table "wwv_flow_sessions$" of schema : flows_030100 ,whether those values are exist in table.
    But if user is already logged into apex application, he can run the jsp independantly taking the url from "view source".
    Im also looking for more solid validation
    Regards,
    Benz

  • How to Handle user Session in JSP

    Help me,
    How to handle user session in JSP.......

    Prakash_Pune wrote:
    tell me some Debugging tech. so i can overcome from my problem.....Do you use an IDE? Any IDE ships with a decent debugger where in you can just execute the code step by step, explore the current variable values and check what exactly is happening. For example Eclipse or IntelliJ. If you don´t use an IDE, then just place some System.out.println() or Logger.debug() statements at strategic locations printing the variables of relevance so that you can track in logs what exactly is happening.
    or tell any other way to find is my page is thread safe or not...Just write correct code and narrow the scope of the variables as much as possible. If you for example assigned the user object to a static variable or as a servlet´s instance variable, then exactly the same user object would be used everywhere in the application. That kind of logical things.

  • How to clear session in JSP?

    I searched yahoo, and found that it seemed not easy to force invalid the session using jsp, compared to php just three lines:
    session_start();
    session_unset();
    session_destroy();
    How to acheive this using JSP? Must I follow these (quite complex) steps like this one?
    http://sdc.sun.co.jp/javasystem/technote/cluster/jsp.html
    Any simplier method?
    Thx.

    Not at all, it's very simple.
    <%
    session.removeAttribute("attributeName");
    %>
    This HttpSession API document shows all methods that can be called on the session object : http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpSession.html

  • What is the use of session in jsp

    hai,
    what is the use of session in jsp. i cant understand from books. give some practical approach
    thanks

    give some practical approachYou sound like a supervisor ordering for a cup of coffee.
    I DONT TAKE ORDERS !!
    IMAO
    Which book did you refer ? Did you google ?

  • Making  a session in jsp.

    I want ti make a session in jsp.
    suppose if any budy can login through login page which is
    www.harshworld.info/login.jsp
    they will just direct open that page
    www.harshworld.info/wallpage.jsp
    then this page will not open . & user will see The login page it self.
    So after making session in jsp what can i do ?
    & how to Do can one help me.
    PL Thanks for Giving time to me

    THk dear
    there's always a session...
    if(session.getAttribute("username") == null) {
    response.sendRedirect("login.jsp");
    return;
    and put the attribute in the session on successful
    login..
    Or look up other security modes.

  • Handling Session in jsp and bean scope

    i have problems with handling session in jsp
    I want to check on all jsp pages
    first thing is session is null
    i want to him to be redirected to first page
    and he should not be able to go ahead
    I tried
    if(session ==null)
    response.sendRedirect("Login.jsp");
    but this does not seem to work
    It is very crtical problem can any one answer
    this asap
    Also i wanted to know that
    I have bean which in turn calls static methods of another class which holds all DomainTable(database tables which do not change frequently)
    Information .
    This is bean is being implemented by me
    in seession scope in a jsp
    Do u guys think it would be goo idea to change
    scop of this bean as Application in jsp
    if so what would be advantages for same
    I would appericate if i could a quick reply on both
    question
    as i am time crunch
    arsh

    You will always get some value of session and your code wont work. At the end of your Login.jsp, you should create a sesssion and store attributes. Check for these attributes in session, rather than checking session==null.

  • Maintain session in JSP frame

    Hi,
    I am having trouble in maintaining session in jsp frames. -
    Here is sample code
    parent.jsp
    <HTML>
    <HEAD>
    <LINK rel=stylesheet type="text/css" href="defaults.css">
    <TITLE>abc</TITLE>
    <%     
         String checkAmount = "100.00";
         session.setAttribute("checkAmount", checkAmount);
         System.out.println("checkAmount in ppmain"+session.getAttribute("checkAmount"));
    %>
    <FRAMESET rows="235,*" frameborder="no" >     
    <FRAME NAME="pptop" SRC="top.jsp" frameborder=0 scrolling=no noresize >
    <FRAME NAME="ppbottom" SRC="bottom.jsp" frameborder=0 scrolling=no marginwidth=0 marginheight=0 noresize>
    </FRAMESET>
    </HTML>
    top.jsp -
    <HTML>
    <HEAD>
    <LINK rel=stylesheet type="text/css" href="defaults.css">
    <TITLE>top</TITLE>
    <%     
    System.out.println("session in top "+session);
    System.out.println("checkAmount in top "+session.getAttribute("checkAmount"));
    %>
    </HTML>
    It is not able to retain session in the top.jsp ( in SOP for session I get different session ID in parent.jsp and top.jsp
    This Works well in local but when gets deployed to WAS6 server troubles starts.
    Any help is appreciated.
    Thanks

    When you create URLs, you might want to try using JSTL to rewrite them:
    <FRAME NAME="pptop"
           SRC="<c:url value='top.jsp'/>"
           frameborder=0
           scrolling=no
           noresize >
    <FRAME NAME="ppbottom"
           SRC="<c:url value='bottom.jsp'/>"
           frameborder=0
           scrolling=no
           marginwidth=0
           marginheight=0
           noresize>Or you can use:
    SRC='<%= response.encodeURL("top.jsp") %>'

  • Error in accessing pageContext or current session for JSP/servlet in frames

    I am creating a web application on iPlanet application server (ver 6.0 SP4) and display a page
    consists of frames in web browser (IE6). The framset and the content of each frames are
    JSPs or servlets. There where no problem to display each content frames individually at all.
    However, when the overall page (the frame set and the 3 frames) is displayed, the following
    problem occurs.
    Only the outermost frameset and just one or two of the frame contents displayed successfully
    in browser. Others have either 1 of the following errors:
    1. When accessing pageContext object in _jspService routine when displaying the JSP page, Null
    Pointer Exception occurs:
    java.lang.NullPointerException
    Exception Stack Trace:
    java.lang.NullPointerException
    at jsp.APPS.intl.acct_type_option._jspService(acct_type_option.java:653)
    2. When calling the req.getSession method in doGet() method for servlets, the following
    exception occurs:
    Exception in doGet(): This session has already been invalidated
    The occurance of error is random among all the frames. With the frame on top or left size
    having the most chance to be displayed successfully.
    It seems that the Application server cannot entertain 3 or 4 requests simultaneously (which
    happens when displayed a page consists of frames), having some of them throw an exception.
    Are they any tuning or setting for iPlanet server to overcome this problem?

    I'll give you the same advice as I have been given regarding the use of frames.
    Don't use them at all. Use scrollable DIV's instead.
    The use of frames is such that you would have different JSP's who cannot collaborate together since each is in his own frame and does not know about the others.
    In case I'm mistaken, I'd like to hear about it, but the combination of JSP's and frames is an unhappy one.

  • I want close one session in JSP

    I want destroy one session, but include the JavaBean with it.
    I tried whit session.invalidate();, but don't work.
    What can I do to all JavaBeans like this
    <jsp:useBean id="login" scope="session" class="jsptutorial.Login" />been destroyed.
    Best Regards.
    Owen.

    I want destroy one session, but include the JavaBean
    with it.
    I tried whit session.invalidate();, but don't work.
    What can I do to all JavaBeans like this
    <jsp:useBean id="login" scope="session"
    class="jsptutorial.Login" />been destroyed.
    Best Regards.
    Owen.I think what u mean by destroying session is to remove an already attached Object from it and add a new bean. If i am not wrong then u can use,
    session.removeAttribute("objectname");
    Hope it is use full,
    Bye

  • Maintaining the Flash file session in JsP

    Can anybody say how to mainatain the session in the flash to the jsp file.
    -- when the flash session is expired the corresponding jsp session should expire.
    -- when the user clicks the button in the flash file that communication should retrun into the Jsp page.
    please provide the solutions for in this regards will be appreciated.
    thanks,.

    Sateesh,got any solution?

  • Quires on Session in JSP

    Hi all,
    I had a quires in regards to storing information in the jsp page. I had store the user information in the vector and had add into the jsp page using the below code ( i store this in a jsp page called loginAcct.jsp)
    request.getSession().setAttribute("acctList", acct);
    However, when i tried to retrieve the information that i had store in the "'acctList" using the below comand i got nothing. ( I was trying to retrieve these information in another jsp page name listAcct.jsp)
    <%
    tempAcct = (Vector) request.getSession().getAttribute("acctList");
    Enumeration e = tempAcct.elements();
    while (e.hasMoreElements()) {
    AccountData acct = (AccountData) e.nextElement();
    %>
    <TR BGCOLOR="#<%=((count%2)==0)?"FFCCCC":"FFFFFF" %>">
    <TD><%= acct.getAccountId() %></TD>
    <TD><%= acct.getUserName() %></TD>
    </TR>
    <% } %>
    Can anyone point out what i had not done to make the printout appear on the web page????
    Many Thanks
    wilson

    The code looks good to me.
    I guess you should just make sure you are executing it!.
    Do you have session cookies enabled?
    Are you in the same web browser session?
    Are you accessing a jsp page within the same application?
    How do you get from one page to the other?
    Try calling this method:
    pageContext.getAttributeNamesInScope(pageContext.SESSION_SCOPE)
    It returns a list of all the attributes you have set in the session scope.
    Loop through it and print out all the names - see if your one is being set.
    Good luck,
    evnafets

  • Accessing Portal session in JSP

    Hi
    How can I access session parameters set via wwsto_api_session in jsp portlet.
    Regards,
    Vikas.

    Hi,
    If you want to access the procedures in wwsto_api_session package from a JSP, you can use JDBC calls.
    Otherwise, if you need the Httpsession specific information you can use the ProviderSession class in JPDK. You can obtain an instance of this using PortletRenderRequest object.
    thanks,
    Sriram

  • Global Session in JSP

    Hello,
    Is there a way, how to share data between all applications installed on the oc4j server? I need something like global JSP session.
    Another question. It's regarding the session Id. In OC4J version 902, if I am checking the session ID from the jsp pages from the different applications, the sessions IDs are the same. (Of course I am running it in the same IE). Actually the sessions are different, so if some attribute is set in one application, it's not visible in another one's session. But the session IDs are the same. I tried the same in version 903 of oc4j, the session ID is always different. Excuse me, is it bug or feature? Can I rely on having the same session ID in different applications?
    Thanks,
    Marek

    Dear,
    There is nothing called global JSP session, but instead it there is application scop, you can but in it you parameters or objects or beans ... etc
    and for the session ID,I think you can't have the same session ID in a different applications because the session ID came from some dealing with the time and IP and something like that
    Beast Regards
    Maher

Maybe you are looking for

  • SAP table for customer account balances by document currency

    Hi experts, We have a requirement to produce a monthly customer statement by customer currency or customer's document currency. Example is that the company code local currency is USD and the customer currency is EUR. The customer will be allowed to c

  • Urgent- Mapping R/3 Field to BW

    Hello, I have following fields added to R/3 datasource. This extractor is used to get SD data from R/3. Can you please help me identify InfoObject name so that I can do the mapping in BW. Name of Data source is: GDS_ZZIIV29_TRAN DB view table is: ZZI

  • Audio Levels Are Different within program

    For some reason when I am editing a multi-track project I seem to get three different levels as I go along.  When I am editing a single file the levels come out as one thing.  When I get the levels good, usually around -4 or so I play them back on th

  • How to get sql query data and write into csv file?

    I am writing to seek help, in how can I create bat. script which can execute the following logic: connection to the database run sql query create CSV file output query data, into CSV file save the CSV file osql -S 84.18.111.111 -U adw -P rem -i "c:\q

  • Consolidation PTD/YTD

    On Consolidation Transfer Window you have the option to choose Amount Types (PTD/YTD) What I understood from this is you can consolidate either PTD or YTD balances (beside other types). I can see how PTD consolidation would work. PTD balances would b