index.jsp
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
</head>
<body>
<li>测试struts的类型转换器</li><br>
<form action="${ pageContext.request.contextPath}/type_convert.action" method="post">
intValue:<input type="text" name="intValue"><br>
doubleValue:<input type="text" name="doubleValue"><br>
booleanValue:<input type="text" name="booleanValue"><br>
java.sql.date:<input type="text" name="sqlDate"><br>
java.util.date:<input type="text" name="utilDate"><br>
<input type="submit" value="提交">
</form>
</body>
</html>
type_convert_success.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!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=UTF-8">
<title></title>
</head>
<body>
intValue:${typeConvertForm.intValue }<br>
doubleValue:${typeConvertForm.doubleValue }<br>
booleanValue:${typeConvertForm.booleanValue }<br>
sqlDate:${typeConvertForm.sqlDate }<br>
utilDate:${typeConvertForm.utilDate }<br>
</body>
</html>