jsp基础题
<%@page import="java.util.*" pageEncoding="GBK"%>
<%@page import="javax.servlet.http.*" %>
<%@page import="java.io.Writer"%>
<%@page import="java.io.PrintWriter"%>
<%@page import="java.net.InetAddress"%>
<%!
private static class abc {
public void first() throws Exception{
PrintWriter out =null;
out.println("this is first ");
}
public void second() throws Exception{
PrintWriter out =null;
out.println("this is first ");
}
}
%>
<%
out.print("<a href=\"\">first</a> ");
out.println("<a href=\"\">second</a>");
%>
求助
当点击first超链接之后能调用first方法并在下方显示first输出的语句。
second功能同first一致。
------解决方案--------------------
可以通过传递参数来解决。