Code continue to execute in same servlet even after request forwarded.

Hi
I have forwarded flow of execution in first line of my servlet.
request.getRequestDispatcher("xx.jsp").forward(req,res);
my class looks like:
servlet
line 1: request.getRequestDispatcher("xx.jsp").forward(req,res);
line 2: some code
line 3: some code
Now what happens that even after execution of line 1........ line2 and 3 gets executed.
But after execution of line 3 flow is forwarded to xx.jsp.
How can i avoid execution of line 2 and 3.
Please comment
Thanks
Edited by: money321 on Mar 5, 2009 9:06 AM

Hi,
Had this issue when I was a java newbie :)
just place a return statment
servlet
line 1: request.getRequestDispatcher("xx.jsp").forward(req,res);
return;
line 2:  some code
line 3:  some code
}<br>

Similar Messages

  • Can we remain in the same state even after clicking submit button?

    Hello All,
    Can we remain in the same stage even after clicking submit button? Also it should remain in the same stage only when certain conditions are met. For eg:
    Condition : In Stage1, CustomFieldA default value is 'No'. To pass from Stage1 to Stage2 the CustomFieldA value should be made to yes.
    Scenario 1 : CustomFieldA value is 'No', and I click on Submit .
    Expected Result : should remain in the same stage
    Is above result achievable in PS 2013? I am creating workflow in Visual Studio 2012, so can I handle this in the workflow?
    Please help.

    The above answer was proved wrong, so please follow this link to get the answer.
    http://social.msdn.microsoft.com/Forums/en-US/8c75d74d-1ea6-4273-96cd-e70f5a5688fc/how-to-remain-in-the-same-stage-even-after-clicking-submit-button?forum=project2010custprog

  • My email keeps loading the same emails even after deleting them.  They keep coming back everytime I start up the mail app.  What can I do?

    My email keeps loading the same emails even after deleting them.  They keep coming back everytime I start up the mail app.  What can I do?

    After you delete them, empty the trash before they re-load.

  • My mac mail on just keeps sending the same messages even after deleted and shows thousands of emails supposed to be coming in

    My mac mail on just keeps sending the same messages even after deleted and shows thousands of emails supposed to be coming in

    If you have a backup, you can restore the e-mails. Go to Finder and select your user/home folder. With that Finder window as the front window, either select Finder/View/Show View options or go command - J.  When the View options opens, check ’Show Library Folder’. That should make your user library folder visible in your user/home folder. Library/Mail/V2.
    Thanks to leonie for some information contained in this.

  • My ipod touch gets stuck on the same song, even after I uncheck the loop button.  I am trying to play it in my 2007 vw with a power adapter that allows it to charge and play through my navigation unit. Please help.  Thank you.

    My ipod touch gets stuck on the same song, even after I uncheck the loop button.  I am trying to play it in my 2007 vw with a power adapter that allows it to charge and play through my navigation unit. Please help.  Thank you.

    Yes, first try deleing both songs.
    If still problem
    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.
    - Unsync all music and resync
    - 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. 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          

  • My company email is starting to save numerous drafts of the same email even after it has been sent

    Earlier today my company email (set-up in Mail) started saving numerous drafts of emails even after they have been sent out? Any idea why this is-I have talked to the service provider and they have led me to believe it is an Apple issue

    There is no anti-malware for iOS, at least none that actually does anything useful. The odds of getting any malware infection via an email attachment on an iOS device is quite low - practically non-existent. Unless you are seeing any issues, there isn't much to do, other than deleting the email and being more cautious in the future.

  • I am unable to use Iboost app, when i try to use it, I get an error "iBoost App is damaged" and reinstall from app store. I get the same error even after installing a fresh copy. Need help to resovle this issue.

    “iBoostUp.app” is damaged and can’t be opened. Delete “iBoostUp.app” and download it again from the App Store.
    Because of the above error, i am not able to use iboostup application. I have even tried to reinstall from app store, but the issue still continues.
    Need help.

    Perhaps the damaged file is an auxiliary file outside the app bundle and stored elsewhere on your Mac. Try deleting the app and all it files with an app for that purpose. Afree one is AppCleaner;
    http://www.freemacsoft.net/appcleaner/

  • Recently i started getting repeated download of the same email even after reading it and often after moving it to trash.

    i have outlook accounts. sometimes it works properly. sometime i get repeat download on one account, sometimes two or rarely three. this is new within the past few weeks. i run win8.1 up to date. thunderbird is up to date. i have made no configuration changes on my thunderbird settings. this is driving me crazy. i use norton internet security. i tried turning off email scanning. made no difference. it seems that the only sure way is to empty my trash, which i like to delay. sometimes i don't have to empty the trash...

    i continue to have this problem and it is driving me nuts. i get the same messages repeated. somehow there is a failure in communication between TB and my outlook account. everything seems to be configured appropriately.
    your suggestion to uninstall TB and do a new install seems wise. i don't want to lose any saved messages, etc. is there an easy way to backup the TB data?

  • Why does firefox call IP 208.53.130.221 on startup? Even with blank page? And keeps trying the same address even after is shut down? No other browsers does it!

    I can see it via my firewall log; checked for malware, nothing found. It's like Firefox is trying to report somewhere, and it's always the same IP address. I even stopped using firefox all together. Opera doesn't display the same problem, neither does the IE, so this is firefox related.
    Even though I have 3.5.2 now, this is a roll back from the later version - I thought it might be related to later updates, but no, 3.5.2 does the same thing.

    It's the forums that make the image tiny, if you do a right-click > copy shortcut, you can then paste it into a new tab, which will let you see the full size image. It's a 3360x1050 image, maybe a bit big for the forums.
    Basically though, the left image is IE, and that shows an error box. The centre image is Opera, and that shows an empty screen. The right image is FF, and that is how it should look.
    If it's a machine specific error, then I can't work out why it is on several machines in my house... very odd.

  • Error compilng servlet - even after including servlet.jar in classpath

    I have the tomcat installation , which shows the default page on stating the tomcat.
    I have my classpath set to -
    set CLASSPATH=c:\tomcat4.1\comman\lib\servlet.jar;c:\j2sdk1.4\lib\tools.jar;
    set PATH=c:\j2sdk1.4\bin;
    I have a greetserv.java which is a simple example servlet. When i try to compile this, it gives me the error javax.servlet.jar does not exist.I have it included in the classpath, but it still doesnt work.
    Any help will be appreciated.
    Thanks,
    Jyothi

    What is javax.servlet.jar?

  • Why I keep getting same messages even after compacting?

    I read my mail in the AM and delete most but will get the same messages again sometimes two or three times. I do right click and hit compact several times a day. This has been and issue for a month or two?

    To diagnose problems with Thunderbird, try one of the following:
    *Restart Thunderbird with add-ons disabled (Thunderbird Safe Mode). On the Help menu, click on "Restart with Add-ons Disabled". If Thunderbird works like normal, there is an Add-on or Theme interfering with normal operations. You will need to re-enable add-ons one at a time until you locate the offender.
    *Restart the operating system in '''[http://en.wikipedia.org/wiki/Safe_mode safe mode with Networking]'''. This loads only the very basics needed to start your computer while enabling an Internet connection. Click on your operating system for instructions on how to start in safe mode: [http://windows.microsoft.com/en-us/windows-8/windows-startup-settings-including-safe-mode Windows 8], [http://windows.microsoft.com/en-us/windows/start-computer-safe-mode#start-computer-safe-mode=windows-7 Windows 7], [http://windows.microsoft.com/en-us/windows/start-computer-safe-mode#start-computer-safe-mode=windows-vista Windows Vista], [http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/boot_failsafe.mspx?mfr=true" Windows XP], [http://support.apple.com/kb/ht1564 OSX]
    ; If safe mode for the operating system fixes the issue, there's other software in your computer that's causing problems. Possibilities include but not limited to: AV scanning, virus/malware, background downloads such as program updates.

  • Thunderbird keeps downloading the same messages even after deleting from trash folder

    Also get this message no when emailing one of my groups " is not a valid e-mail address because it is not of the form user@host. You must correct it before sending the e-mail."

    Hello, could you please provide the following information?
    * What type of email account is it (IMAP or POP)?
    * Who is the email provider (GMail, other webmail, self-hosted..)?
    Please consider creating a new thread about the groups email issue. Having one thread per question makes it easier to answer, read and search for them.
    Doing so will also allow the Mozilla volunteers to give you solutions that are more helpful to you. This may help them to solve your problem faster and more efficiently.
    Thank you!

  • Yosemite: preview opens all pdf's in same window even after setting change

    After upgrading to Yosemite, Preview always opens new pdf's in prior window with sidebar including other documents. I have changed the setting "when opening new files" to "open each file in its own window" and restarted the program and the computer more than once since. No fix.
    This is extremely irritating and creates an extra step of me having to double click the new document  each time it is opened in order for it to open in its own window as the settings already dictate.
    This affects my workflow and is a real nuisance, thanks in advance for any guidance.

    It's controlled by a global setting in System Preferences -> General "Restore windows when quiting and re-opening apps.  Uncheck it.
    Steve

  • Plugged AE directly into my stereo. Continue to get flashing amber light even after resetting.

    My iMac is connected wirelessly to a Linksys router. I can see the AE in wireless connections but I cannot get AE to the green light. What I am missing?

    Just saw the info on blinking lights and was able to resolve my problem.

  • Synchronisation Problems - LR5 Continually reports new pictures to Import, even after syncing

    I have noticed this happening more and more. I move an image folder in to my Pictures hierarchy that LR is managing. I then "sync" to get LR to recognise the folder and put in to Index... which happens OK.
    However, If I sync again immediately, there are a whole bunch of other images that LR seems to count as needing importing, a small fraction of which actually seem to get re-imported again.
    I've tried rebuilding catalogue - doesn't seem to be any different.
    Are there perhaps some output images somewhere that are causing problems?
    Or anything else obvious I am missing?

    My thanks to Rob, Peter and DdeGannes for comments and advice. I eventually ended up contacting Adobe re the problem, and after a number of unsuccessful attempts to get LR5 working using the 'original' catalogue we deleted the old catalogue and recatalogued. This overcame the problem and LR is up and working again. Fortunately recataloguing wasn't an especially onerous taks because I've only just started using LR and the catalogue wasn't excessively large.  Unfortunately we didn't manage to figure out what the cause of the problem was, but it doesn't appear to have been a corrupted video or photo file because all photos/videos are now catalogued without change. Nor does the problem appear to have been due to starved resources as the recataloguing was completed without freeing up additional resources.  However, the point was taken and I've now freed up some resources.  Perhaps the problem was a corrupted preview - but I guess we'll never know!  Regards.

Maybe you are looking for