Hi guys, I’ve been learning a bit of Java lately when I was taught how to implement a controller class whose ability is to redirect a request to an action that performs the Job task. So I found out
@Override
protected void service(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
try {
String clazz = req.getRequestURI().replaceAll(req.getContextPath() + "/", "").replaceAll(".java", "");
((Action)Class.forName("com.myProject.actions." + clazz).newInstance()).execute(req, res);
} catch (Exception e) {
e.printStackTrace();
}
}
I know that WebForms also works with HANDLERS , which are kind of actions. For example, each .aspx page inherits a page object, which is the handler for the specified page.
, , - ( )? WebForms () IIS? , WebForms?
.