- 论坛徽章:
- 0
|
环境:netbeans5.5
页面代码:
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ page import="com.myapp.struts.form.*"%>
<%@ page import="com.myapp.struts.work.*" %>
<%--
The taglib directive below imports the JSTL library. If you uncomment it,
you must also add the JSTL library to the project. The Add Library... action
on Libraries node in Projects view can be used to add the JSTL 1.1 library.
--%>
<%--
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
--%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%
TransDate td=new TransDate();
ToLogaddForm tlf=(ToLogaddForm)session.getAttribute("data");
int tmp=Integer.parseInt(tlf.getSeqno());
tmp=tmp+1;
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>添加日志页面</title>
</head>
<body>
<h1>添加日志</h1>
<html:form action="logadd">
<table>
<tr>
<td>流水号码</td><td><html:text property="seqno" value="<%=tmp+""%>" /></td>
</tr>
<tr>
<td>用户编号</td><td><html:text property="userid" value="<%=tlf.getUserid()%>" /></td>
</tr>
<tr>
<td>用户名称</td><td><html:text property="cnname" value="<%=tlf.getCnname()%>" /></td>
</tr>
<tr>
<td>写入日期</td><td><html:text property="insdate" value="<%=td.getFullDate()%>" /></td>
</tr>
<tr>
<td>写入内容</td><td><html:textarea property="content"/></td>
</tr>
<tr>
<%
System.out.println(request.getCharacterEncoding());
%>
<td><html:submit value="确定" /></td><td><html:cancel value="取消"/></td>
</tr>
</table>
</html:form>
<%--
This example uses JSTL, uncomment the taglib directive above.
To test, display the page like this: index.jsp?sayHello=true&name=Murphy
--%>
<%--
<c:if test="${param.sayHello}">
<!-- Let's welcome the user ${param.name} -->
Hello ${param.name}!
</c:if>
--%>
</body>
</html>
传到Action的时候content中的中文为乱码
不知为何,UTF-8?? |
|