Preventing the User from going back to the main page after logging out.

Hi all,
In my project I want to prevent the User from going back to the Main page, by clicking the back button of the browser, after the user has loggged out.I had invalidated the session so the user will not be able to do any operations, but he can vew the infos. I want to redirect to the login page if the user tries to go back using the back button after he has logged out.
I tried the same in this forum after loging out. Surprisingly it is the same. I can browse through all the operations i did even after logging out from here.
Is it not possible to do that in Servlets?Could somebody help?
Thanks,
Zach.

Hi,
You can use a servlet filter to do this , as it can interceptany request to your application you can decide to allow user access or not to any page/servlet.
public class Test implements Filter{
     public void destroy() {
     public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain arg2) throws IOException,
               ServletException {
          System.out.println("filter");
          HttpServletRequest request = (HttpServletRequest) arg0;
          if(!request.getRequestURI().contains("index")){ // set condition that will be checked to verify if the user is logged in
               System.out.println("redirecting ... ");
               RequestDispatcher d = arg0.getRequestDispatcher("/index.jsp");
               d.forward(arg0, arg1);
          arg2.doFilter(arg0, arg1);
     public void init(FilterConfig arg0) throws ServletException {
}in you web.xml add :
<filter>
          <filter-name>test</filter-name>
          <filter-class>test.Test</filter-class>
     </filter>
     <filter-mapping>
          <filter-name>test</filter-name>
          <url-pattern>/*</url-pattern>
     </filter-mapping>

Similar Messages

  • I have problem that changes i make wont be saved it all goes back to the same date that i had this problem for EX: when i ever change my desktop photo and reopen the macbook it goes back to the same photo that i had before.

    i have problem that changes i make wont be saved it all goes back to the same date that i had this problem for EX: when i ever change my desktop photo and reopen the macbook it goes back to the same photo that i had before.

    Might be corrupted preferences ..
    Open the Finder. From the Finder menu bar click Go > Go to Folder
    Type or copy paste the following:
    ~/Library/Preferences/com.apple.desktop.plist
    Click Go then move the com.apple.desktop.plist file to the Trash.
    Restart your Mac and try changing the desktop photo.

  • How to privent the users from resizing/maximizing/minimizing the mdi window

    In http://forms.pjc.bean.over-blog.com/60-index.html i read about 'A JavaBean to handle the Forms applet's frames' .
    In formsframe.java It is written that the author is Francois Degrelle so i want to ask Francois: My goal is to privent the users from resizing/maximizing/minimizing the mdi window. I have jre 1.6.0_10 which jar file do I need formsframes5.jar or formsframes.jar (those files are in formsframes.zip)
    thanks

    lidochca wrote:
    Hello, please help me to solve the problem !!Key Loggers, Spyware. The solution is not to write such reprehensible crap.

  • When I use my ipod in the car it goes back to the start of the track every time i start the car. why is this?

    When I use my ipod in the car it goes back to the start of the track every time i start the car. why is this?

    Only if you backed them up somewhere.

  • Re: after updating the app Flight Tycoon, i cannot access the game. Each time I click on the app it goes back to the main page.

    Re: after updating the app Flight Tycoon, I cannot access the game. Each time I click on the app it goes back to the main page.

    Send a bug report. And wait for an update.
    OR
    uninstall and re-instal the game all over.

  • My computer crashed and all my music is gone. Can i put the music from iPhone back on the computer?

    my computer crashed and all my music is gone. Can i put the music from iPhone back on the computer?

    Yes you can. There are few ways to do this, assuming that itunes with your library doesn't work anymore.
    You can try with a freeware software for Windows named
    iPhone PC Suite
    Another way is to install on your iPhone an app that shares your music. I have one, it's called SongExporter.

  • Was there a problem with the last update? Every time I try to watch a video on the net it goes back to the home screen

    Was there a problem with the last update? Every time I try to watch videos it goes back to the home screen

    - 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.
    - 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          

  • I'm on a website that states it requires a client certificate to validate identity.  When I select a certificate to use to connect to the website, it goes back to the list of certificates.  I can't seem to get anywhere. Help!

    I am on a website that requires a client certificate to validate identity.  When I select a certificate to use, it goes back to the list of certificates. I can't seem to get anywhere. Help!

    You should be given the certificate, or cookie, by the website.  See if in Preferences (under Safari on the menu bar), Privacy, do you have certificates blocked Always?

  • Cannot prevent authenticated users from creating a blog on "My Page"

    I have a brand new Snow Leopard (10.6.1) 2.26 Ghz quad core Xserve with 12Gb RAM that will be used for web collaboration services. I've currently set up Wiki and Blog services with a group membership to allow creating wikis/blogs. The reason for this is for staff development purposes with the plan to add people into the group as they are trained. The process to set it all up was very simple, however, I'm having an issue preventing authenticated users from creating a personal blog. Although I can prevent the creation of wiki's to members of a group easily, any authenticated user on the server can log into "My Page" and will be able to create a blog. I've gone to server admin>choose the server>choose the "access" icon and set the column "for selected services below" (blog) to "allow only users and groups below" (the group) and it still doesn't prevent them from making a blog page. In WGM for the group on the "Basic" tab, the "enable the following services for this group" has only the choice of "none" and therefore since the site isn't showing as a choice, the Wiki, Blog, Calendar and Mailing List is grayed out. I've seen another thread that states in 10.6 that option for setting the service acl in the group settings of WGM is unavailable. Does anyone know a fix for my problem of security access for a "My Page" blog or is it a possible bug in Snow Leopard? Right now my only workaround is to remove the users access and enable it as they are trained. This isn't an ideal fix, however, because we have some users who want to limit their wiki or blog to authenticated users only, not public access. Any help will be greatly appreciated.
    Message was edited by: dstrollo.il

    Ran into this same issue.... Talked with a field engineer who confirmed the behavior. The question now is this a defect or "feature that does not work as as the audience desires". As I far can tell, the security setting for blogs in server admin does nothing at all. This has the potential to cause a few issues as you cannot limit who can have a blog.
    Message was edited by: jlindler

  • Why does firefox keep going back my a previous page after i want to go elsewhere?

    when I am in google looking for images and i go to change my search criteria, firefox goes back to the previous page i was on right after i hit my arrow to go. then i have to do this time and time again. and it's getting frustrating!

    Hello Mandy.
    I can't think of a scenario where Firefox would make itself the default browser against the user's consent. Still, go into Tools > Options > Advanced > General > System defaults and untick that small box at the bottom of the window that talks about Firefox asking you each time it starts.
    Hopefully that will fix the issue.

  • Back button does not work with some web sites to return me back too Firefox main page after concluding business on site.

    After connecting to a web site and completing tasks, I use back button too return too Firefox main page. After using back button to get back to the original site log in page the back button (after repeated uses) will never get me off the web page and back to the Firefox main page. At this point the only way too get back too Firefox main page is too shut down Firefox wait 60 seconds and restart Mozilla-Firefox.

    Some web pages are coded to redirect you forward to another page. In that case, when you go back to the page, Firefox redirects you forward again.
    To bypass this, use the history drop-down next to the back and forward buttons. The drop-down has the most recent pages on top, and older pages below. Jump as far down the list as you can, then repeat as needed to get back to the first page.
    Does it work?

  • On a online game.when i log in thats ok.when i want a location in the game.it goes back to the log in screen again

    when i log in to this web site it opens the game screen. when i then want to go to a different location in the game. it resets back to log in screen again.
    but it works ok on all other sites.
    == URL of affected sites ==
    http://s3.travian.co.uk/dorf1.php

    "Clear the Cache": Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove the Cookies" from sites that cause problems: Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]

  • How can I select more than one bookmark at a time so that I can then open multiple bookmarks -- without the aggravation of going back to the list and selecting and opening each one.

    From my dozens of bookmarks, I often would like to open 5 or 6 of them at once -- perhaps a couple of weather reports, a couple of radio stations, a couple of other websites. But I see no way of doing this without laboriously finding a bookmark, selecting it, opening the website, then returning to the bookmarks, finding the second bookmark, selecting it, opening the website, and on and on. Surely there's a way for me to select multiple unrelated bookmarks and open them at the same time. Thanks much for your help. Don

    ''Actually there is a picture and better explanation in the corresponding History article''
    * ''http://kb.mozillazine.org/Viewing_the_browsing_history_-_Firefox ''
    Look where this picture is embedded in the article topic [http://kb.mozillazine.org/Viewing_the_browsing_history_-_Firefox#Selecting_history_items Selecting history items]
    * http://kb.mozillazine.org/images/Fx3_history_sidebar_selections2.png
    Selecting, viewing, and searching the sidebars and library lists is explained in both articles previously mentioned.
    Multiple selection is something built-in to a lot of applications and into all browsers, and yes you guessed correctly the favicon it the thing to the left of the bookmark and that is what is is called in all browsers. And if you look at selection you will find that it matches what you asked for, especially if you were to do a search from the search bar on the bookmark or history sidebar. But there is also no problem opening up a single bookmark or history item into a new tab, with either Ctrl+click or Ctrl+Shift+click in the area to the right of the favicon either.
    However I would suggest making a change to your configuration options so the the same keyboard shortcut is used from a link and from your bookmarks. See those keyboard shortcuts in the following along with the footnotes just below the table for them in
    * http://www.mvps.org/dmcritchie/firefox/keyboard.htm

  • After extracting the Beta 4, when I click the Icon on the desktop, it goes back to the download page of 3.16.

    I had a pop up on opening firefox that I should upgrade to 3.16, so I did.
    After extracting installing, when I click the firefox icon on the desktop, I get a download page to 3.16.
    I uninstalled Firefox. Restarted the machine and downloaded the Beta4.
    After it installed, when I click the firefox icon on the desktop, I get to the download page of 3.16.

    First you should try logging out of your iTunes Store account (settings > iTunes Store > accounts) and then back in again.
    If that doesn't help, try resetting the Apple TV (Settings > General > Reset > Reset all settings). You should also try restarting your router.
    If both of the above don't help, you should try a restore (Settings > General > Reset > Restore).

  • How can I change the time of photos in info in iPhoto for iOS. I've done it in iPhoto for Mac but when I sync to my ipad the info field goes back to the camera time ignoring "modify original files" in iPhoto for Mac?

    I used "adjust date and time" and"modify original files" to correct the time of photos taken on a camera used in Peru which was set to UK rather than local time. which is 6 hours  behind. This was to bring them into line with shots taken with other cameras set to local time. This was using iphoto 08 on a Mac. I then synced to my iPad. The photos stayed in the correct order in photos but in iphoto (iOS version) the original dates appear (the camera dates) and so the photos are out of chronological order again. This looks like a bug but is there a fix?

    don't know what you mean by "write to master" but speculate that it means modify the original times, in which case the taken times on the camera should no longer be present
    No,I meant your using the option "modify original files" will do exactly that - change the capture date original master files stored in the iPhoto library. Only when you do that, the "date modified" of your original files will be changed as well, and it will now be the date of your manipulation of the capture date.
    Oh - I hadnt considered that possibility - but of that were the case, why don't my manipulated photos go to the end of the sequence as I have done all the manipulation after the end of the holiday??
    In photos the synced album maintains the chronological order which I set up on the mac by modifying the originals, as you said,
    That is what the linked article is describing: "some apps may sort your photos in the order you specify in the app (such as iPhoto or Aperture"
    The problem I have is that, in the album, iphoto (ipad) sorts them differently to both iphoto (Mac) and the photos tab on the ipad
    In addition to albums and events, synced photos appear in a unified category called Photo Library (on iPad, this is the Photos tab). Photos are not duplicated. This category will also sort photos in ascending order by the date modified.
    "on ipad this is the Photos tab" - but this displays as per the original sequence ignoring time adjustments - the manipulations seem to be ignored (but are reflected in the album in the photos tab) and the photos tahat have been modified stay in their original positiom - they don't get put the end
    Because the library uses a different date - the date modified - the date of the last time the file has been changed in any way - any editing you do to your image, including adjust date and time will change the "date modified"
    This may change the sorting of the database but it appears not to influence the order in the albums
    In addition to albums and events, synced photos appear in a unified category called Photo Library (on iPad, this is the Photos tab). Photos are not duplicated. This category will also sort photos in ascending order by the date modified.
    So how can i get my photos in date and time order in an album in iphoto for ipad?
    Thanks for your help

Maybe you are looking for

  • Camera raw cs5.5 in windows vista 32 bit

    I have to install Photoshop again. Version is CS5.5 on a windows vista 32 bit system. It did what it needed to do. Photoshop runs, Bridge runs. That is all I need. However it installed only camera raw 6.0 something. For my files I need at least camer

  • Ethernet port not connected

    Hello, Since a couple of hours, my Ethernet interface (through a Thunderbolt or USB connector) remains "not connected". I couldn't find a clear answer to this problem ... Any idea ?

  • Mid 2007 macbook being too slow?

    I purchased my macbook in mid 2007 and it is covered under applecare till September. For the past couple months it has become increasingly slow. Sometimes when I go to wake my computer it ends up shutting down and waking it up makes it restart, somet

  • Oracle RDF Rules Semantics

    Hi, Are the semantics of the rules for Oracle RDF documented anywhere? I'm not exactly sure what I can and cannot say. thanks John

  • LabWindows 2013 breaks LabWindows 2012 code

    Valid executable written in LabWindows/CVI 2012 will not compile in LabWindows/CVI 2103.  The error is compiler out of memory.  The error syntax includes suggestions to fix this problem by basically segmenting code into smaller c files - rewrite the