Five logical view names are available in the action interface
- SUCCESS
- ERROR
- LOGIN
- Input:input is used in some interceptors
- NONE
Configure logical View: Struts_demo2.xml, error message after configuration will jump to the specified page
<?XML version= "1.0" encoding= "UTF-8"?><!DOCTYPE struts Public "-//apache software foundation//dtd struts Configuration 2.3//en" "Http://struts.apache.or G/dtds/struts-2.3.dtd "><Struts> < Packagename= "Demo2"extends= "Struts-default"namespace="/"> <Global-results> <!--go back to the current page as soon as it goes wrong - <resultname= "Input">/demo2/demo1.jsp</result> </Global-results> <Actionname= "UserAction1"class= "Com.itheima.struts2.demo2.UserAction1"Method=""> </Action> </ Package> </Struts>
Enter the wrong type of information in the JSP, such as age:
Configure input to jump and display error message:
12 configuration of the input logical view