Results 1 to 6 of 6

Thread: How to handle Java Runtime exception

  1. #1
    Join Date
    Jan 2010
    Posts
    126

    How to handle Java Runtime exception

    Hello,
    In my case, I have a good mind to make one. I get an error that is currently in no case occur, but it seems to me that I still have the provision for Sometimes a subject that will modify my example. Then I get a RuntimeException that does not seem appropriate, so I am not obliged to wrestle. How can I resolve the runtime exception in java? any advice or suggestion on this will help me. Thank you.

  2. #2
    Join Date
    Dec 2009
    Posts
    202

    Re: How to handle Java Runtime exception

    Indeed, it is like this:
    Code:
    public class RuntimeException 
    extends Exception
    RuntimeException Is The superclass of giving further exceptions thrown That can Be "during the normal operation of the Java Virtual Machine. A method to declare Is Not required throws clause in "any STI subclass that might be of RuntimeException thrown" during the execution of the method but not caught.

  3. #3
    Join Date
    Dec 2009
    Posts
    296

    Re: How to handle Java Runtime exception

    Take for example the case of IllegalArgumentException. You have a method that takes a string parameter and returns the first 3 characters. In your method you tested if the string that you pass is not null and if it is longer or equal to 3 tanks. If this is not the case you hesitate a IllegalArgumentException (which is a runtime). Even if the only object that calls this method is an object to you and that you check before you call the method is a good way in the future if you forget to check this in another appeal by example.

  4. #4
    Join Date
    Dec 2009
    Posts
    192

    Re: How to handle Java Runtime exception

    This type of error message appears when you do not pass through the JSF servlet. To go through the servlet must use a URL that corresponds to the servlet mapping. The jsp page in itself has no influence over this, though this might be not true with you.

  5. #5
    Join Date
    Nov 2009
    Posts
    347

    Re: How to handle Java Runtime exception

    Actually I have access to my page you must use the url corresponding to the mapping of the servlet:
    Code:
    http:/ / localhost: 8080/example/faces/index.jsp
    And if you want element the "faces" in the url, you must edit the mapping of the servlet. If you have an idea regarding this topic then please help me with this.

  6. #6
    Join Date
    Dec 2009
    Posts
    296

    Re: How to handle Java Runtime exception

    You can map your servlet instance to *. jsf and use as url
    Code:
    http://localhost:8080/test_jsf/index. jsf
    Replace the above with your address, that is where you are deploying the files of your project.

Similar Threads

  1. How to handle JButton Click Event in Java Swing
    By Kungfu Pandey in forum Software Development
    Replies: 3
    Last Post: 20-01-2012, 12:13 PM
  2. Replies: 4
    Last Post: 05-04-2011, 03:27 AM
  3. Headless Exception in Java
    By Adrina_g in forum Software Development
    Replies: 5
    Last Post: 20-02-2010, 08:36 PM
  4. How to catch an Exception in Java?
    By SKREECH in forum Software Development
    Replies: 4
    Last Post: 18-02-2010, 04:50 AM
  5. How to handle exception in VBA
    By afidelino in forum Software Development
    Replies: 3
    Last Post: 03-09-2009, 03:30 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,710,849,318.30538 seconds with 16 queries