In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail how to use wildcards in the Struts2 configuration file. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
Introduction to Struts2
Struts2 is a Web application framework based on MVC design pattern, which is essentially equivalent to a servlet. In the MVC design pattern, Struts2 acts as a Controller to establish the data interaction between the model and the view. Struts 2 is the next generation product of Struts, which is a new Struts 2 framework combined with the technology of struts 1 and WebWork. The architecture of its new Struts 2 is very different from that of Struts 1. Struts 2 takes WebWork as the core and uses the interceptor mechanism to process user requests. This design also makes the business logic controller completely detached from ServletAPI, so Struts 2 can be understood as the updated product of WebWork. Although there is too much change from Struts 1 to Struts 2, the change is small compared to WebWork,Struts 2.
Form 1: call different methods in the same Action
/ login.jsp / error.jsp / welcome.jsp
Where the value of the expression {1} is the value of the first * in the name attribute value.
If the URL requested by the user is loginAction.action, the login method in Jcuckoo.LoginRegistAction is called
If the URL requested by the user is registerAction.action, the register method in Jcuckoo.LoginRegistAction is called
Form 2: call the execute method of different Action by matching
/ login.jsp / error.jsp / welcome.jsp
The method attribute does not appear above, so the corresponding execute method is called by default
If the URL requested by the user is LoginAction.action, the execute method in Jcuckoo.LoginAction is called
If the URL requested by the user is RegisterAction.action, the execute method in Jcuckoo.RegisterAction is called
Form 3: dynamic results
/ input.jsp / {1} .jsp
When the result is input, you will go to the / input.jsp page
When the processing result is success
If crud_create.action, the create method in Jcuckoo.CrudAction is executed and jumps to / create.jsp; if crud_delete.action, the delete method in Jcuckoo.CrudAction is executed and jumps to / delete.jsp
This is the end of this article on "how to use wildcards in Struts2 configuration files". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.