我正在尝试制作一个简单的输入注册和登录页面。用于登录的第一个servlet可以很好地工作,但是用于注册的第二个servlet似乎没有连接。您可以将2个servlet连接到2种不同的形式吗?
<form name="login" method="Post" action="HomeServlet">
<form name="login" method="post" action="RegisterServlet">
web.xml文件:
<servlet>
<servlet-name>HomeServlet</servlet-name>
<servlet-class>HomeServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>RegisterServlet</servlet-name>
<servlet-class>RegisterServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HomeServlet</servlet-name>
<url-pattern>HomeServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>RegisterServlet</servlet-name>
<url-pattern>RegisterServlet</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>