How to throw a CustomException in JSF 2.0 and catch it in the CustomHandler

Hi,
I want to throw a custom exception "AppException" in my controller "ManagedBean", where this AppException extends Exception. And to catch it in my CustomExceptionHandler.
The problem is that when I go to the CustomExceptionHandler, I get the exception as "FacesException" not "AppException "
<factory>
<exception-handler-factory>com.web.common.exceptions.DefaultExceptionHandlerFactory</exception-handler-factory>
</factory>
public class DefaultExceptionHandlerFactory extends ExceptionHandlerFactory {
public ExceptionHandler getExceptionHandler() {
ExceptionHandler eh = new DefaultExceptionHandler(parent.getExceptionHandler());
return eh;
public class DefaultExceptionHandler extends ExceptionHandlerWrapper {
public void handle() throws FacesException {
Iterator i = getUnhandledExceptionQueuedEvents().iterator();
while (i.hasNext()) {
ExceptionQueuedEvent event = (ExceptionQueuedEvent) i.next();
ExceptionQueuedEventContext context =
(ExceptionQueuedEventContext)event.getSource();
//obtain throwable object
Throwable t = context.getException();
I need to do some action only when this AppException is thrown
The only I can do that is through
if(t.getCause().toString().indexOf("com.exceptions.AppException")!=-1){
//do some action
But I want to do something like
if(t instanceof AppException){
@ManagedBean(name = "loginController")
@ViewScoped
public class LoginController {
public String login() throws AppException {
throw new AppException ();
Any help?
Edited by: user on Mar 25, 2012 2:47 AM

For now, just use an object factory, like the builder classes or FXML. If you would prefer that JavaFX implement the Cloneable interface, try filing an issue at Jira.
It looks like they already considered something, but decided to drop it unless someone expresses a need: http://javafx-jira.kenai.com/browse/RT-137

Similar Messages

  • In Pages 5.2.2: How do you go from 1 column to 2 and keep them on the same page?

    In Pages 5.2.2: How do you go from 1 column to 2 and keep them on the same page?

    Sorry, I tried to say your answer solved my question, but I guess I told it that my response to you solved it. Now that I liked it, the solved option doesn't appear.

  • How can you pull in pdf's from iBooks and bring them into the Box app?

    How can you pull in pdf's from iBooks and bring them into the Box app?

    That sounds great, but I'm lost.
    I followed these steps:
    1) Open your PDF (in Adobe Acrobat Pro)
    2) Chose print
    The print/printer options pop-up will show.
    3) In the printer section, do not use your normal printer, a printer named Adobe PDF should be an option. Chose it.
    4) Under the "Page handling" section, change the Page Scaling drop-down menu to "Multiple pages per sheet".
    It works fine, but it looses all of the font information and the search no longer works. How can you do it and save the font info, so the search tool continues to operate.
    Am I missing anything?

  • How we represent largest code point in UTF-8 and UTF-16 whats the differenc

    how we represent largest code point in UTF-8 and UTF-16 whats the differenc
    points will be awarded

    There are standards from for CHARACTER encoding.
    See below for a brief description:
    UTF-16 (16-bit Unicode Transformation Format) is a variable-length character encoding for Unicode, capable of encoding the entire Unicode repertoire. The encoding form maps code points (characters) into a sequence of 16-bit words, called code units. For characters in the Basic Multilingual Plane (BMP) the resulting encoding is a single 16-bit word. For characters in the other planes, the encoding will result in a pair of 16-bit words, together called a surrogate pair. All possible code points from U0000 through U10FFFF, except for the surrogate code points UD800–UDFFF, are uniquely mapped by UTF-16 regardless of the code point's current or future character assignment or use.
    UTF-8 (8-bit UCS/Unicode Transformation Format) is a variable-length character encoding for Unicode. It is able to represent any universal character in the Unicode standard, yet the initial encoding of byte codes and character assignments for UTF-8 is consistent with ASCII (requiring little or no change for software that handles ASCII but preserves other values). For these reasons, it is steadily becoming the preferred encoding for e-mail, web pages, and other places where characters are stored or streamed.
    Check this site for details.
    http://unicode.org/.

  • How to synchronize if one servlet read a file and anothe servlet update the

    How to synchronize if one servlet read a file and anothe servlet update the file at a time?

    Create a class that holds the reference to the file and do the whole file manipulation just in that class. than synchronize the read and write methodes. A reference to this file handler class can be stored to the servlet context in one servlet and read out from the servlet context in the other servlet.

  • HT4859 My phone some how deleted not all but most of my contacts and then backup to the iCloud can I go back to a previous backup and retrieve the contacts. If so how.

    My phone some how deleted not all but most of my contacts and then backup to the iCloud can I go back to a previous backup and retrieve the contacts. If so how.

    Hi Shero89,
    Thanks for the answer.  I am not new to IOS software but I don't really ever bother with it, have discovered how little I take advantage of the i-phones capability, in reality I still only really use it to phone, text, check emails, listen to music and look on internet.  I'm not keen on jailbreaking it as I don't trust it to work so normally just update and leave it at that.  Only reason I wanted to downgrade was because the update had stopped my bluetooth working but Kilted Tim solved that problem for me so am now not interested in downgrading software.  I quite liked the things that IOS 5.1 gave me but wasn't happy with fact that bluetooth stopped working in car as it caused me problems.  One day I might try and work out exactly what I-phones can do but on the basis that it's a phone all I really want it to do is phone, if that bit works I'm happy.

  • ADOBE: How to print a table only on uneven pages and a text on the back?

    Hi, I am looking for a clear document on how to use pagination and the Odd and Even pages.
    We need to print a table over several pages, but the table should only appear on Odd pages. The even pages should be skipped. On the even (back) pages we need to print "Terms and Conditions". Is that possible? Can it be done without scripting?
    We are using ADOBE version 8.1
    In the file properties, double sided is switched on, and version set to 8.1 and higher.
    I created two Master pages, a FrontPage with ContentArea1and a BackPage with ContentArea2.
    FrontPage is used for uneven pages, BackPage is used for the even pages. The masterpages are printed correctly (alternating properly).
    One page was created for the table, totals etc.:
    ITEMS: contains item data (table with header and footer). Place is "On Odd Page". After "Goto page BackPage", so there is always one page with the text. And if the table needs to be paginated it goes to BackPage with overflow leader "Conditions".
    What should happen is that on the front pages the item table is printed. If there are too many lines then it should continue on page number 3 then 5 etc. All the even pages should display text only.
    What actually happens is that the item table also gets printed in the content area for the Condition text...
    The best I could achieve is to decrease the contenta area of the back page. To force pagination. But still it prints one table record in the (very small) content area of the back page before paginating to the next page (front page again). If it only would not do that, it would be fine.
    Cheers,
    Edwin.

    Fixed it... After a lot of creating, deleting, playing around with pagination and the inevitable cursing...
    I have created 5 pages:
    1. FirstPage
         - Odd/Even: Odd (Front) Pages
         - Placement: First page (In page set)
    2. FrontPage (For Odd pages)
         - Odd/Even: Odd/Front Pages
         - Placement: Rest of Pages
    3. BackPage (For Even pages)
         - Odd/Even: Even (Back) Pages
         - Placement: Rest of Pages
    4. LastPage
         - Odd/Even: No Odd/Even Restrictions
         - Placement: Last page (In page set)
    5. DummyPage
         - Odd/Even: Blank pages
    The 'Terms and conditions' are located on the BackPage and LastPage (as a text).
    The table that is printed is (of course) located on a normal page (flowed subform).
    Pagination tab: Placement = Following previous, and After = "Continue filling parent". No overflow... Basically, it's all default.
    The table lines will now start on the first page and if there are more lines than can be printed on this page, it will continue in the next content area. That will be on the FrontPage.
    The trick is that each master page must have a content area (mandatory). Except for Blank pages, but these cannot be used... Blank pages would only be used once, after the first page.
    What I discovered is that you can drag a content area away from the Master page and attach it to a different master page.
    Logically, if there is no content area on a page, then data cannot be printed there. So, I created a Dummypage. On this page I dumped the content areas from the LastPage and the BackPage. As a result, content cannot be printed anymore on the back of pages. Only the standard text (a text field) is printed there. When the data from the table is overflowing, it will automatically overflow from the FirstPage to the next content area. Which is located on the FrontPages only.
    The DummyPage is NOT used anywhere.
    The result is that the records can only be printed on the content areas that exist on the First and Front pages. The back pages are now skipped.
    Duplex printing is now working correctly, and the text is printed on the back of all the pages.
    Cheers,
    Edwin.

  • How can I create icloud account which I tried and it has showing the message that multiple free accounts have been activated on this device how should I install icloud and I got from apple support if you have mac then create a new icloud account but I don

    How will have an option to create an icloud id

    Hello there, vishal274.
    The following Knowledge Base article provides a great FAQ that provides some great answers to some of the more common questions about iCloud, including yours:
    Creating an iCloud account: Frequently Asked Questions
    http://support.apple.com/kb/ht4436
    How do I sign up for iCloud?
    You can sign up for iCloud on an iPhone, iPad, or iPod touch with iOS 5 or later, or through System Preferences on a Mac with OS X Lion v10.7.4 or later. Just follow the setup instructions for your iOS device or Mac.
    You may need to verify the email address that you use for your Apple ID. See Frequently Asked Questions About Apple ID for more information.
    I had a free Find My iPhone account. How do I sign up for iCloud?
    Update the devices that you use with Find My iPhone to iOS 5 (iOS 6 recommended). When you're asked to enter an Apple ID during setup, enter the Apple ID you were using for Free Find My iPhone. Your account will be automatically updated to iCloud.
    I had a MobileMe account. How do I sign up for iCloud?
    To use your MobileMe account for iCloud, follow the iCloud setup instructions and enter your @me.com or @mac.com email address as your Apple ID. If you had an @me.com address, it will be reactivated for email when you sign up for iCloud. If you had an @mac.com address, it won't be reactivated for email, but you can set up a new @icloud.com email address to use with iCloud.
    Important: You will need a verified email address associated with your @me.com or @mac.com Apple ID to set up iCloud. To add a verified email address, go to My Apple ID (appleid.apple.com), sign in with your @me.com or @mac.com email address, and add a valid email address to your account.
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • HT4910 I have 2 lines and on 1 of the main phone I went to settings then storage & backup automatically it showed how much space i have which was not allot and it also showed the other line storage space. I click on manage storage and it used to show both

    I was told that I have 14.9 gb of space on my phone when my total is 15gb. I was adviced to free storage and to click on settings and manage my storage by either purchase more or turning off or deleting some of the back ups. When I went in to settings then to icloud it usually would of showed me both phone storage memory and when I started going down my list and turning off some of the apps from back ups of certain app all of a sudden I couldnt no longer see my phone storage memory or my account name for that matter. Now I only see the other line username and storage space that the other phone has.
    What can I do? I used to see the list of all the apps I have on icloud and now its empty and it tells me I have available 13.4 gb available.
    Please advice. Thank you
    Patricia

    I cannot find this 300GB "Backup" in the Finder, only in the Storage info when I check "About This Mac".
    You are probably using Time Machine to backup your MacBook Pro, right? Then the additional 300 GB could be local Time Machine snapshots.  Time Machine will write the hourly backups to the free space on your hard disk, if the backup drive is temporarily not connected. You do not see these local backups in the Finder, and MacOS will delete them, when you make a regular backup to Time Machine, or when you need the space for other data.
    See Pondini's page for more explanation:   What are Local Snapshots?   http://pondini.org/TM/FAQ.html
    I have restarted my computer, but the information remains the same. How do I reclaim the use of the 300GB? Why is it showing up as "Backups" when it used to indicate "Photos"? Are my photos safe on the external drive?
    You have tested the library on the external drive, and so your photos are save there.  
    The local TimeMachine snapshot probably now contains a backup of the moved library.  Try, if connecting your Time Machine drive will reduce the size of your local Time Machine snapshots.

  • How to I extract my music from an iPod and add it to the library if it's not linked to the original ID anymore?

    I have an ipod previously linked someone else's account. We used to share the library and they used to update my iPod for me. Now I have my own ID and laptop with iTunes. How to I extract my music from the iPod and add it to the library ?  At present, I cannot do it because I am not authorised on the account the music was orginally purchased on - but I have my iPod still.
    Is there anyway for me to extract the music files from my iPod and download them into my new iTunes library and using my own Apple ID?
    Help!  I paid for most of this stuff but they left with their computer and now I can't even update my iPod!
    Thanks

    Unless you want to learn more than most of us want to know about being a good geek, you'll need a third-party software utility to do that. CopyTrans worked well for me when I moved songs from an old iPod to a new computer for a friend.
    So 1.) set up your (PC?) computer with iTunes, 2.) get something like CopyTrans which imports the stuff from your iPod to iTunes on your computer, 3.) make sure all the files from your iPod got copied, and then 4.) set iTunes to be the Mother Ship, which will then write all your old and future stuff to your iPod.
    Make sure you've 5.) tested a backup strategy for your iTunes library going forward, because Apple would prefer you'd buy everything again from them. iTunes no longer has a good, native backup utility.

  • HT4623 How can I get rid of this new update and go back to the previous one and how can I register a complaint with Apple?

    How can I get rid of this new 7.0.2 update and go back to the previous one and how can I register a complaint with Apple?

    You can't go back.
    You can leave feedback: http://www.apple.com/feedback

  • How do I load balance TFTP between two servers and a client on the same subnet?

    Hi,
    I have trawled through several documents and tried umpteen different configs, all to no avail. I have a PXE boot client trying to access a boot file via TFTP from a couple of TFTP servers on the same VLAN/subnet. For HA purposes I want to load balance the two TFTP servers.
    Config is currently;
    =====
    probe icmp ICMP_PROBE
      description icmp probe for default gateway tracking
      interval 5
      passdetect interval 15
    rserver host server1
      description Server1
      ip address 10.0.0.1
      inservice
    rserver host server2
      description Server 2
      ip address 10.0.0.2
      inservice
    serverfarm host serverfarm_01
      description servers used
      probe ICMP_PROBE
      rserver server1
        inservice
      rserver server2
        inservice
    class-map match-all L4_VIP_TFTP
      10 match virtual-address 10.0.0.10 udp eq 69
    policy-map type loadbalance first-match L7_TFTP
      class class-default
        serverfarm serverfarm_01
    policy-map multi-match L4_LB_VIP_POLICY
      class L4_VIP_TFTP
        loadbalance vip inservice
        loadbalance policy L7_TFTP
        loadbalance vip icmp-reply active
    nat dynamic 1 vlan 200
    interface vlan 200
      ip address 10.0.0.250 255.255.255.0
      nat-pool 1 10.0.0.241 10.0.0.243 netmask 255.255.255.255 pat
      service-policy input L4_LB_VIP_POLICY
      no shutdown
    ip route 0.0.0.0 0.0.0.0 10.0.0.254
    =====
    I have read the doco by Ivan Kovacevic amongst many others but as my clients and servers are on the same subnet, the config doesnt work.
    Can anybody point me in the right direction please. The devices are ACE 4710 running A3(2.3).
    Thanks

    Try using the following configuration:
    Note: Please make sure to configure also a udp probe to probe udp port 69, in case the application is down.
    You need to configure a management policy on the interface when using a UDP probe.
    That is because, when port 69 on the server will be unreachable, the server will send an ICMP unreachable.
    ACE will consider a udp probe as "failed" only when it sees ICMP unreachable.
    Without a management policy-map, the ICMP unreachable message will be dropped.
    Also, add an ICMP probe to the rserver because udp probe will not be enough when the physical interface will be down.
    That is because UDP is a connection-less protocol. To consider a UDP probe successfull, ACE need to see NO answer from the server in respose to the probe.
    The ACE will not see any answer from the server when the interface is down and thus, will consider the probe as "sucessful".
    With ICMP probe attached to the rserver, you also test the reachability of the server and not only the UDP port.
    Here is the configuration (of course, you can chage the names of the of the objects to the name you are using if you want) :
    access-list ALL line 10 extended permit ip any any
    probe udp TFTP
      port 69
      interval 5
      passdetect interval 15
    probe icmp ICMP_PROBE
      interval 5
      passdetect interval 15
    rserver host TFTP_1
      ip address 10.0.0.1
      probe TFTP
      probe ICMP_PROBE
      inservice
    rserver host TFTP_2
      ip address 10.0.0.2
      probe TFTP
      probe ICMP_PROBE
      inservice
    serverfarm host TFTP-SFARM
      rserver TFTP_1
        inservice
      rserver TFTP_2
        inservice
    sticky ip-netmask 255.255.255.255 address source TFTP-STICKY
      timeout 10
      replicate sticky
      serverfarm TFTP-SFARM
    class-map type management match-any MANAGE
      2 match protocol icmp any
    class-map match-all NAT
      2 match virtual-address 0.0.0.0 0.0.0.0 udp any
    class-map match-all TFTP
      2 match virtual-address 10.0.0.10 udp eq 69
    policy-map type management first-match MANAGE
      class MANAGE
        permit
    policy-map type loadbalance first-match ROUTE
      class class-default
        forward
    policy-map type loadbalance first-match TFTP-POL
      class class-default
        sticky-serverfarm TFTP-STICKY
    policy-map multi-match TFTP-MULTI
      class TFTP
        loadbalance vip inservice
        loadbalance policy TFTP-POL
        nat dynamic 1 vlan 212
      class NAT
        loadbalance vip inservice
        loadbalance policy ROUTE
        nat dynamic 2 vlan 212
    interface vlan 212
      ip address 10.0.0.250 255.255.255.0
      no normalization
      access-group input ALL
      nat-pool 1 10.0.0.241 10.0.0.243 netmask 255.255.255.0 pat
      nat-pool 2 10.0.0.10 10.0.0.10 netmask 255.255.255.0 pat
      service-policy input TFTP-MULTI
      service-policy input MANAGE
      no shutdown
    Let me know how it goes.
    Good luck!

  • How to make blank copies of a PDF file and put it into the printer tray.

    Dear experts,
    Before you try printing the data from the FM, How tomake several blank copies of the PDF file  and  put it in the printer tray so that you can print just the data from the function module on it??????
    Please reply.

    Hi drredwood,
    When you open your PDF file a yellow bar will appear on the top of the screen.
    Click on 'Enable All Features'.
    Then you will be able to copy the content from your pdf and to paste in any of the file.
    Regards,
    Florence

  • How do I define 2 disk groups for ocr and voting disks at the oracle grid infrastructure installation window

    Hello,
    It may sound too easy to someone but I need to ask it anyway.
    I am in the middle of building Oracle RAC 11.2.0.3 on Linux. I have 2 storage and I created three LUNs in each of storage so 6 LUNs in total look in both of servers. If I choose NORMAL as a redundancy level, is it right to choose my 6 disks those are created for OCR_VOTE at the grid installation? Or should I choose only 3 of them and configure mirroring at latter stage?
    The reason why I am asking this is that I didn't find any place to create asm disk group for ocr and voting disks at the oracle grid infrastructure installation window. In fact, I would to like to create two disk groups in which one of groups contains three disks those were brought from storage 1 and the second one contains rest three 3 disk that come from the last storage.
    I believe that you will understand the manner and help me on choosing proper way.
    Thank you.

    Hi,
    You have 2 Storage H/W.
    You will need to configure a Quorum ASMDisk to store a Voting Disk.
    Because if you lose 1/2 or more of all of your voting disks, then nodes get evicted from the cluster, or nodes kick themselves out of the cluster.
    You must have the odd number of voting disk (i.e 1,3 or 5)  one voting disk per ASM DISK, So 1 Storage will hold more voting disk than another storage.
    (e.g 3 Voting Disk - 2 voting stored in stg-A and 1 voting disk store in stg-B)
    If fail the storage that hold the major number of  Voting disk the whole cluster (all nodes) goes down. Does not matter if you have a other storage online.
    It will happen:
    https://forums.oracle.com/message/9681811#9681811
    You must configure your Clusterware same as RAC extended
    Check this link:
    http://www.oracle.com/technetwork/database/clusterware/overview/grid-infra-thirdvoteonnfs-131158.pdf
    Explaining: How to store OCR, Voting disks and ASM SPFILE on ASM Diskgroup (RAC or RAC Extended) | Levi Pereira | Oracl…

  • How to have creative p5800 in 5.1 mode and a microphone at the same t

    Hello everybody,
    pls, can somebody advise, how can i use my creative p5800 in 5. mode and at the same time to have microphone working properly.
    for the moment i have installed my creative as stereo speakers and the mic is plugged?into the sound card, which is not very conviniet, because my rear speakers are not working.
    i would be very greatful if somebody can help me.
    0x in advance

    I'm not really sure what you mean.
    Which soundcard do you have exactly? If it's one of ours, you should be able to use the outputs on the back to connect your speakers (and set the speaker selection to 5.) and connect the microphone. As long as the microphone is set up correctly in the mixer, and is selected as the recording source, then it should work fine.
    Cat

Maybe you are looking for