Go4Expert

Go4Expert (http://www.go4expert.com/)
-   JSP (http://www.go4expert.com/forums/jsp/)
-   -   POST method and JSP (http://www.go4expert.com/forums/post-method-jsp-t24902/)

biancazzurri 9Feb2011 02:12

POST method and JSP
 
Okay I know this term has been raped by all the noobs and I suppose I am one of them. Nothing I searched seems to help me.
I have a problem passing non-English(Hebrew) text using POST method.

my HTML page:
Code:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
</head>
<body>
    <form ACTION="table.jsp" METHOD="POST">
        Data:<input type="text" name="data" size="25">
        <INPUT TYPE="SUBMIT" VALUE="Submit">
    </form>
</body>
</html>

my JSP page(table.jsp):

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
</head>
<body>
<%

    request.setCharacterEncoding("UTF-8");
    response.setContentType("text/html;charset=UTF-8");

    String data = request.getParameter("data");
    out.print("before: " + data);
%>
</body>
</html>

the 'out.prinln' prints giberish and I am desperate!
Thanks for the help!


All times are GMT +5.5. The time now is 07:56.