我想使用 scriptlet 编写单击执行测试按钮时调用的函数此代码不起作用:
这是我的jsp代码:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<html:file properties="tonFichier" name="tonForm"/>
<%!
public void executeTest() {
java.util.Date d = new java.util.Date();
System.out.println(d.toString()); }
%>
<form enctype="multipart/form-data" method="get">
<div>
<input type="submit" value="Execute Test" onclick="executeTest()" >
</div>
</form>
</body>
</html>
任何帮助请干杯