Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Pass an Hewbrew parameters via post to JSP

Posted on 2003-03-05
10
Medium Priority
?
350 Views
Last Modified: 2010-08-05
When i try to pass parameters using METHOD POST
to new jsp file

the new jsp file
show the value of the Hebrew param as ?

How can i reacive the correct Hebrew param

i using the get the Request.getParam("myparam")

Regards
Neta
0
Comment
Question by:neta
10 Comments
 
LVL 4

Expert Comment

by:thanassis
ID: 8071031
You must install Hebrew fonts in the machine that runs your server
0
 

Expert Comment

by:richiegr
ID: 8072118
Hi

The best solution to work is to work with UTF-8 encoding
from the jsp page to the database or whatever
Do not beginning to play with different hebrew encoding cp1255 or ISO it's more difficult and don't give nothing.

Bye
0
 
LVL 14

Accepted Solution

by:
kennethxu earned 800 total points
ID: 8072480
first you must decide which char-encoding you want to use, i would suggest to use utf-8:

in every jsp page you need:
<%@ page contentType="text/html; charset=UTF-8" %>
in every html page you need this line in your html <head>:
<META HTTP-EQUIV="CONTENT-TYPE"CONTENT="TEXT/HTML;CHARSET=UTF-8">

if your server supports servlet 2.3, use:
request.setCharacterEncoding( "UTF-8" );
before you use any request.getParameter call.

if your server doesn't support 2.3, use this:

<%
String encoding = request.getCharacterEncoding();
if( encoding == null ) encoding = "ISO-8859-1";
String myString = request.getParameter( "xxx" );
if( myString != null ) myString = new String( myString.getBytes( encoding ), "UTF-8" );
%>
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 14

Expert Comment

by:kennethxu
ID: 8072501
if you must use other encoding, replace "UTF-8" with the encoding you want to use in my previous comment. let me know if you have futher enquires.
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 8073785
richiegr is right, use UTF-8 encoding in your JSP and it should work.

CJ
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 8074541
>> richiegr is right, use UTF-8 encoding in your JSP and it should work.
cannot 100% agree, sometime you have not choice when your datebase is already setup for encoding other then utf-8. utf-8 is the easiest to work with, but doesn't mean it is the only choice.
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 8074576
No, but it is the probably the best when dealing with internationalization and other character sets.

CJ
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 8074828
if you have freedom to select an encoding, I agree that utf-8 should be the first candidate to consider. but when environment doesn't allow, say existing database and exsiting encoded files/pages. Other encodings are just working fine. At least, I have been working with varies encoding all the time.
0
 

Author Comment

by:neta
ID: 8075036
Thank you all
richiegr my jsp does not suport the UTF-8
so i choosed kennethxu  answer as the right one

Best to all
Neta
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 8075251
pleasure to help and good luck!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The article explains the process to deploy a Self-Service password reset portal I developed a few years ago. Hopefully, it will prove useful to someone.  Any comments, bug reports etc. are welcome...
Why WooCommerce is one of the majorly favored choices when it comes to having an eCommerce store. This article will acquaint you with some reasons that I believe make it one of the best eCommerce platforms available.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Suggested Courses
Course of the Month10 days, 22 hours left to enroll

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question