java - pass EJB ApplicationException to web -
I have EJB classes, custom exceptions, and web back and bean classes, I want to capture custom exceptions in the Web if EJB Exception passes, but can hold Exception class: EJB class: Backend class: runtime exposure exception ??
@ Application exceptions expands public class CustomException exception {}
Employees of Public Sector Dao {Private User Transaction Transaction; @basana unit (unit name = "xxx") protected EntityManagerFactory entityManagerFactory; . . . . . Public Zero addNewEmployee (employee employee) throws CustomException {. . . . Throw New CustomException (...); }}
Public class employee backend {. . . . Public Zero doAddEmployee () {try {.... employeeDao.addNewEmployee (); } Grip (custom expression e) {System.err.println ("------------------------ Custom Expansion"); E.printStackTrace (); } Hold (runtime exception e) {System.err.println ("------------------------ runtime exception"); E.printStackTrace (); After covering the main exception with custom exception, this issue is an I / there system exception, so the custom exception is not passed, only the system exception is near :)
Comments
Post a Comment