1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

POST method and JSP

Discussion in 'JSP' started by biancazzurri, Feb 8, 2011.

  1. biancazzurri

    biancazzurri New Member

    Joined:
    Feb 8, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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!
     
    Last edited by a moderator: Feb 9, 2011

Share This Page