こんにちは、TOMTOMです。
また原因が分からない事ができたので
教えてください。

JSPのページが二つあります。
片方から、もう一方ページに、パラメータを引き渡す時、
日本語が、文字化けします。

ソースを貼り付けます。

pref.jsp***************************************

<[EMAIL PROTECTED] contentType="text/html;charset=Shift_JIS"%>
<[EMAIL PROTECTED] pageEncoding="UTF-8"%>
<%--
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.
--%>

<[EMAIL PROTECTED] uri="http://java.sun.com/jsp/jstl/core"; prefix="c"%> 


<!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=Shift_JIS">
        <title>JSP Page</title>
    </head>
    <body>

    <h1>JSP Page</h1>
        <form action="newpage.jsp" method="POST">
        <select name="prefectures">
    <c:set var="pre" value="tohoku,北海道,東京都,愛知県,京都府,大阪府,兵庫県,広島県,福岡県,沖縄県" />
    <c:forEach var="item" items="${pre}">
     <option value="${item}">${item}</option>
    </c:forEach>
        </select>
    <br>
        <input type="submit" value="送信"  />
        </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>

newpage.jsp*************************************************

<[EMAIL PROTECTED] contentType="text/html;charset=Shift_JIS"%>
<[EMAIL PROTECTED] pageEncoding="UTF-8"%>
<%--
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.
--%>

<[EMAIL PROTECTED] uri="http://java.sun.com/jsp/jstl/core"; prefix="c"%> 


<!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=Shift_JIS">
        <title>JSP Page</title>
    </head>
    <body>

    <h1>JSP Page</h1>
    <br>
   ${param['prefectures']}
    <br> 
    <%=request.getParameter("prefectures")%>
    <%--
    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>

*****************************************************
この二つのJSPなのですが、
内容としては、いたって、簡単で、
pref.jspで選んだドロップダウンリストを
newpage.jspで、表示するだけなのです。

アルファベットのtohokuは、ちゃんと表示されるので、
値は、ちゃんと渡っていると思われるのですが、
北海道のような、漢字では文字化けします。

netbeansは、5.0を利用しています。

ソースコードの問題なのか、それとも、
何かの環境の問題なのか??
解らないので、ご教示ください。
よろしくお願いいたします。




----------------------
name | tomtom

_______________________________________________
Netbeans-info mailing list
[email protected]
http://lists.sourceforge.jp/mailman/listinfo/netbeans-info

メールによる返信