日期:2014-05-20  浏览次数:20793 次

SSH中JSP页面向数据库添加数据 到Action时是乱码.在线等
这是我的页面
Java code

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>


<%
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");

 %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <base href="<%=basePath%>">

        <title>My JSP 'add.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>
        <form action="orderInfo.do?op=add" method="post">
            家居客家具预定
            <table>
                <tr>
                    <td>
                        家具品牌
                    </td>
                    <td>
                        <select name="orderInfoDto.FBrand">
                            <option value="请选择">
                                请选择
                            </option>
                            <option value="百强">
                                百强
                            </option>
                            <option value="意风">
                                意风
                            </option>
                            <option value="华日">
                                华日
                            </option>
                            <option value="红苹果">
                                红苹果
                            </option>
                            <option value="美克美家">
                                美克美家
                            </option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>
                        产品类型
                    </td>
                    <td>
                        <input type="radio" name="orderInfoDto.FType" value="床垫" >
                        床垫 &nbsp;
                        <input type="radio" name="orderInfoDto.FType" value="床头柜 ">
                        床头柜 &nbsp;
                        <input type="radio" name="orderInfoDto.FType" value="地柜">
                        地柜 &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        联系人
                    </td>
                    <td>
                        <input type="text" name="orderInfoDto.FContact">
                    </td>
                </tr>
                <tr>
                    <td>
                        联系电话
                    </td>
                    <td>
                        <input type="text" name="orderInfoDto.FPhone">
                    </td>
                </tr>
                <tr>
                    <td>
                        <input type="submit" value="提交预定">
                    </td>
                </tr>
            </table>
        </form>
    </body>
</html>