<%@ page language= "java" import= "java.util.*" pageencoding= "UTF-8"%><%@ taglib prefix= "s" uri= "/ Struts-tags "%><! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >{%> <font color= "Red" ><%=error%></font> <%} %> <form action= "Register" name= "form" method= "POST" > <table> <tr> <td> User name </td> <td><input type= "text" Name= "Register.username" Value= ' <s:property value= ' register.username '/> ' ></td> </tr> <tr> <td> password </td> <td><input type= "password" name= "Register.password" Value= ' <s:property value= ' Register.password '/> ' ></td> </tr> <tr> <td> email </td> <td><input type= "text" Name= "Register.email" Value= ' <s:property value= ' register.email '/> ' ></td> </tr> <tr> <td> phone </td> <td><input type= "text" name= "Register.phone" value = ' <s:property value= 'Register.phone "/> ></td> </tr> <tr> <td><input type= "Submit" name= "register" value= "registration" > </td> <td><input type= "reset" Name= "R Egister "value=" Reset > </td> </tr> </table> </form></body& Gt;
The reason for the 404 error (as shown in 1) is that the following button is named with the same name as the object, as shown in 2.
<td><input type= "Submit" name= "register" value= "registration" > </td> <td><input type= " Reset "name=" register "value=" Reset > </td>
Figure 2
Figure 1
JAVA EE, JSP form Cancel button and submit button Name property naming problem