Is there such thing as a "pre-action"?

I'm wondering if there is such thing as a "pre-action" that would get executed before a page is displayed rather than an action that gets executed as a result of submitting a form?
For example, I have an application that has 3 pages. Page 1 submits to page 2 and page 2 submits to page 3. I want to make it so that a user couldn't just access pages 2 or 3 without going through the preceding pages.
I'm thinking of creating a bean property something like page1Validated that would return a boolean. Then, have a check so that if page1Validated isn't true, if the user attempts to access page 2 directly (which normally, they shouldn't), it redirects them to page 1.
So, basically, I want to have some conditional code that runs before the page is executed that optionaly does a redirect to another page.
I'm thinking that I could do this using a servlet filter. Has anyone else ran into this problem? Is using a filter the recommended approach to solving this problem?
Jon

Another thing that I need to figure out is how to prevent the user from attempting to access the page as a .jsp rather than a .faces file (I have a servlet mapping to map all requests for *.faces to the Faces Servlet). I used to put all my .jsps in the WEB-INF directory to handle this back when I was implementing my own contoller. I asked this question previously, but, never received a response.

Similar Messages

  • Is there such thing as a "compile and execute statement" in Java?

    I wanted to know if there's any way to compile and execute a program "within" another program.

    Yes, but the classes to do so aren't officially supported by Sun as far as I know.
    And you must be able to assume a thing or two about the stuff you compile, such as existing constructors or factory methods etc, otherwise it gets hairy.
    Here's some example code (haven't tried it, so excuse any spelling errors etc) to compile the source code in a file called MyClass.java:
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    new sun.tools.javac.Main(baos,null).compile("MyClass.java");
    String theMsg = baos.toString();
    if (theMsg.length() > 0)
        // NiftyErrorHandlingHere
    }After that, you can load it with a simple ClassLoader.loadClass() call and create instances of it.
    It must be compiled with the tools.jar file in the classpath, to find the sun.tools.javac.Main class.
    However, for any such dynamically compiled class to be of any use to you, you must be able to assume something about it, such as implementing interfaces or whatever, otherwise it's a kind of pointless exercise.
    HTH,
    F

  • Nokia Theme Creator.Is there such thing?

    Is there any Theme Creator,so i can create my own themes?
    Im using Nokia X3-02..
    Thanks.
    Solved!
    Go to Solution.

    I have asked one question there, so we shall see if I get some answer there.
    Regarding the topic you gave the link to - it appears that it's been closed for some time. Also, the link provided in the lastest post there doesn't work - it is being redirected to http://developer.nokia.com/resources , and from there I cannot find any Carbide, nor the one that would be working for my phone.
    Also, that entire subsection has been archived, so I asked my question about it here. I hope that's the best suiting place for me to get the answer.
    I did try to look for it at Google, but no success. :-(

  • Is there such a thing as Iphone Virus

    Im having a problem getting my iphone to turn on. when I link it to my computer its says the usb failed. Try another one and the same thing? Is there such things are iphone virus

    Juleslye wrote:
    ? Is there such things are iphone virus
    No. >  https://discussions.apple.com/message/22315137
    Juleslye wrote:
    Im having a problem getting my iphone to turn on.
    See Here for  >  Frozen or unresponsive iPhone
    Try this First... No Data will be Lost...
    Press and Hold the Sleep/Wake Button and the Home Button at the Same Time...
    Wait for the Apple logo to Appear...
    Usually takes about 15 - 20 Seconds... ( But can take Longer...)
    Release the Buttons...
    Juleslye wrote:
    ... when I link it to my computer its says the usb failed.
    Try another USB Cable.
    Make sure you have the Latest Version of iTunes (v11) Installed on your computer
    iTunes free download from www.itunes.com/download

  • Yesterday i bought this application from the apple store and i was totally chocked when it happened to be in russian. I cant understand it or use it. So my question is, can i turn it back and get a refund ? Or there's no such thing ?

    Yesterday i bought a microsoft office app for my ipad 3 from the apple store and it happened to be in russian. Im unable to understand it or work on it, so my question is can i turn it back or get a refund ? Or there's no such thing ?

    Get a refund
    http://www.labnol.org/software/itunes-app-store-refunds/13838/

  • Is there such a thing as a black macbook from 2009?

    I've been told there is no such thing, it has 2GHz processor and 2GB of 667MHz ram and that it is an older model than a 2009. Any help appreciated, thanks.

    Go to the Apple in the upper left corner and select About This Mac, then click on More Info. When System Profiler comes up check the Model Identifier.
    1,1 is an Early 2006
    2,1 is a Late 2006 or Mid 2007
    3,1 is a Late 2007
    4,1 is an Early 2008 which was the last Black MacBook
    Check out http://en.wikipedia.org/wiki/MacBook#Model_specifications
    And http://www.everymac.com/systems/apple/macbook/index-macbook.html
    Also http://www.apple-history.com/?

  • Is there such a thing as to much memory for my macbook pro?

    I wanted to buy this caddy and install a SSD where my dvd/cd drive is. just curious is there such a thing as to much memory? I dont want to mess up my motherboard  or fry anything. The youtube video i saw has a guy swapping out his Dvd/cd drive with a ssd and his macbook pro (which is same model as mine) had no problems just want a second opinion. Right now I have a 730gb HD
    this is the link for the caddy.
    http://www.amazon.com/gp/product/B004XIUQYA?ie=UTF8&tag=shopfaster0c-20&linkCode =shr&camp=213733&creative=393177&creativeASIN=B004XIUQYA&=electronics&qid=135673 8142&sr=1-9&keywords=optical+drive+adapter

    If I were you, since you'll want the SSD to be the boot drive, I would install the SSD in the current HD bay and put the spinning drive in the optical bay. MacBook Pros have a preference for the boot drive to be in the main bay and you're just asking for trouble if you install it in the optical bay.
    I didn't look at your Amazon link, but I can recommend OWC's Data Doubler - likely higher in price than your Amazon choice, but I don't know of anyone who has had problems with them.
    And, no, there's no such thing as too much storage space!
    Good luck,
    Clinton

  • Is there such a thing as a byte array

    I have an array of chars in my c code which I need to pass an array to from my Java code. I was just wondering what the equivalent is in Java is there such a thing as a byte[]

    You have declared param as an int and therefore the compiler notice that the assignment to that byte array may result in loss of some bits. To prevent the warning you need to do an explicit cast to byte:
    m_writeBuffer[0] = (byte)(param>>8);
    m_writeBuffer[1] = (byte)(param & 0x00FF);Not that you would have to do the same even if param was declared as byte because java performs all operation on bytes as int.

  • Is there such a thing as "Apple web security"  I have a pop up trying to get me download something

    Is there such a thing as "Apple web security"  I have a pop up trying to get me download something. It says Apple Web Security detected Trojans...thanks

    No.  Set your browser settings to not receive pop ups.  It's done through your browser settings.

  • Is there such a thing as a "silver iPod"?

    Is there such a thing as a "silver iPod"?
    I've heard of the white and black versions, but a friend tells me there's a silver version available.
    Is she talking rubbish?

    The only all silver iPod to date was the iPod Mini which if memory serves me right came in Silver, Blue, Green and Pink. Full size iPods and Nanos have black or white fronts with a metal (silver if you like) back.

  • Is there such a thing as a universal color laserjet driver?

    Is there such a thing as a universal color laserjet driver?

    Greetings,
    Yes, there is a UPD for color LaserJets.  Please look at the following URL:
    http://h20338.www2.hp.com/Hpsub/cache/494717-0-0-2​25-121.html?jumpid=reg_R1002_USEN
    ---- If my answer was helpful please click the "Kudos" star.
    If your problem is solved please click the "Accept as Solution" button ---->
    I work for HP
    ~K

  • Is there such a thing as a USB WIFI adapter that works with OS X 10.9?

    Is there such a thing as a USB WIFI adapter that works with OS X 10.9? I have tried 3 different models, none of which were compatible. The built-in WIFI card in a 2012 Mac Pro is absolutely crap (0/10 on the performance scale). Any recommendations?

    Hey everyone, yes I have installed the drivers properly. I've used an ASUS, Bolse, and EDIMAX adapter. Some had a 10.8 driver, some had 10.9. After reaching out to customer support for each and every one of these companies for help, and through multiple returns, I have not gotten anywhere with any of the drivers or products.
    It's getting ridiculously hard to stay an Apple customer when the quality of their products are getting worse and worse, which leaves me no choice but to go to third parties to replace the faulty hardware.
    And honestly I'm just sick of calling India every day to get my issues resolved.

  • Why is apple lying about chat support? there is no such thing!

    There is no such thing it seems, impossible to find! "top right hand side the apple store page"...yeah right!!

    Where do you see anything anywhere that states that chat is available in the iTunes Store?

  • TS2446 Is there such a thing as Apple Support Team asking for my email and password?

    Is there such a thing as Apple Support Team asking for my email and password?

    No.
    It's a scam. Delete it.

  • Oracle 10g Personal Edition?  Is there such a thing? Tks

    Oracle 10g Personal Edition? Is there such a thing? Tks

    Yes it is : http://www.oracle.com/database/product_editions.html
    Nicolas.

Maybe you are looking for

  • Copying Bootable Drive C: to Second Hard drive

    In Win98se, I could take "Partition Magic 8" and simply copy c: to the next drive, shut down, unplug the original drive, and set the jumper on the new (bigger) drive to Master, and I'd have a bootable bigger drive. This is not working on XP. I did th

  • Singleton vs static - which is better?

    Of the two approaches - a class which can be used by accessing its ONLY instance(singleton) or a class which has a set of static methods which can be invoked on the class itself which is better and why? Or are these just two 'styles' of programming?

  • How to resolve the 0xE8000001 error??

    please help me, my iPod Touch 4g doesn't want to connect with iTunes

  • HttpUrlConnection.getInputStream() does not return for a particular website

    Hi, In my code, I am using an instance of java.net.HttpUrlConnection to "get" a web page. I am able to do it for all websites - except a particular website [Summary is at the end of this post]. The program hangs [for 10+ minutes and then throws an ex

  • How to install SSL?

    I am using oc4j as app server and apache as web server. I read from doc that we need the module mod_ssl for using ssl in apache. (According to http://technet.oracle.com/docs/products/ias/doc_library/1022doc_otn/index.htm) I have searched for this fil