Session tracking help please

Hi everyone !
I had an application working under Websphere 3.5.4 and JDK 1.2.2.
This application used many session variables.
I have stopped working on it, and now that I want to use again, I get this stupid usual :
Unhandled error! You might want to consider having an error page to report such errors more gracefully
com.sun.jsp.JspException: Compilation failed
at javax.servlet.ServletException.(ServletException.java:49)
at com.sun.jsp.JspException.(JspException.java:29)
I try with a very very simple file :
<%@ page contentType="text/html"%>
<%@ page session="true"%>
<%
String name = request.getParameter( "nom" );
session.setAttribute( "theName", name );
%>
<HTML>
<HEAD>
<TITLE>Petit message</TITLE>
</HEAD>
<BODY>
Lien
</BODY>
</HTML>
The compilation always fails on the line with access to the session.
I have tried other access to the session object, but it semms that I cannot reach it any longer !
Can anyone help me, please ?
I really don't catch what the problem is !
vsa

I believe that you have to call request.getSession(true) to get the session variable. The request and response objects are available to the page without doing anything, but not the session object.
BTW, use request.getSession(true) to always get a session (create if there isn't one), or user request.getSession() if you don't want to create one if it isn't new, but you'll need to check for a null session.
Paul
Paul

Similar Messages

  • DAMAGED LIBRARY, SKIPPING TRACKS, HELP PLEASE!

    I'm really hoping to get some help here, because I'm super bummed out about this. The other day Itunes on my laptop started skipping during one of the tracks that was playing. I didn't know what was going on, so I figured maybe it was my computer so I did a "disk clean up" and then defragmented my harddrive with Auslogic. Re-started my laptop, then openned up Itunes.
    I got the message "Importing library" and after taking forever I got an error message saying something like, "Library damaged..." and it changed the file to "damaged". Once Itunes finally openned up, it said something about "gapless information" (sorry I don't remember the EXACT messages) and it ran through all of the tracks I had in Itunes. NOW I have a ton of problems with Itunes on my laptop:
    *almost all the tracks now skip, it seems real hit or miss, the albums I purchased through the Itunes Store, as well as albums that I got from cds are all incredibly jacked up for the most part
    *other tracks that I downloaded outside of Itunes are also skipping
    *all of the TV shows that I purchased through Itunes are all showing that I never watched them (you know how they have that little bullet next to them if its a new file you haven't watched) even though I've seen all of them, plus a "TV Shows" playlist was created that I never made
    *all of the podcasts I had subscribed to are all gone, instead a "Podcast" playlist was created where all the podcasts I have have all been moved to
    *a number of the standard default playlists are all back, even though I had deleted them a long time ago to cut down on the number of playlists I had on my iPod
    *now Itunes is showing "Playcount" and "Last Time Played" even though I had previously set up Itunes NOT to show them
    Whew. That's about all I can think of. I've tried listening to some of the music I had downloaded outside of Itunes through Windows Media Player, and it skips there too. So I don't know if the problem is with Itunes or if my entire library is just completely jacked and unrecoverable.
    I should say that after experiencing these problems with Itunes I never synced my Ipod back to my computer, so everything is still set up on my Ipod and plays perfectly, just like how I had it. If I had to could I upload my library from my Ipod back to Itunes so I could have all my music again?
    Please help me. I literally listen to music pretty much all throughout the waking day. Either on my computer or on my Ipod while driving, working out, or at work. I really, really don't want to have to accept that I've lost my entire library after spending hundreds of dollars with the Itunes Store and spending thousands of hours downloading, searching, catalouging, all that. I would really, really appreciate the help.

    Someone please help me out here. I've tried un-installing and reinstalling Itunes and the exact same symptoms were still there. So far I haven't synced my Ipod to my computer in over a week because I want to keep my music, but also this means that I'm not getting anymore podcasts or anything, no new music at all to my Ipod, plus I can't listen to music at home anymore because it skips. Someone please help me.

  • V$session Problem- Help Please

    Here is a function that became invalid and I am trying to recompile it and it is failing.
    CREATE OR REPLACE FUNCTION VTEST_FACETS.CERSP_GET_SID return
    number
    IS
    v_sid number;
    BEGIN
    SELECT sid
    INTO v_sid
    FROM V$SESSION
    WHERE audsid = SYS_CONTEXT('USERENV', 'SESSIONID');
    return v_sid;
    EXCEPTION
    WHEN OTHERS then
    ER_SP_SYST_SYST_RAISE_ERROR(SQLCODE, 'Error occured while fetching sid '||SQLERRM);
    END;
    Here is the error message I am getting:
    8/3 PL/SQL: SQL Statement ignored
    10/10 PL/SQL: ORA-00942: table or view does not exist

    You need to grant select privilege directly to the owner of the procedure (and not through a role)
    See here for a thread with the same problem
    Create Functions weirdness

  • My Apple TV 1st gen will now no longer play any of our iTunes music, although it shows a speaker symbol when you select play on the track. Please help?

    My Apple TV 1st gen will now no longer play any of our iTunes music, although it shows a speaker symbol when you select play on the track. Please help?

    Are you streaming or syncing you music? Sounds like you're streaming music directly from iTunes.
    There can be many different issues. First, try power-cycling you wireless router (leave router disconnected for about 1 or 2 minutes) to refresh the wireless communication betweek both devices.
    Make sure all software updates have been installed, for Apple TV and iTunes.

  • Track delays before playing  -  Help please

    DSP - 3 One of my tracks seems to delay before playing and I end up with a black screen before it begins. I went back to Final Cut and can't find any problem with it there. All my other tracks start fine. Help please.
    Thanks.

    Where are you seeing this? On a DVD player or in Simulator? What kind of menu are you using?
    The delay on a disc is usually (but not always) related to where the menu is physically located (usually near the spindle hole) compared to the track (anywhere else moving outwards towards the edge of the disc), and the routing tables which DVDSP creates on your behalf when the disc is built. Not all menu/track relationships will see the same delay and you can perhaps reduce it by adding the asset for the troublesome track into another track and setting it apart with a story. Your menu can then point to the assets within the story and it should make a difference.
    However, the delay you see on your player will almost certainly be different to that seen on another player - without using a spec level authoring package (or trying it in DVDSP4 where you can move menus into specific VTSs) you may well be stuck with it as it is if adding the asset to an existing track doesn't work.

  • Could somebody help please, my albums are all split in to individual tracks in my library how can i merge in to one album. many thanks

    could sombody help please, my albums in my library are split in to individual tracks how can i merge them in to one album. many thanks

    This web page can help you figure it out: http://samsoft.org.uk/iTunes/grouping.asp

  • 5.0.1 Firefox, application froze then crashed. Restarted it, but no 'restore session' and i've lost all my tabs. Help please?!?!

    Can anyone help please?
    5.0.1 Firefox, application froze then crashed. Restarted it, but no 'restore session' and i've lost all my tabs. Help please?!?!
    Done config:restoresession, and nothing.

    There shouldn't be any numbered sessionstore-##.js in the Firefox Profile Folder
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    The presence of such files usually indicates that that was a problem with accessing the main sessionstore.js file that prevented Firefox from renaming the temp file with the number.<br />
    In this case you may be lucky that the file with the highest number may have that session.<br />
    You can try to rename the file sessionstore-3.js to sessionstore.js to see if that brings back the lost tabs.
    If you use the Time Machine then you can try to restore a copy of sessionstore.js from around the time that you lost that session.

  • URGENT http session HELP PLEASE

    Hello all.
    i work in http session...after i redirect in https(login.jsp for example)
    in JavaBean for Login.jsp try get connection with all object or JavaBeans from last http session ...but i cannot do it.
    Where my problem ?
    How i can have access across sessions?
    Help me please.

    i don't understand your meaning exactly,but i think what you mean is maybe to make a bean accessible across the session?is that right?if yes,you can set the scope attribute to session,such as:
    <jsp:useBean id="..." scope="session" class="...."/>

  • Need help please, Join Tracks Greyed Out.

    Can someone please help with ther following information.
    When I want to burn an audiobook from CD into itunes and try to use the "join tracks" command from the advanced menu it is greyed out and can't be used.
    Can someone please tell me how to sort this out, plus as soon as I load i CD itune starts to import even though I have it set in preff not to do so.
    Again any help please to stop this happening.
    Many thanks

    *When I want to burn an audiobook from CD into itunes and try to use the "join tracks" command from the advanced menu it is greyed out and can't be used.*
    Are you highlighting the tracks you want to join before you go to Advanced>Join CD tracks? the function will be dimmed until a selection is made.
    *as soon as I load i CD itune starts to import even though I have it set in preff not to do so.*
    Open iTunes and go to Edit>Preferences>Advanced>Importing and change the setting in the drop down menu beside "On CD insert" from "Import CD" to one of the other settings such as "Show CD", "Begin Playing" or "Ask to Import CD"

  • Help please does any1 know how to track an iphone on my pc cant sign into icloud

    help please does any1 know how to track an iphone on my pc cant sign into icloud

    The only way to track is vis find my iphone app on sn ipod touch/iphone/ipad or icloud.com on most any internet connected device/computer

  • I have an Apple ipod that gets stuck on the first track of every album, can you help please?

    I have an Apple Ipod model MC 688. My problem is that every track played 'sticks' , if I forward it sticks on the next track, just plays the same one over and over.
    Very frustrating, can you help please?

    "Sticks"
    Do you mean the same song repeats? If so, turn off the repeat (1) song feature.

  • Hi!  My "Touch" has gone haywire since a botched up date.  The colour has gone from my music menu Page (eg "songs", "artists2 etc. and my Touch will now not shuffle my tracks so I have to move on manually.  Help please.

    An update to my Touch went haywire and I lost my music and apps but luckily I had subscribed to i Cloud and they were reinstated but my music contents page - "artists", "songs" etc. no longer has any colour and the shuffle will not work.  Help please?

    Yes, the color has been deleted iOS 6.
    You have tried turingin on shuffle, right?
    Try:
    - Reset the iPod. Nothing will be lost
    Reset iPod touch: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup
    - Restore to factory settings/new iPod.

  • Motorola ,motorokr s9 hd bluetooth, will not skip tracks, any help please

    hi just got bluetooth motorola motorokr s9-hd headphones, paired fine, sound great but when try to skip songs on the headphones it will not let me do that, can anyone advise with any help please .....thanks

    thanks for that help, just been checking some forums and stuff, so hopefully next firmware will be able to do this, at moment i am using voice control and seems to do the trick....thanks

  • Can we use an overloaded constructor of a Java Bean with Session Tracking

    Hi Friends,
    If any one can solve my query.... It would be helpful.
    Query:
    I have a Java Bean with an overloaded constructor in it. I want to use the overloaded constructor in my JSP.
    1. One way of doing that is to use it directly in the "Scriptlets" (<% %>). But then I am not sure of the way to do session tracking. I think I can use the implicit objects like "session", "request" etc. but not sure of the approach or of the implementation method.
    2. Another way is through the directive <jsp: useBean>. But I cannot call an overloaded constructor with <jsp: useBean>. The only alternative way is to use the directive <jsp: useBean> where I have to write getter and setter methods in the Java Bean and use the <jsp: setProperty> and <jsp: getProperty> standard actions. Then with this approach I cannot use the overloaded constructor.
    Can any one suggest me the best approach to solve this problem ?
    Thanks and Regards,
    Gaive.

    My first reaction is that you can refactor your overloaded constructor into an init(arguments...) method. Instead of overloaded constructor, you can call that init method. This is the ideal solution if possible.
    As to the two choices you listed:
    1. This is OK, I believe. You can use scriplet to define the bean and put it into session scope of the pageContext. I am not sure exactly what you meant by session tracking; whatever you meant, it should be doable using HttpSessionAttributeListener and/or HttpSessionBindingListener.
    2. Agreed. There is no way that <jsp:useBean> can call a constructor that has non-empty arguments.
    Please tell me how it works for you.

  • Servlets: session tracking

    hi
    i am a newbie to j2ee. i am currently learning about session tracking in Servlets. i have written a simple program.
    this is what its supposed to do:
    FirstNameSessionServlet page
    accept the first name of the user
    submit
    LastNameSessionServlet page
    it shows the firstname name
    show session id
    accept the last name of the user
    submit
    FirstandLastNameSessionServlet page
    show the first name
    show the last name
    show session id
    show session attibutenames
    FirstNameSessionServlet page output:
    first name: textbox
    submit
    i enter abc into the textbox and click submit
    LastNameSessionServlet
    Your First Name is : abc(getParameter method used)
    Your First Name is : null(getSession method used)
    session id: CDFEBEEC7D599C70359AE52DBD1EAAEE session getLastAccessedTime1180087277281
    last name textbox
    submit
    i enter def into the textbox and click submit
    FirstandLastNameSessionServlet output page
    your first name is: null
    your last name is: def
    session id: CDFEBEEC7D599C70359AE52DBD1EAAEE
    session tracked success
    i can't understand the use of getAttribute(); Can anybody please tell my why getAttribute(); is returning null when i am trying to access the firstname variable through this method. what am i doing wrong? thanx for your help
    shankha
    here is my code
    FirstNameSessionServlet.java
    [//FirstNameSessionServlet.java
    package myname;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class FirstNameSessionServlet extends HttpServlet{
        public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException
             doPost(req, res);
        public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException
             res.setContentType("text/html");
             PrintWriter pw=res.getWriter();
             pw.println("<html><body>");
             pw.println("<form action='/contentnames/uti/LastNameSessionServletpath' method='post'>");
             pw.println("<p>First Name: <input type='text' name = 'firstname'></p>");
             pw.println("<p><input type='submit' value='Enter'></p>");
             String firstname= req.getParameter("firstname");
             HttpSession sess = req.getSession(true);
             sess.setAttribute("firstname",firstname);
             pw.println("</form></body></html>");
             pw.close();
    LastNameSessionServlet.java
    LastNameSessionServlet.java
    //LastNameSessionServlet.java
    package myname;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class LastNameSessionServlet extends HttpServlet {
        public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException
             doPost(req, res);
        public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException
             res.setContentType("text/html");
             PrintWriter pw=res.getWriter();
             pw.println("<html><body>");
             pw.println("<form action='/contentnames/uti/FirstandLastNameSessionServletpath' method='post'>");
             String firstname= req.getParameter("firstname");
             int attrib=1;
             HttpSession sess = req.getSession();
             String firstnamesession = (String) sess.getAttribute("firstname");
                req.setAttribute("firstname", firstname);
                req.setAttribute("firstnamesession",firstnamesession);
                //req.setAttribute("firstname",firstname);
             pw.println("<p>Your First Name is  : "+firstname+"(getParameter method used)</p>");
             pw.println("<p>Your First Name is  : "+firstnamesession+"(getSession method used)</p><br><br><br>");
              pw.println("session id: "+sess.getId());
              pw.println("session getLastAccessedTime"+sess.getLastAccessedTime());
              Enumeration names = sess.getAttributeNames();
              while (names.hasMoreElements()) {
                   String name = (String) names.nextElement();
                   Object value = sess.getAttribute(name);
                   pw.println("<p>name=" + name + " value=" + value+"</p><br>");
             pw.println("<p>Last Name:  <input type='text' name='lastname'></p>");
             pw.println("<p><input type='submit' value='Enter'></p>");
    //         HttpSession sesslast = req.getSession();
    //         sesslast.setAttribute("lastname","lastname");
             pw.println("</form></body></html>");
             pw.close();
    FirstandLastNameSessionServlet.java
    //FirstandLastNameSessionServlet.java
    package myname;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class FirstandLastNameSessionServlet extends HttpServlet {
        public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException
             doPost(req, res);
        public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException
             res.setContentType("text/html");
             PrintWriter pw=res.getWriter();
             pw.println("<html><body>");
             HttpSession sess = req.getSession(true);
             String firstname = (String)sess.getAttribute("firstname");
             //String lastname = (String) sess.getAttribute("lastname");
             String lastname = req.getParameter("lastname");
             pw.println("<p>your first name is: "+firstname+"<br>");
             pw.println("your last name is: "+lastname+"</p><br><br><br>");
             Enumeration names = sess.getAttributeNames();
              while (names.hasMoreElements()) {
                   String name = (String) names.nextElement();
                   Object value = sess.getAttribute(name);
                   pw.println("<p>name=" + name + " value=" + value);
              pw.println("session id: "+     sess.getId());
             pw.println("<h1>session tracked success</h1>");
             pw.println("</body></html>");
             pw.close();
    }

    Your understanding of the flow seems to be a little flawed.
    When you first open the FirstNameSessionServlet, you get the textbox asking for the firstname:
    >
    FirstNameSessionServlet.java
    [public void doPost(HttpServletRequest req,
    HttpServletResponse res) throws IOException,
    ServletException
         res.setContentType("text/html");
         PrintWriter pw=res.getWriter();
         pw.println("<html><body>");
    pw.println("<form
    m
    action='/contentnames/uti/LastNameSessionServletpath'
    method='post'>");
    pw.println("<p>First Name: <input type='text'
    ' name = 'firstname'></p>");
    pw.println("<p><input type='submit'
    ' value='Enter'></p>");//The running of the code till this point generates the HTML page, but your servlet is not done yet! Think of it as a function that till now, has printed some output ( the output being HTML code and the destination being the broswer ); but the function has not finished executing yet:
         String firstname= req.getParameter("firstname");
         HttpSession sess = req.getSession(true);
         sess.setAttribute("firstname",firstname);
         // Now, the immediately preceding part of your code creates a string and tries to put the value of the request parameter firstname into it and then put that string into the session object. But guess what? Your application has only just started running, this is your first page and there is no parameter in the request object with this name! This part of the code should come in the next servlet.
         pw.println("</form></body></html>");
         pw.close();
    LastNameSessionServlet.java
    String firstname=
    = req.getParameter("firstname");// This time, req.getParameter() will work since you submitted the last form which had a textbox with this name, you'll get the contents of that box.
         int attrib=1;
         HttpSession sess = req.getSession();
    String firstnamesession = (String)
    ) sess.getAttribute("firstname");//In the last servlet, you put in this parameter, but the value was null for reasons explained above.
         HttpSession sesslast = req.getSession();
         sesslast.setAttribute("lastname","lastname");
         //Again, you will get null for lastname if you tried to access it from the request object since you only just created the field with that name and you would be trying to access it within the same servlet.
         pw.println("</form></body></html>");
         pw.close();
    FirstandLastNameSessionServlet.java
         HttpSession sess = req.getSession(true);
    String firstname =
    = (String)sess.getAttribute("firstname");//this will still not work since you never put a correct value in the session object ( should have done after req.getParameter("firstname") in the second servlet )

Maybe you are looking for

  • How to populate the premise info automatically  in Order  page of CC&B

    Hi All, In CC&B if we are creating a order from order page, whenever we select person information as a existing person and search the person using search button,account information also used to get populate automatically.But at the same time premise

  • XML attributes instead of elements in data contract serialisation in Rest WCF implementation

    I want to uses XML attributes instead of elements, I implemented IXmlSerializable and public partial class Id : IXmlSerializable { /// <remarks/> [XmlAttribute] public string lmsId; /// <remarks/> [XmlAttribute] public string unitId; /// <remarks/> [

  • How to configure drill through column

    Hi Guys, I have been trying to drill through column for detailed information on the data. Regards Sabir

  • JTree remove expand/collapse cross button...??

    Hi all, I have forbidden tree collapsing (by default it is fully expanded), and I want to remove expand/collapse cross buttons that actually are used to expand/collapse tree nodes. Is it possible and can anyone give me advice how i can do this. Thank

  • New python

    I've uploaded a new Python package since the old one was broken (build with an older version of GCC) it can be found in the /incoming directory. Stuff like superkaramba compile with this version of python.