123.jsp
来自「一本书中的原代码,有用多例子,很好用」· JSP 代码 · 共 26 行
JSP
26 行
<html>
<head><title>Where to go</title></head>
<body>
<%
String address = request.getParameter("where");
if(address!=null)
{
if(address.equals("163"))
response.sendRedirect("http://www.163.com");
else if(address.equals("Yahoo"))
response.sendRedirect("http://www.yahoo.com.cn");
else if(address.equals("sohu"))
response.sendRedirect("http://www.sohu.com");
}
%>
<b>Please select:</b><br>
<form action="123.jsp" method="GET">
//此处的123.jsp文件是该例子的文件名
<select name="where">
<option value="163" selected>go to 163
<option value="sohu" > go to sohu
<option value="Microsoft" > go to Microsoft
</select>
<input type="submit" value="go" name="submit">
</form>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?