using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.Routing; using System.Timers; namespace SEIeSCM { // Note: For instructions on enabling IIS6 or IIS7 classic mode, // visit http://go.microsoft.com/?LinkId=9394801 public class MvcApplication : System.Web.HttpApplication { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); // favicon.ico에 대한 igore처리를 하지 않으면 // 구동시에 favicon.ico에 대한 에러가 발생함. // Spring 프레임워크 안쪽에서 뭔짓을 하는 듯... routes.IgnoreRoute("favicon.ico"); routes.IgnoreRoute("images"); routes.IgnoreRoute("Content"); // WildRain 주석 2009-11-26 // 아래의 라우팅 규칙을 확인하는데 무려 하루가 소요됨. // 라우팅 규칙 정의시 아래와 같이 반듯이 // default controller와 action등의 정의가 라우팅 규칙과 같아야 // 제데로 작동하는 것을 확인함. // 그리고 라우팅 규칙 정의 순서에 작동 여부가 영향을 받으므로 // 주의할 필요가 있음. //routes.MapRoute( // "Dnor", // "Dnor/HopeInfo/{dnorNbr}", // new { controller = "Dnor", action = "HopeInfo", dnorNbr = "" } //); //routes.MapRoute( // "UserInfo", // Route name // "Account/UserInfo/{strUserId}", // URL with parameters // new { controller = "Account", action = "UserInfo", strUserId = "" } // Parameter defaults //); //routes.MapRoute( // "CustPopup", // Route name // "Cust/CustPopup/{strCustSeq}", // URL with parameters // new { controller = "Cust", action = "CustPopup", strCustSeq = "" } // Parameter defaults //); routes.MapRoute( "Default", // Route name "{controller}/{action}/{param}", // URL with parameters new { controller = "Home", action = "Index", param = UrlParameter.Optional } // Parameter defaults ); //routes.MapRoute( // "KA_FSS", // Route name // "KA_FSS/{controller}/{action}/{id}", // URL with parameters // new { controller = "Home", action = "Index", id = "" } // Parameter defaults //); //routes.MapRoute( // "KA_FSS", // Route name // "KA_FSS/{controller}/{action}/{id}", // URL with parameters // new { controller = "Home", action = "Index", id = "" } // Parameter defaults //); //routes.MapRoute("", "KA_FSS/OldAction", new { Controller = "Home", action = "Index" }); //routes.MapRoute("", "KA_FSS/{action}", new { Controller = "Home" }); } //private static Timer ScheduledTaskTimer = new Timer(); protected void Application_Start() { RegisterRoutes(RouteTable.Routes); // 위 SpringControllerFactory 클래스의 컨텍스트(objects.xml) 부분을 시작할 때 로드 해 두는 부분. ControllerBuilder.Current.SetControllerFactory(new ControllerFactory()); } protected void Application_Error(object sender, EventArgs e) { log4net.ILog ExceptionLog = log4net.LogManager.GetLogger("SEIeSCM_Exception"); ExceptionLog.Error(">>>>>>>>>>>>>>>>>>> SEIeSCM_Exception <<<<<<<<<<<<<<<<<<<<", Server.GetLastError()); } } }