81,092
社区成员
发帖
与我相关
我的任务
分享
<!--Struts框架配置-->
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>admin/login.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>Set Character Encoding</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Set Character Encoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="/struts-dojo-tags" prefix="sx" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'productstype.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<s:debug></s:debug>
商品分类:<s:property value="#session.proType.proTypeName"/>
<form action="productsParameteraddnewParameter">
<table>
<tr>
<td>参数编号</td>
<td>参数名称</td>
<td>参数描述</td>
<td>参数操作</td>
</tr>
<s:iterator value="#session.proType.sfblProductsParameters" var="s">
<s:if test="#s!=null">
<tr>
<td><s:property value="%{#s.productsParameterId}"/></td>
<td><s:property value="%{#s.productsParameterName}"/></td>
<td><s:property value="%{#s.productsParameterInfo}"/></td>
<td><sx:a href="getproductsTypeactiongetProductsTypeById?id=%{#pt.proTypeId}" targets="content">编辑</sx:a><sx:a href="productsParameterdeleteParameter?id=%{#s.productsParameterId}" targets="content">删除</sx:a></td>
</tr>
</s:if><s:else>
<tr><td>暂无任何参数信息</td></tr>
</s:else>
</s:iterator>
<tr>
<td><input type="text" name="par.productsParameterName"></td>
<td><input type="text" name="par.productsParameterInfo"></td>
<td><sx:submit targets="content"></sx:submit></td>
</tr>
</table>
</form>
</body>
</html>
后台代码很简单,就是用的Spring自动封装,但是接过来,去对象查看时就是乱码了。
public SfblProductsParameter par;
public SfblProductsParameter getPar() {
return par;
}
public void setPar(SfblProductsParameter par) {
this.par = par;
}
<property name="url" value="jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8"></property>
我要崩溃了、我的QQ是200739491 可以的话,加我QQ跟我说。唉~~~~