Hi,
First, sorry for my english. It is not very good.
I build simple application who send string with Polish characters from HTML to
another jsp page and display it.
I use "get" method to send this string.
and I recive what's like that "ąęśćżółń"
Bellow i put code of my simple application.
| index.jsp
| ---------------------------------------------------------------------------
| <%@ page language="java" pageEncoding="UTF-8" %>
| <!DOCTYPE HTML PUBLIC "-//w3c//dtd html 4.0 transitional//en">
|
| <html>
| <head>
| <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
| <title>Polish Character Encoding Test:
ąćęłńóśźż</title>
| </head>
| <body>
| <form action="Main" method="get">
| Polish string <input name="test" type="text" size="20">
| <input type="submit" value="Send">
| </form>
| </body>
| </html>
|
| -------------------------------------------------------------------------------
| rec.jsp
| -------------------------------------------------------------------------------
| <%@ page language="java" pageEncoding="UTF-8" %>
| <!DOCTYPE HTML PUBLIC "-//w3c//dtd html 4.0 transitional//en">
|
| <html>
| <head>
| <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
| <title>Polish Character Encding Test:
ĄĆĘŁŃÓŚŹŻ</title>
| </head>
| <body bgcolor="#FFFFFF">
|
| I recive from index.jsp folowing string: "<%=
request.getParameter("test") %>"
|
| </body>
| </html>
|
| ----------------------------------------------------------------------------------
| Main.java
| ----------------------------------------------------------------------------------
| import java.io.*;
| import javax.servlet.*;
| import javax.servlet.http.*;
|
| public class Main extends HttpServlet {
|
| protected void doGet(
| HttpServletRequest request,
| HttpServletResponse response)
| throws ServletException, IOException {
|
| RequestDispatcher disp =
request.getRequestDispatcher("rec.jsp");
| disp.forward(request,response);
|
| }
|
| protected void doPost(
| HttpServletRequest request,
| HttpServletResponse response)
| throws ServletException, IOException {
|
| doGet(request,response);
| }
| }
|
|
All files are encoded in UTF-8.
If I send string vi "post" method all characters are displayed ok.
If I change "forward" method of RequestDispatcher to "include" method string is
displayed ok but all polish characters on page are displayed perhaps in ISO-8859-1
encoding.
I need your help. What I do wrong?
Piotr Brandys-Buczek
My e-mail: [EMAIL PROTECTED]
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3837022#3837022
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3837022
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id149&alloc_id?66&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user