OnPageLoad method for some pages

I'm looking for a way to call a method on or before a page loads, so that I can redirect the user. The idea is to only let the user view a couple pages if they havent paid for the service yet, but have signed up. I've already implemented Form/Container based authentication and dont want to have to us anything as "big" and bulky as JAAS. Can I do this
Current I have a "hacked" solution that looks something like this:
/mysite/somepage.xhtml contains
#{someBean.hasPaid}
<bunch of code>
</bunch of code>
which then calls the someBean.myPaid before the page loads, but this feels clunky.
Is there anything else I can use? Maybe PhaseListeners? I dont quite understand how i would go about using those though?

Use a Filter or a PhaseListener.
If you need access to the FacesContext and some JSF managed beans, a PhaseListener is more suitable than a Filter. If you want to act on specific URL's only, a Filter may be more suitable. To create a Filter, implement javax.servlet.Filter and define it in web.xml. To create a PhaseListener, implement javax.faces.event.PhaseListener and define it in faces-config.xml.

Similar Messages

  • CSS Flexbox - a new layout method for web pages

    Hi,
    As you may all know, css flexbox is a new layout method for laying out your web page, and with Firefox releasing version 22 within the next few days, (should have been yesterday) it is now no longer hidden behind browser settings. Add to this the fact that all desktop browser except IE10 and Safari 5 & 6, no longer require the use of a vendor prefix, and that http://html5please.com/ simply say ’USE’, flexbox is now finally a viable layout alternative, especially for responsive layouts.
    Flexbox has been available on all Android and iOS devices, (and any device using the webkit engine, e.g. new blackberry’s and Kindle Fire devices) since they were first release.
    To help find problems, and provide help in using flexbox, we would be grateful if you would experiment and provide feedback in the use of flexbox for layouts.
    To help you get started a video tutorial, (with files to download) and examples of layouts, (more to be added next week) and tips & tricks to help with some of the more common problems have been provided at http://flexboxlayouts.com/. This site will also be updated to provide you with a list of problems and hopefully the solutions to those problems, so that you will have a ’one stop’ reference site for using flexbox.
    If you have any tips in using flexbox, or a flexbox layout that you would like added to the site, then you can use the ’Submit’ email address on the http://flexboxlayouts.com/ site.
    For more info on the css flexbox specifications see -
    http://www.w3.org/TR/2012/CR-css3-flexbox-20120918/
    or if you just want to know what property is supported by which browser/device -
    http://flexboxlayouts.com/pdfs/flexbox%20browser%20Properties%20.pdf
    Note to regular contributors & moderators:
    As I only have time to visit and help in the forum for a few hours per week, should you find any flexbox problems unanswered then please let me know via email.
    PZ

    Hi Al
    Yes I know, and this is why I am asking people to experiment with flexbox.
    The fix for IE10 is to give the right hand sidebar, (or the content) a larger flex-grow property, the bug is caused by the flex shorthand property not recognizing % values, and using the flex-basis as a set width instead of a preferred size.
    I have logged the bug, (and many others) with the various browser bug bases.
    This and other bugs, do have 'fixes', so I hope users will experiment with flexbox and provide feedback.
    Flexbox is no different than any other css feature, "we can only find the problems in actual use".
    Strangely enough, I have found the most consistent to use is the old 2009 implementation on mobile devices, (no doubt iOS7 will change all that ).
    PZ

  • Page Background Lost on Regions above Content Area for Some Pages

    Hi - I am a iWeb novice, but not a total rookie on this kind of software...
    I have a simple iWeb project that applies a gradient fill to the page background, and applies one of the gradient colors to the Browser background on every web page. I am using the "White" theme, and I have trouble with the "Photos" page template drawing Page backgrounds correctly. I have my content area set wider than the default to 1008 pixels to fill a 1024-wide display. I set my display area to 877 pixels high to coincide with the largest media dimension that I see with the inspector.
    I looked here for previous discussions on this and failed to find anything. Maybe I missed a post...
    Initially, most web pages load and display correctly the first time. One Photos web page, however, displays the Browser background - not the Page background above the centerline of the page name.
    On several pages with a "Photos" template (but not all), the initial page is displayed correctly. But, when I click on a photo thumbnail and the page is revised to display the larger photo image in the content area, the Browser background is displayed in error above the content area, and the Page background displays correctly below the top of the content area.
    I have looked for some consistent issue or characteristic that might let me predict when this problem occurs, but it ll looks rather random. It is repeatable, though - clearing caches and reloading the same page exposes the problem the same way a second time for the same page, in other words...
    Is this a bug, or something subtle in placement or overlap of areas on the page that I haven't noticed? Anything to be careful with to avoid this problem?
    Thanks anyone for any advice!
    Brian
    Message was edited by: Brian Crowe1

    Hi Cyclosaurus and Apnewbie -
    Thank you for your interest and replies. Here is a simple page that illustrates the problem I am having with a Page Background Gradient Fill on top of a Browser Background Solid Fill
    http://web.mac.com/bccrowe/Troubleshooting/KyliesArt2.html
    Here, I intend the page from the very top to the bottom of the defined content area to transition from pink to white as the eye moves left to right. The browser background is also pink to add some depth to the image - that's what you will see when the page loads.
    Click on the child's drawing to present the image, and you should see the gradient disappear above the centerline of the second text box (above the comment area) when the page finished loading with the large drawing.
    The Content area coincides precisely with the bottom of that second text box. I have tried to move the content area further below the text boxes so that they are not imtimate - no difference. I haven't tried to separate the text boxes, yet.
    The two text boxes immediately above the content area are 45px x 630 px (18 pt text) and 30 px x 630 px (14 pt text) - they overlap by about 10 pix.
    The content area that displays the thumbnail is 1008 px x 445 px (I thought that I set that at 877px...). I can try to set the content area to 877 px... Maybe this is the problem - maybe the Page Background shifts down to coincide with the bottom of the next page#2... Hmmm...
    When you click on the thumbnail, the page#2 content area is 1008 px x 877 px.
    In iWeb, this all looks the way I want it to.
    Please diddle with the page, and ask me any new questions! I appreciate your insight and help. In reality, Kylie won't notice the background change, but my next objective is a corporate site - this child's site is my "training" site. iWeb is really pretty flexible and easy to use. If I there's a work-around or something to avoid, I can live with iWeb just fine.
    Thanks again -
    Brian

  • Bookmark method for a page is not getting called

    Hi,
    I am developing a simple ADF application which contains two jspx pages, in JDEVELOPER 11g (build JDEVADF_MAIN_GENERIC_080910.1420.5124).
    I have a commandLink in Page1 which takes me to the Page2.I have a bookmark method for Page2, which gets called when I load the page.
    When I access the Page2 directly,the corresponding bookmark method is getting called.But when I navigates it through commandLink provided in Page1,the bookmark method is not getting called.
    Page1.jspx:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document maximized="true">
    <af:form>
    <af:commandLink text="Go to Page2" action="page2" />
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    Page2.jspx:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    xmlns:bib="http://xmlns.oracle.com/dss/adf/faces">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document maximized="true">
    <af:form>
    <af:outputText value="This is Page2"/>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    adfc-config.xml:
    <?xml version="1.0" encoding="UTF-8" ?>
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
    <view id="page1">
    <page>/page1.jspx</page>
    </view>
    <view id="page2">
    <page>/page2.jspx</page>
    <bookmark>
    <method>#{mBean.bookMarkMethod}</method>
    </bookmark>
    </view>
    <control-flow-rule>
    <from-activity-id>page1</from-activity-id>
    <control-flow-case>
    <from-outcome>page2</from-outcome>
    <to-activity-id>page2</to-activity-id>
    </control-flow-case>
    </control-flow-rule>
    <managed-bean>
    <managed-bean-name>mBean</managed-bean-name>
    <managed-bean-class>view.ManagedBean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    </adfc-config>
    ManagedBean.java:
    public class ManagedBean {
    public ManagedBean() {
    super();
    public void bookMarkMethod() {
    System.out.println("Inside bookmark method");
    Please look into this...........

    Hi Frank,
    I need to provide the af:commandLink inside af:table component and the values which I pass to page2 depends on the row I select at runtime.
    so,I am trying to use ad:setActionListener inside af:commandLink.
    If I use FacesContext.getCurrentInstance.getExternalContext.redirect() inside the actionListener of af:commandLink, I need to extract all the required values in the actionListener.
    Isn't there any way so that, I can pass the values using af:setActionListener inside af:commandLink and a method ( which will initialise the managed bean) will be called when page2 loads ???
    Regards,
    Lokesh.

  • Shortcut Method for Replace Pages dialog box

    What is the keyboard shortcut method for bringing up the Replaces Pages dialog box.  I use Replace Pages function a lot in preparing PDF documents and need a faster method than using Mouse on Tools right sidebar.  I note that shortcut key for inserting pages is Cntrl-Shift-I   --  what is shortcut for Replace Pages.  In previous Acrobat 9, I could use  alt-DNR, which brought up Replaces Pages dialog box via the menu, but there no longer is a Document item in the menu bar -- it has been removed.  Please, this is VERY important to me.  Any help will be greatly appreciated.

    Thank you for your quick reply.  You have confirmed my worst fear.  But anyway -- going forward .....  in your opinion, what is the best way to get information to Adobe on ideas for improvement so that future version or maybe even an update for this version could have something like what I need, that is, shortcut key for Replace Pages -- or ability to access customized quick tools via keyboard, etc.  Is there someone keeping a list of these things that I can write to?  Thanks again.  (And don't worry, I won't extend this discussion past your hoped-for reply.)

  • Hideing and showing a page or security for some pages

    i have developed an applciation where in which i want users to have acces
    to some pages and some pages are secured they can be viewed only after entering some credentials.
    how can we do this some body help me

    Create an authentication scheme and an authorization scheme (under Shared components)
    and in the page attributes (top left) you can select these schemes to be active for the page.
    Hope this helps.
    Leo

  • Sending email for some pages of a report

    Hi!
    I would like to know, is it possible to send via email some pages of a SAPScript.
    I've created a report, with SAPScript output. The report is collecting a lot of data, and is grouping the data by customer.
    So at the end of the report run, I have 5 pages, with a grouping like this:
    1. Customer A / Deliveries 1,2,3
    2. Customer B / Deliveries 4,5
    3. Customer C / Deliveries 6,7,8,9
    4. Customer D / Deliveries 10
    5. Customer E / Deliveries 11,12
    In the B, D customer master data exist an email address, so I have to send the 2nd page to the email address of B (for example [email protected]) and the 4th page to the email address of D (f.e.: [email protected]).
    How can I solve this?
    Thanx
    Tamá

    Hi!
    The following coding provides the SAPScript list, now. This is what I would like to extend with the email sending.
    The table it_fuvar contains the data of the customers and deliveries. I think I have to enter the email sending between the END_FORM and START_FORM function modules.
    My problems are:
    - is the OTF ready and convertable to PDF at this moment (after an END_FORM)?
    - if it is, then how identify it to convert  and how to send the converted PDF via attachment?
      DESCRIBE TABLE it_fuvar LINES fcount.
      IF fcount = 0.
        WRITE:/ 'Nincsen nyomtatható adat.'.
        EXIT.
      ENDIF.
      SET LANGUAGE sy-langu.
      CLEAR wa_itcpo.
      MOVE 'X' TO wa_itcpo-tdimmed.
      MOVE 'X' TO wa_itcpo-tdnewid.
      MOVE sy-repid TO wa_itcpo-tdsuffix2.
      MOVE sy-title TO wa_itcpo-tdtitle.
    * open form
      CALL FUNCTION 'OPEN_FORM'
        EXPORTING
          OPTIONS       = wa_itcpo
          dialog        = 'X'
          form          = gc_formname
          language      = sy-langu
        EXCEPTIONS
          canceled      = 1
          device        = 2
          form          = 3
          OPTIONS       = 4
          unclosed      = 5
          mail_options  = 6
          archive_error = 7
          OTHERS        = 8.
      IF sy-subrc NE 0.
        EXIT.
      ENDIF.
      MOVE 1 TO fcount.
      SORT it_fuvar.
      LOOP AT it_fuvar INTO wa_fuvar.
        AT NEW vstel_bez.
    * spedit&#337;r címadatok kiírása a scriptbe
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              window = 'M_SPEDIT'
            EXCEPTIONS
              OTHERS = 1.
    * cím, téma, számlázási cím kiírása a scriptbe
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              window = 'M_INFO'
            EXCEPTIONS
              OTHERS = 1.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'M_SZALLITASI_CIM'
            EXCEPTIONS
              OTHERS  = 1.
        ENDAT.
        AT NEW tknum.
          SUM.
    * kocsik (transzportok) kiírása a scriptbe
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'M_KOCSI'
            EXCEPTIONS
              OTHERS  = 1.
          fcount = fcount + 1.
        ENDAT.
    *   print item line
        CALL FUNCTION 'WRITE_FORM'
          EXPORTING
            element = 'M_ARUFOGADO'.
        AT END OF vstel_bez.
    * footer
          MOVE 1 TO fcount.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              window  = 'M_BOTTOM'
              element = 'NEW_PAGE'.
          CALL FUNCTION 'END_FORM'
            EXCEPTIONS
              unopened                 = 1
              bad_pageformat_for_print = 2
              spool_error              = 3
              codepage                 = 4
              OTHERS                   = 5.
          IF sy-subrc <> 0.
          ENDIF.
    * EMAIL SEND???
    * EMAIL SEND???
    * EMAIL SEND???
          CALL FUNCTION 'START_FORM'
            EXPORTING
              form        = gc_formname
              language    = sy-langu
            EXCEPTIONS
              form        = 1
              format      = 2
              unended     = 3
              unopened    = 4
              unused      = 5
              spool_error = 6
              codepage    = 7
              OTHERS      = 8.
          IF sy-subrc <> 0.
          ENDIF.
        ENDAT.
      ENDLOOP.
      CALL FUNCTION 'CLOSE_FORM'
        EXCEPTIONS
          OTHERS = 1.
    Thanx
    Tamá

  • History , Back and forward button to be disabled for some pages

    Hi ,
    There are buttons ( history, back and forward) just below the top level navigation in portal.
    Is there a way that some pages can be restricted in History , Back and Forward operations so that some pages cannot be captured with history , back or forward actions in portal.
    Best Regards
    Sid

    Hi Siddharth,
    If we open our framework page there is something called Page title bar. This contains History, Back and Forward button. If we make it disable it'll not be visible in our portal.
    So according to your requirement you can create a new framework page and can make changes in that framework page. Assign this framework page to a portal desktop and use it where you want.
    Please reward the points if it is useful.
    thanks,
    pankaj

  • Does WebDynPro have finalizer method for some ojects?

    I need to create object pool with guaranteed  call to destroy participated objects (DB Sessions) after end of some method execution,
    or owning object release.
    Does WebDynPro has such a method?
    How to implement it?
    thanks

    OK, very  thanks , that answer was presented on most seen place,
    (not always seen).
    what is unteresting - does it really guarranteed to be called?
    Happen at all experiments - is not "guarranteed".
    Are there any else ways?

  • Any lifecycle methods for view/page that can be triggered during Navigation ?

    Hi ,
    Say i have 2 views. I navigate from 1st view to 2nd View using App.to method. Now is there any lifecycle method that i can trigger in the view/page once the app navigates to 2nd view ?
    Regards
    Sakthi

    Hi.
    U mean go back to 1st view?
    Regards
    Pavan

  • Multiple users password for some pages on iWeb site?

    Hi guys,
    I've been checking out this topic here on AD, but not really happy with what I found. Is there anybody out here who could help me with a multiple users password html code??? I want a "members only" link on the homepage linked to a page where people have to enter username and password and then go to a special "homepage" where they can click to different PDF files. It doesn't sound that hard, but again, I don't like the html codes I found so far. Hope there is someone out here who knows something nice.
    Thanks!!
    Marc : )

    Marc ~ You may have to +"think different"+ to integrate the following suggestion into your iWeb site, but take a look at: http://drop.io/about
    Here's an example: http://drop.io/alancito
    ...the password there is: guest1
    You'll find a downloadable PDF document at the bottom of that page and note that drop.io didn't require an email address, name or personal registration to set up the above “drop”.

  • I wont to use IE for some pages and Firefox for others, but when I enter a url in IE, Firefox loads and opens the page

    I use IE 8 and the latest version of Firefox in XP.
    I'm a web designer and I want to test pages in both explorers but sometime i enter a URL in IE and Firefox opens and loads the page. How can I stop this happening?

    See http://kb.mozillazine.org/Website_colors_are_wrong
    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]]

  • I bypassed my server and print directly to my printer via TC/IP but for some pages I get printing that looks like Greek. If I go to print preview first it is okay. I did not have this problem before.

    The above is the best I can do.

    There is an unresolved Bug in Firefox that can cause that to occur. If it doesn't happen when you print from the Print Preview window, you'll have to print from the Preview window every time you print from Firefox - until that Bug is fixed. That is a regression that appeared when Firefox 3 was being developed - and was reported almost 3 years ago - the developers haven't come up with a fix for it yet.

  • [Solved] Slow resizing for some apps under KDE4.

    I use KDE4 (with the default theme) and Radeon graphic card (free driver). My problem is that the resizing of some windows is really slow. The problem does not appear with the KDE QT applications, but mostly for some old apps. Claws-mail is particularly affected. I do not think it is really a driver problem because claws-mail is unaffected in other window manager (as the default one in Ubuntu, with the same driver) as well in more primitive window managers like icewm. Moreover, native KDE4  QT apps behave properly.
    It seems that modern Qt apps redraw approximatively while the resizing and do a final, complete redraw when it is finished, so it is smooth. Claws-mail redraw every time and it's not smooth. However, with other window managers, claws-mail does not redraw at all while the resizing and redraw one time at the end which is less visually appealing, but nevertheless smooth (it was probably the old method); for some reason it redraw every time while the resizing in KDE4.
    I am only guessing and have not been able to find a proper documentation nor any fix. Anyone can point me in the right direction?
    Last edited by olive (2014-09-24 18:11:59)

    I reply to my own post. The culprit was the oxygen GTK theme under KDE. Under KDE, change it to Raleigh with System Setting -> Application Appearance -> GTK and the problem is solved. I had a problem with bluegriffon (from the AUR) that crashes. It was suggested here that the oxygen GTK theme was the culprit: https://groups.google.com/forum/#!topic … Xb92OyWNj8 . Indeed, after changing the theme, no more crash, and as no more problem with resizing windows!. Strange bugs though, I would have thought of everything but the GTK theme ?!?

  • I do not see the cookie for a page in the cookies.sqlite db

    I have the SQLite Manager and I am looking at the cookies in the DB for the file cookies.sqlite
    I am unable to see the cookies for some pages that I am browsing.
    I have logged into a page and then " Tools > Page Info > Security > View Cookie"
    I see a cookie called "JSESSIONID" all see all its details here. But I do not see it in the cookies.sqlite
    Is there someother place where this gets stored? or it doesnt because its a JESESSIONID ?

    Only cookies that you keep across a browsing session are stored in cookies.sqlite.<br />
    Session cookies that expire when you close Firefox are never stored.
    You can see the expiration in the cookies manager (Firefox > Preferences > Privacy > Cookies: "Show Cookies")

Maybe you are looking for

  • How to delete string from an array

    I just want to know that what changes i can do to delete the string if contains any extra characters like digits and punctuation marks in the middle or begining of the string but not at the end of the string, i've already tried to delete only the pun

  • Can't add songs to my iPod in iTunes 11

    I cannot add individual songs to my iPod in the new iTunes. I tried all of the methods described in the Apple tutorial - none of them actually work. All I can do is auto-fill, which I have absolutely no desire to do. Is anyone else having this proble

  • Using element attributes to show changes

    Hi, I'm working in a structured environment in FM7.2, and the job requires that we save out to SGML. I've been asked to show changes to my documents using a visual element but not change bars (they're already being used) - confused? I hope I can expl

  • Runtime error: Data_length_negative

    Hi Gurus, I have met one problem when i upload CSV file to BI, Please help me analysis it base below error message; tks; below is my steps 1.create datasource; 2.general info tab, input description 3. extraction tab, input file name, value of data fo

  • Windows 8.1 do not show DISCONNECT option for VPN, why? bug? Please fix!!!

    I created a VPN connection. Once I connected to the VPN in Windows 8.1, it does not show DISCONNECT option when I click on the VPN again. It just keep showing CONNECT option only. Why? This has to be a bug! Please fix!