How does c:url tag know when the session is cookieless and thus to redirect

i have been looking at the source code for c:url tag and can't figure out how they are doing that. I need a way to do that in a jsp, to check if the cookies are allowed or not.

how does c:url tag know when the session is cookieless and thus to redirecthuh?
What do cookies have to do with redirecting?
Cookies get encoded into a URL using the method in HttpServletResponse: response.encodeURL() or encodeRedirectURL().
That method determines whether or not it prints out the session id as part of the url, or it gets uses cookies.
You can try: request.isRequestedSessionIdFromCookie().
If that is true, you know that session cookies are supported (or at least that one was)

Similar Messages

  • How do I close a connection when the session ends?

    I have a website that is using JavaMail to display a user's mail through the browser. I'd like to keep the connection to the mail server open during the whole session that the user is logged in, in order to improve response time. The problem is, I can't detect if a user closes their browser so that I can close the connection to the server.
    Is there a way for me to close the mail server connection when the session ends?
    Thanks.

    Create session listener, Impliment sessionDestryoyed
    method with your connection close statements.I was wondering how to use the listener for a Servlet as well, what would you type in that method to close the connection?.
    public class ServletListener
         implements
              ServletContextListener,
              ServletContextAttributeListener,
              HttpSessionListener,
              HttpSessionAttributeListener
    public void sessionDestroyed(HttpSessionEvent arg0)
              //System.out.println( arg0 );
    }

  • How to know when a session has gone by closing browser or leaving site.

    Hi! I'm doing an application that uses the session API. This application must run in every java-enabled web-server. I want to know if there is a way to know when a session has gone. I mean, you can know this if, for example, you call the isNew method. But for example, if you close the browser, the session is gone, but obviously, I can't call the isNew method from anywhere, so... how can I know when the session is killed by closing de browser or if the user leaves the site. You can use the onUnload of JavaScript, but I don't want to call a new window when this happens.
    Hope you can help me!

    You probably can't tell. But then you don't want to do that logic anyway... I was just at your site, and I was signed on, then somebody came in and asked me something so I had to look at another site, then I pressed the back button and now I'm at your site again, but you signed me out? What's with that?

  • If the browser's cookie is disabled, how does Tomcat 4.1.12 handle the sess

    If the browser's cookie is disabled, how does Tomcat 4.1.12 handle the session?

    by URL Rewriting.
    For in deep information have a look at the servlet api docu or get the free pdf tutorial CoreServlets that covers this topic under pdf.coreservlets.com

  • HT1430 How can you reboot your Touch if the screen is frozen and will not allow you to use the "slide to power off"

    How can I reboot my Touch when the screen is frozen and I cannot use the "slide to power off" feature?

    Next try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Restore from backup. See:                                 
    iOS: How to back up           
    - Restore to factory settings/new iOS device.
    If still problem, make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
    Apple Retail Store - Genius Bar          

  • Does anyone know when the 27 inch iMacs will ship?

    Does anyone know when the new "thin" 27 inch iMacs will ship to California?  I ordered one in early December and can't get a firm answer.

    If you ordered it when they were accepting Pre-Orders then chances are you'll receive your iMac between Dec. 24th and 31st. But seeing as how you ordered it in December, I don't think that's the case. I'm about to purchase a customized one, so I've been back and forth on Apple's site since late November, and I noticed that in December, the ship date shows January. So I'm thinking that once January 1st rolls around, the ship date on the website might be updated with something along the lines of 1-2 weeks or such. Good luck, I feel your angst. I'm about to order one, but it's already December 26th tomorrow, so waiting till January won't be that big of an issue. By the way, did you go with the new Fusion drive? I think I'm going to. At first I decided I wasn't because people were saying that there was a possibility of files being corrupted because they are being moved around and re-written so much, but I'm not so sure now. I'm thinking I'll try the 1TB Fusion drive, not too worried now because I back up all my important stuff to external HDD. Plus from the videos I've seen, boot time and app load time with the Fusion Drive models is wicked quick.

  • Does anyone know when the thunderbolt to firewire cable/adaptor will be available?

    Does anyone know when the thunderbolt to firewire cable/adaptor will be available?

    Apple said ThunderBolt to FireWire cable/adapter wil be available in July.
    http://www.macworld.com/article/1167227/two_new_thunderbolt_cables_join_parade_o f_apple_releases.html

  • How to access my hard drive when the system does not work

    how to access my hard drive when the system does not work

    Startup - Gray, Blue or White screen at boot, w/spinner/progress bar
    Startup Issues - Resolve
    Startup Issues - Resolve (2)

  • Does anyone know when the next upadate will be?

    does anyone know when the next upadate will be?

    No. Only Apple knows that. We are just users like you.

  • Does anyone know when the iphone 5 will be out?

    does anyone know when the iphone 5 will be out?

    Sorry for the practical joke, but really, there are dozens if not hundreds of threads asking this question and the answer is always the same: No one knows exactly, and that's the way Apple wants it. Apple hasn't even announced that there is going to be an iPhone 5; it's all speculation and rumor for now.
    My best guess is that you'll see a new iPhone at the same time iOS 5 is released, which should be late September or early October. (Or not... Apple will only say, "Fall 2011 – nothing more specific.) But it might not be an iPhone 5; it could be a slightly modified iPhone 4, or nothing at all.

  • Does anyone know when the ball will be picked up and Canada users will get full use of siri ?

    Does anyone know when the ball will be picked up and Canada users will get full use of siri ?

    No, since we're users just like you.  You'll have to wait for Apple to announce it.  Speculation is prohibited by the Terms of Use of this forum.

  • How to know when the PRICE AFTER DISCOUNT changed and get the value

    Hi,
    Everything I do to see if a value changed in the grid works except for PRICE AFTER DISCOUNT
    which seems to be inaccessible.
    Any idea how to know when exactly this value changed and do actions accordinly ?
    Also I always get 0.00 if I try to get the value of it
    This works to get in the condition of a vlaue changing but I always get 0.00 as the value of the column
    if (pVal.ItemUID == "38" && pVal.ColUID == COL_DISCOUNT.ToString() && pVal.EventType == BoEventTypes.et_VALIDATE && pVal.ItemChanged == true && pVal.ActionSuccess == true)
        try
            SAPbouiCOM.Matrix Matrix = (SAPbouiCOM.Matrix)SBO_Application.Forms.ActiveForm.Items.Item("38").Specific;
            SAPbouiCOM.EditText Editor = (SAPbouiCOM.EditText)Matrix.Columns.Item(COL_DISCOUNT).Cells.Item(pVal.Row).Specific;
            SBO_Application.MessageBox("Discount changed for : " + Editor.Value + "...", 1, "Ok", "", "");
        catch (Exception ex)
            SBO_Application.MessageBox(ex.Message, 1, "Ok", "", "");
    And this do not even get into the condition even tought I SEE the column PRICE AFTER DISCOUNT:
    if (pVal.ItemUID == "38" && pVal.ColUID == COL_PRICEAFTERDISCOUNT.ToString() && pVal.EventType == BoEventTypes.et_VALIDATE && pVal.ItemChanged == true && pVal.ActionSuccess == true)
        try
            SAPbouiCOM.Matrix Matrix = (SAPbouiCOM.Matrix)SBO_Application.Forms.ActiveForm.Items.Item("38").Specific;
            SAPbouiCOM.EditText Editor = (SAPbouiCOM.EditText)Matrix.Columns.Item(COL_PRICEAFTERDISCOUNT).Cells.Item(pVal.Row).Specific;
            SBO_Application.MessageBox("Price after discount changed for : " + Editor.Value + "...", 1, "Ok", "", "");
         catch (Exception ex)
             SBO_Application.MessageBox(ex.Message, 1, "Ok", "", "");

    just idea, maybe it will works
    Create one udf in row level and set there FS based on changes on price after discount and fill value what is in price after discount. Then the validation make on this field instead of standard SAP field.

  • Will the ipod 4th generation drop in price when the 5 comes out and if it does how much by

    will the ipod 4th generation drop in price when the 5 comes out and if it does how much by

    http://store.apple.com/us/browse/home/shop_ipod/family/ipod_touch/select_4thgene ration

  • HT1459 My I pod is not responding  how do I know when the ipod had actually died?????

    my ipod has the green lights however when i try to listen to music ....nothing ....i tried several head sets. how do i know when the ipod is finally dead

    Read the manual for a solution - iPod Manuals

  • How do we know, when the service contract is last modified ?

    How do we know, when the service contract is last modified and by whom ?
    thanks
    siva
    Edited by: sivapara on Nov 24, 2008 3:14 PM

    To add also in OKC_K_HISTORY_B for some actions.
    Thanks
    Nagamohan

Maybe you are looking for