Can you do anything after sendRedirect()

I'm not able to test this myself as I don't have a development environment set up, but this is my question.
Is it possible to do anything after a call to sendRedirect(), e.g. setting cookies, additional checking? The javadocs say that if the response has been committed, this method throws an IllegalStateException. Is it possible to do anything after a call to sendRedirect(), such as writing to a response, adding cookies?
Here is some code which may explain my question:
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          String username = request.getParameter(USER_ID);
          response.sendRedirect(anotherUrl);
                                          // is this even possible????
          response.addCookie(new Cookie("Login", "true"));
     }

I just tested this with the following code:
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
Cookie[] cookies = request.getCookies();
          for(int i = 0; i < cookies.length; i++) {
               Cookie c = cookies;
               LOGGER.info("Cookie: " + c.getName() + ", " + c.getValue());
response.sendRedirect(someURL());
response.addCookie(new Cookie("Login", "true"));
Basically it will print all cookies in the request. On the first doPost, it does the redirect before adding the Login cookie. On subsequent doPost's the Login cookie was not printed out, the only cookie I found was the JSESSIONID, which was expected. So you can't set cookies after a redirect.

Similar Messages

  • Can you create apps after 1st May 2015 using Adobe DPS single edition?

    Can you create apps after 1st May 2015 using Adobe DPS single edition?
    I currently have SE via creatieve cloud - one of the only reasons we switched to CC was for the DPS SE.
    Does anyone know if this capability will just be 'switched off' at midnight 1st May 2015?? There are huge costs for going the enterprise route but with no date in sight for Publish to be launched I am not sure I can wait for this, or should I???

    Adobe states: Please note that the Digital Publishing Suite, Single Edition, service will be available for use until May 1, 2015, but beyond that date the service will no longer be available.
    So essentially my licence will expire on 1st May - Adobe's note just mentions 'service' -  even though part of CC and I will not be able to maintain my app or create any more IPA's after 1st May. I can't beleive there is nothing to switch over to other than paying thousands of pounds for enterprise??
    Just all so vauge, feels like a plug is going to be pulled and thats it??? Maybe I am missing something?

  • I am using iPhoto 11 and my library has 736.5mb on disk. I have problems with iPhoto stalling and needing to force quit. I have rebuilt my library. Can you suggest anything else?

    I am using iPhoto 11 and my library has 736.5mb on disk. I have problems with iPhoto stalling and needing to force quit. I have rebuilt my library. Can you suggest anything else? Thanks, Rose

    Make a temporary, backup copy (if you don't already have a backup copy) of the library and try the following:
    1 - delete the iPhoto preference file, com.apple.iPhoto.plist, that resides in your
         User/Home()/Library/ Preferences folder.
    2 - delete iPhoto's cache file, Cache.db, that is located in your
         User/Home()/Library/Caches/com.apple.iPhoto folder. 
    Click to view full size
    3 - launch iPhoto and try again.
    NOTE: If you're moved your library from its default location in your Home/Pictures folder you will have to point iPhoto to its new location when you next open iPhoto by holding down the Option key when launching iPhoto.  You'll also have to reset the iPhoto's various preferences.
    NOTE 2:  In Lion and Mountain Lion the Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and hit the Enter button - 10.7: Un-hide the User Library folder.
    If that does'nt help log into another user account on your Mac and try iPhoto from there. 

  • Please, can you confirm that after erase the phone using the find my iphone all my personal data will be unavailable? Someone stole my iphone 6  on the street

    Please, can you confirm that after erase the phone using the find my iphone option,  all my personal data will be completely unavailable? Someone stole my iphone 6 +  on the street. I have already received a mail from apple confirming that is erased. Can I trust on this message? It really works? my 3G connection was working properly.
    Thank you very much

    Hey Joangil,
    Yes! If you have received an email from Apple stating and confirming that it is erased then you should trust this message. It would have all been removed.
    Sorry to hear that your iPhone has been stolen,
    Zach

  • Can you buy AppleCare  after buying new iPad without visiting Apple store?

    Can you buy AppleCare  after buying new iPad without visiting Apple store?

    Rumblin 4x4 wrote:
    Can you buy AppleCare  after buying new iPad without visiting Apple store?
    You can if you do not live in Florida, apparently. I called this morning to add AppleCare+ and after giving my info (explaining that the Apple Store is 50 miles (at least) from me, I was going strong until she realized that I live in Florida. Apparently, some moron in the FL State Legislature got a bill passed to "protect" senior citizens and you can't buy things like AppleCare+ online or over the phone!! You have to do it in person. Seriously?!? I'm a senior citizen and I knew exactly what I was trying to buy.........she even had to read the description even though I told her I knew all about AppleCare+. As my husband said, "If you're smart enough to go online and pre-order, and set up an iPad, surely you are capable of making a warranty purchase!!!!!!
    I even tried calling the Verizon store here, since I bought a VZ version, and even they can't sell it!! Going to Orlando from the beach during Spring Break and Snowbird Season will take up most of a day.......all to spend $99. I may just skip it and keep my fingers crossed that I never need it in a year from now.

  • Can you edit text after saving your file as pdf

    I have recently created a letterhead in Illustrator.
    Is there a way to change a person name and title after saving it as a pdf file? I heard something about creating a form in Acrobat professsional.
    I need to print out a letterhead with different peoples name and title. Any help would be appreciated. Thank you.

    Can you edit the text in Acrobat Reader?
    Yes, if you use Acrobat Pro to save the PDF as a Reader-enabled form.
    1. Create your letterhead in Illustrator (or whatever). Leave design space for, but do not create text objects that you want to be editable.
    2. Save as PDF.
    3. Open the PDF in Acrobat Pro. Use Acrobat's Form tools to add text fields whereever you want the end users to be able to key text.
    4. Select the Enable Reader Usage Rights command in Acrobat to make the form fields edtiable in Reader. Save the file.
    Recipients of the PDF can now open it in Reader, edit the content of the fields, and save the file with their edits.
    JET

  • HT5137 Unable to download more than 8 per cent of telegraph app for last 4 days since they upgraded it can you suggest anything to make it work

    Have been unable to download telegraph subscription for last 4  days since they up graded the ap. can you tell me how to restore it please?

    You're the second person in two days having trouble with the Telegraph update. Step one is a reset. Press and hold both the home and power buttons for 10-15 seconds till the Apple logo appears. Release both buttons. Wait 15-20 seconds till your iPad starts on it's own.

  • Installation problems: can't install anything after failed install.

    I believe this may have been posted before, but I have a different OS than in the question I read so I thought I should ask again.
    I have a Macbook Pro running OS X Lion (late 2011) and a while ago I was dumb and decided to install old Cubase LE 4 software onto my brand new Macbook. The installation stalled with "less than one minute remaining", I force quit, tried several more times, and ever since then I can't install anything else. I heard of some hotfix that can remedy this problem, but since I have the new OS I was wondering if that would still work.
    Any suggestions/answers are greatly appreciated.
    Bill

    I believe this may have been posted before, but I have a different OS than in the question I read so I thought I should ask again.
    I have a Macbook Pro running OS X Lion (late 2011) and a while ago I was dumb and decided to install old Cubase LE 4 software onto my brand new Macbook. The installation stalled with "less than one minute remaining", I force quit, tried several more times, and ever since then I can't install anything else. I heard of some hotfix that can remedy this problem, but since I have the new OS I was wondering if that would still work.
    Any suggestions/answers are greatly appreciated.
    Bill

  • How can you edit video after uploading to ovi

    Is this a big secret? I have looked on the net but ther doesn't seem to be an answer anyehere. surely Nokia offer this, but where is it?

    Can you please provide more information such as
    1. what type of device you are using
    2. what kind of video editing you are looking for
    3.Are you doing a drag and drop of video file to phone
    currently in Nokia ovi suite when you transfer a video from PC to phone, based on the phone type connected if the phone doesn't support direct placback of your input video then the video is edited in the background and then copied to the phone.

  • How many computers can you install Lion after purchasing from App store. My wife and I have our own Apple ID will it accept 2 different ID

    I have a MacBook Pro and an iMac . My wife has a MacBook and an iMac. How many computers are you allowed to install from one download. We both use Apple products and have our own Apple ID. Can I download Lion on her computers after I have both of mine installed? Or does she have to buy LION again using her Apple ID# ?

    A single purchase of Lion will allow you to download it multiple times as long as you use your Apple ID.
    If your wife wishes to install Lion, she must sign into the App Store with your Apple ID.
    Source: http://support.apple.com/kb/HT4854

  • Can't boot anything after deleting C partition in order to install Windows 8.1

    I have a ASUS X55VD notebook, wich had a Windows 7 64-bit (and a dual booted Ubuntu, but with Windows bootloader). Yesterday I tried to install a Windows 8.1, so I inserted a disc and restarted.
    The window to manually select the partition, on wich it will be installed, came up so I formated C partition where Windows 7 was installed. It did not allow me to install to that partition because, a new format (GPT) had to be used. So i chose to delete the
    partition. Deleting was quite long, after wich the computer restated, and after that it only showed black screen.
    The Windows DVD is still spinning, but nothing shows. Can't acces the BIOS (none of the keys work).
    Tried:
    - Hardware reset (battery out>hold power button fro 10-20 sec>put battery inside>start) - No change
    - Put a Live Linux DVD to boot from it - No change
    - Put a hirens boot cd - No change
    - USB boot - No change
    - Connect a external keyboard and tried accessing BIOS - Nothing happened
    I would suffice with just gettng some of my data from him, and sending him to repair Can't tinker with harware, or it will void my varrancy
    Please help. The problem is really urgent.

    Hi,
    It seems a hardware issue, you can first try to reset the CMOS - remove the cell battery from the motherboard for at least half hour, re-insert it, boot up. The BIOS settings should be reset to defaults. But for better solution, I
     suggest you contact the manufacture.
    Regards,
    Yolanda
    Yolanda
    TechNet Community Support

  • Treo 680: Typedown contacts search problem: can't find anything after S

    I recently purchased an unlocked GSM Treo 680 to replace a stolen Treo 650 (which replaced a 600, which replaced another 600, etc.). I loaded all my data on to it. However, when I do a typedown search in Contacts, it refuses to find any entries which (alphabetically by last name) occur after my friend "Catherine Simmonds". Even if their first name begins with an earlier letter of the alphabet, it doesn't find them. I can reach their entries by doing a lot of scrolling in the full list, but no other way.
    However, if I make a change of some sort to the contacts database, it does find them - for one search only. If I back up (delete a letter) on the search or cancel and do a new search, it stops being able to find them again. I've tried deleting some contacts, including the two either side of the "break", to see if they are corrupt in some way or if it's the number of contacts (I have about 420), but that doesn't seem to make a difference. At all times, I can find the contacts using the global search tool - although the 680 seems to have stopped the previous practice of starting global searches with the current database, which means it's often the second screen before the contact shows up.
    I run Ubuntu Linux 8.04, and am using jpilot as my sync software.
    To me, particularly given the intermittent nature of the thing and the ability to make it work temporarily by making changes to the Contacts database, this has all the marks of a software bug. Is it a known issue? Has anyone else seen it? Is there a fix?
    I'm using software version TREO680-2.12-ROW, Firmware R01.92. Please let me know if there's more information I can provide.
    Gerv
    Post relates to: Treo 680 (Unlocked GSM)

    What exactly do you mean by starting again?
    Previously, I restored a backup and then synced to get all data since the backup. I could certainly do that again. But I don't want to go all the way back to the backup only, because I'd lose all the data between then and now.
    jpilot, my sync software, won't let me sync on to a completely blank Treo. It tells me that I have to restore a backup first as a base. So I'm not sure if I'm able to restore the PIM data without restoring everything.
    I think it's unlikely to be an incompatible application because the problem is with a shipped Palm app. But you know more about Palm OS than me.
    But I'll have a play around and let you know how far I get.
    Gerv
    Post relates to: Treo 680 (Unlocked GSM)

  • Can you add programs after installation?

    say i run setup for master collection and install photoshop, bridge, soundbooth and flash, but then after instillation i find that i need after effects say, can i add after effects by going to control panel>programs and features and 'changing' master collection, or will i have to run setup again or what?

    When you want to add more programs run the setup program from the DVD.

  • Can't boot anything after attempting to Bootcamp

    Hi,
    I have an Intel Macbook Pro (can't think what year off the top of my head right now) running Snow Leopard and I attempted to Bootcamp with a standard Windows XP disk a few hours ago. A few minutes before the attempt I finished reformatting and reinstalling Snow Leopard, as I'd been having disk utility problems. I set the partition for 50GB (of 200GB) in the Bootcamp Utility, but when it restarted, I was presented with only a single partition to choose from, which was 130GB. I couldn't see the 50GB, so decided to exit. After exiting the MBP attempted to load the disk again, but failed. From then on I can't load any operating system (not that I expect I could load XP), and it boots to a black screen with a flashing cursor in the top left corner. I can't load the original Snow Leopard install disk, or any disk, and I also can't boot into safe mode. When I use the alt/option key boot, I'm faced with a semi-large grey lock with a password field.
    If anyone needs more info, I'll try find it.
    Thanks,
    chunks01

    Hi and welcome to Discussions,
    the single partition of 130GB phenomenon usually indicates that you used a Windows XP CD that does not match the requirements of BootCamp.
    Usually a XP CD which is not at SP2 (Service Pack 2) level, but a prior one.
    To make yourself an XP SP2 (or SP3) install CD you can use these instructions http://www.winsupersite.com/xp/sp3_slipstream.asp
    As for your second but foremost problem, have a look here http://support.apple.com/kb/TS1978
    Hope it helps
    Stefan

  • Can't download anything after update to ICS on neo v

    Hi everyone,
    I am not able download anything on my neo v after upgrading to ICS.
    Also, my market icon is not changed to Play icon.
    help!!! Thnaks

    Do both of you have active internet connection ?
    if yes then either what do gwhispererz said but remember it would erase all phone data
    or try
    settings > apps > android market > clear data  ( uninstall update , if it is showing an option to do so )
    then restart your phone
    log in android market and wait for it to upgrade to google play
    Discussion guidelines.
    Message me or any other moderator to seek help regarding moderation.

Maybe you are looking for

  • No files will open in PS in CS2 nor trial version CS5

    Up to a month ago my PS CS2 was working great.  Then one day I found I could not open any files in the program. I tried reloading preferences with no change.  I then removed and reloaded the program (Creative Suite CS2), and PS worked great for two d

  • Multiple Results

    Hi I can't seem to figure out how to summerize my data. The query is as follows: select studentid, studylevelno from study where studentid in (5983) group by studentid, studylevelno the result set is 5983 3 5983 4 5983 10 Now, I would like to grab on

  • HT2534 the itunes app sign up isnt giving me the shoice to pick non payment

    i tried making a apple id so i can get apps and it took me to a credit card thing but i dont have a credit card and it doesnt give me the choice to pick non credit?

  • Creating variables using for loop

    is there any way in java to create a variable called "xi" using a for loop say: for (int i =0; i < 1000000;i++){   int xi; }so I want to create a million of different variable names based on the i... I know this may be a stupid question

  • How to get Driver and url names from a connection pool

    Hi, How to get the DriverName and URL from an existing pool, If I know the name of connection pool ? Is it possible to know the name of related pool , if I know the name of datasource? Thx Manish