我有两个注册王表。第一页提供一个按钮名称Registration.By将光标移动到它上面,它将显示下拉菜单。如果我选择选项1注册,我想导航到jsp第1页如果我选择选项2注册,我想获得jsp第2页。我该怎么做?
<div class="dropdown">
<button> REGISTRATION </button>
<div class="dropdown-content">
<a href="#register_user"onclick="document.location.href('C_registration.jsp')">as user</a>
<a href="#register_photostudio_owner"onclick="document.location.href('PSO_registration')">as photostudio owner</a>
</div>
</div>
答案 0 :(得分:0)
在web.xml中映射2个Jsp,如下所示:
<servlet>
<servlet-name>Test1</servlet-name>
<jsp-file>/index1.jsp</jsp-file>
</servlet>
<!--mapping-->
<servlet-mapping>
<servlet-name>Test1</servlet-name>
<url-pattern>/test1/*</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>Test2</servlet-name>
<jsp-file>/index2.jsp</jsp-file>
</servlet>
<!--mapping-->
<servlet-mapping>
<servlet-name>Test2</servlet-name>
<url-pattern>/test2/*</url-pattern>
</servlet-mapping>