Recommended reading: JQuery+Ajax+Struts2+Hibernate framework integration to achieve complete login registration
Regarding the user registration requirements in the user module, it is usually necessary to verify whether the user name has been registered. I just wrote this requirement today and posted the detailed code and problems encountered. When using struts2+ajax , usually we will return json type data, but like the above example, we only hope to return a 1 and 0 to facilitate subsequent judgment. There is no need to return the json type, just return a text string.
regist.jsp (only the