public class MyApplication { public static void main(String[] args) { SpringApplication.run(UserDocumentLibraryClientApplication.class, args); } ... @Bean public EmbeddedServletContainerCustomizer exceptionHandling() { return container -> container.addErrorPages(new ErrorPage("/exception")); } }
@Bean public EmbeddedServletContainerCustomizer exceptionHandling() { return container -> container.addErrorPages(new ErrorPage("/exception")); }
private static void addErrorPages(Context context) { for (int errorCode : ERROR_PAGE_STATUSES) { ErrorPage errorPage = new ErrorPage(); errorPage.setErrorCode(errorCode); errorPage.setLocation("/error.jspx"); context.addErrorPage(errorPage); } ErrorPage errorPage = new ErrorPage(); errorPage.setExceptionType(Throwable.class.getName()); errorPage.setLocation("/error.jspx"); context.addErrorPage(errorPage); }
public JsonResult populateData(string application, string columns, string machine, string pages, string startDate, string endDate) { ErrorPage _objError = new ErrorPage(); var ErrorResult = _objError.GetErrorData(application, columns, machine, pages, startDate, endDate); //Column description: Name and Type var columnlist = new Dictionary<string, System.Type>(); foreach (System.Data.DataColumn column in _objError.ErrorData.Columns) { var t = System.Type.GetType(column.DataType.FullName); columnlist.Add(column.ColumnName, t); } _objError.ErrorColumns = columnlist; var result = JsonConvert.SerializeObject(ErrorResult.ErrorData, Formatting.Indented, new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore }); return Json(result, JsonRequestBehavior.AllowGet); }
errorPage = new ErrorPage(); errorPage.setLocation(path); errorPage.setErrorCode(status);
org.apache.catalina.deploy.ErrorPage errorPage = new org.apache.catalina.deploy.ErrorPage(); errorPage.setErrorCode(value.getErrorCode()); errorPage.setExceptionType(value.getExceptionType());