Arabic jsp problem
Hi All
I have problem with arabic encoding in jsp
here is my problem
I have jsp page and contains textfield
user put some text and submit the page
this text is compared with other text that read from text file
if two texts are equal some message appears to user
I have made sample project it works fin with English text
but it fails with Arabic texts
her is my sample code
<%
String txt=request.getParameter("txt");
if(txt!=null){
if(MyClass.test(txt)){
out.println("values are equal");
}else{
out.println("values are not equal");
%>and method test is static method from MyClass
public static boolean test(String x) throws FileNotFoundException, IOException{
LineNumberReader reader=new LineNumberReader(new FileReader("c:\\test.txt"));
String line=reader.readLine();
return line.equals(x);
}I have tried HTML metaTage with Arabic encoding -notworked-
and also tried <%@page with Arabic encoding also not worked
any help will be
appreciated
thanks
You use a Reader without specifying an encoding there. So you are using the system's default encoding. Most likely this is an encoding that does not match the actual encoding of that file which contains Arabic characters.
Change your code to use an InputStreamReader and specify the correct encoding.
Similar Messages
-
MacBook, Microsoft Office for Mac - Arabic Writing Problems
Arabic Writing Problems with All Applications of Microsoft Office for Mac 2008
Characters are not aligned property to compose the Arabic WordsArabic Writing Problems with All Applications of Microsoft Office for Mac 2008
Characters are not aligned property to compose the Arabic Words
MS Word for Mac does not yet support Arabic (or various other scripts). You should let MS know that you want that.
I have had reports, however, that PowerPoint and Entourage in MS Office 2008 will do correct Arabic. Could you confirm that for me?
For Arabic the best Mac word processor is Mellel. Others are TextEdit, Nisus Writer, iText Pro, NeoOffice, OpenOffice, StarOffice. -
Dear Professional
i write adf page in (JDeveloper 11g Preview 4) when i write any arabic text in the page and submit it the text converted to another encoding, i tried to put the following in the page :
<%@ page contentType="text/html;charset=windows-1256"%>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256>
and
<%@ page contentType="text/html;charset=UTF-8"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8>
but the problem still .
Please Advice.
Regards
Wish79I get this question also. Not only "submit" , "Commit" also case this question.
If I chang:
Did you specify the encoding for your ADFBindingFilter in your web.xml :
<filter>
<filter-name>adfBindings</filter-name>
<filter-class>oracle.adf.model.servlet.ADFBindingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>windows-1256</param-value>
</init-param>
</filter>
Regards,
Didier.
Then "submit" is OK, but navigation botton will not OK.
I still try to find out the resolution.
Now 99% is OK.
I am use chinese. First I was use GB18030. Now I change everywhere to UTF-8.
Also *.jspx page:
<?xml version='1.0' encoding='utf-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<jsp:directive.page contentType="text/html;charset=utf-8"/>
But when I use System.out.print("测试"), in Weblogic server consol is display "???".
Edited by: [email protected] on 2008-12-24 下午11:52 -
Help me to solve this Jsp problem
//Class1.java
package p1.p2;
public class Class1 implements Serializable
private String name1,name2;
public void setName1(String name)
name1=name;
public String getName1()
return name1;
public void setName2(String name)
name2=name;
public String getName2()
return name2;
//Class2.java
package p1.p2;
public class Class2
String name1,name2;
public String insert(Class1 c1)
name1 = c1.getName();
name2 = c2.getName();
return name1;
//Class3.jsp
<%@ page import="p1.p2.*" %>
<html>
<form action="/bobby/Class3.jsp" method=post>
Name1 : <input type=text name="cn1">
Name2 : <input type=text name="cn2">
<input type=submit value="Click"/>
</form>
</html>
<%! String a,b,c; %>
<%
Class1 c1 = new Class1();
Class1 c2 = new Class2();
a=request.getParameter("cn1");
b=request.getParameter("cn2");
c1.setName(a);
c1.setName(b);
c=c2.insert(c1);
out.println(c);
%>
WHEN I RUN THE JSP PROGRAM I GOT THE FOLLOWING ERROR.TELL ME THE SOLUTION TO SOLVE THIS PROBLEM.
javax.servlet.ServletException:
p1.p2.Class2.insert(Lp1/p2/Class1;)Ljava/lang/String;
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl .java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.j ava:758)
org.apache.jsp.Class3_jsp._jspService(Class3_jsp.java:76)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
root cause
java.lang.NoSuchMethodError: p1.p2.Class2.insert(Lp1/p2/Class1;)Ljava/lang/String;
org.apache.jsp.Class3_jsp._jspService(Class3_jsp.java:67)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)First, please put your code inside code tags. There's a nice little button. All you have to do is paste your code, highlight it and press the little code button. Thanks.
I had to make some adjustments to your original post. Either you had some closing braces in the wrong place, or you hve no idea what you're doing. I'm going to assume that Class1 is in a file named p1/p2/Class1.java and Class2 is in p1/p2/Class2.java.
//Class1.java
package p1.p2;
public class Class1 implements Serializable
private String name1,name2;
public void setName1(String name)
name1=name;
public String getName1()
return name1;
public void setName2(String name)
name2=name;
public String getName2()
return name2;
//Class2.java
package p1.p2;
public class Class2
String name1,name2;
public String insert(Class1 c1)
name1 = c1.getName();
name2 = c2.getName();
return name1;
//Class3.jsp
<%@ page import="p1.p2.*" %>
<html>
<form action="/bobby/Class3.jsp" method=post>
Name1 : <input type=text name="cn1">
Name2 : <input type=text name="cn2">
<input type=submit value="Click"/>
</form>
</html>
<%! String a,b,c; %>
<%
Class1 c1 = new Class1();
Class1 c2 = new Class2(); //<-- problem here, do you see it?
a=request.getParameter("cn1");
b=request.getParameter("cn2");
c1.setName(a);
c1.setName(b);
c=c2.insert(c1);
out.println(c);
%>Note the I highlighted the problem above. HTH. -
Adobe master collection CS5.5 5.5 MLP arabic language problem.
Hi all of you,
We have “master collection CS5.5 5.5 MLP international licensed version” it’s working fine but in Photoshop Arabic language is not working properly , I tried with a Photoshop CS5 extended middle east version it’s working fine in Arabic language . Is there any solution for this problem? Can I get any Arabic language pack for Photoshop?Moving this discussion to the Photoshop General Discussion
-
Weird Z and Y key swap and arabic filename problems in Illustrator CS3
Hi
I am having some very weird problems with Illustrator CS3.
At completely random times, the software starts to think my Y and Z keys have swapped places. i.e. When I type anything or use any shortcuts, the opposite letters appear and are used.
Also from time to time, when I save a file, the filename is written in Arabic and I have to rename the file again in Explorer to correct this.
Both of these problems are random and a restart or Illustrator usually fixes both of these. But what a pain and waste of time.
Anyone else getting problems like this?
Oh, I'm using Windows Vista.
Thanks
Mr MMy guess is, it is related to Windows. Try to press shift and ctrl at once if the problem occurs. The keys should be switched back...
You have probably installed more than one keyboard in Windows. Shift-ctrl is the standard way to switch between them. You can change this in the Windows keyboard configuration file.
I had this problem with a German and a VS keyboard installed. -
Arabic font problem in Indesign cs4
I was using Indesign CS2 and just upgraded to CS4. I was heavily using "traditional arabic" font in CS2 without any problem.
For those who don't know, in arabic, each letter is represented differently according to its place inside a word. Almost all letters have 4 different forms, at the begining, in the middle at the end and alone.
After the upgrade I can insert only the letter at the begining form. I can clearly see all fonts in all forms in glpyhs table.
Any suggestion ?
Thank youThis not a locked Windows font because I was using it in Indesign CS2 without any problem.
In Help>About section all I see, is CS4 6.0. So this in not a Middle Eastern version.
For the moment I found the following solution :
I found an Open Type Arabic Font.
When I type something with this font "propositional forms" setting is set to "General", this is the default setting and I was unable to set "Automatic" as default. First I type something in Arabic then I select the text and set "propositional forms" setting to "Automatic".Yes it is a little bit cumbersome but this is the only solution I found.
I could send font files to anybody if you want to try them . It is not allowed to send them as attachment -
JSP problem after PDF Form Submit
Hi,
Our project team is using a PDF with Acrobat Form fields behind it to post form data to a java servlet, where it is parsed and written to a legacy system.
Our problem: when we return a jsp confirmation page back to the user, we are getting intermittent responses - sometimes the user will see the page, sometimes not. Also of note - the URL address location in the browser is being changed to "C://TEMP/xxxxxx.html", instead of showing "http://myserver/myapp/confirmPage.jsp". In effect, it doesn't retain the server location from which the form data was submitted - instead, after the jsp on that server is rendered into html, it is being written to a temp location on the local hard drive as an .html page, then displayed from there.
In my debug testing, I have bypassed the bulk of my application code, submitting into the servlet and returning the jsp right back to the user. It works properly when submitted from an HTML page, but goes to the C://TEMP... route when submitted from the PDF. Therefore, I can conclude that the bug is not in our java code and is not in the jsp code.
On our PDF we are using an Adobe script submitForm() function, naming our servlet to send to (without appending #FDF on it) and specifying "false" as our second parameter, since we are passing the data as an HttpRequest instead of as FDF data.
I suspect the problem may be caused by some differences in the headers in the HttpRequest object coming from the PDF. In comparing the Request headers from the PDF submit and those from an HTML page submit:
From the PDF:
content-type = application/x-www-form-urlencoded
user-agent = Mozilla/4.0 (compatible; Adobe Acrobat Control Version 5.00 for ActiveX)
From an HTML submit:
content-type = text/html
user-agent = Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)
I have tried explicitly setting the headers to match those coming in from an HTML submit but this doesn't seem to make a difference.
Has anyone experienced a similar problem? Any thoughts?
janderThis is a bug from Acrobat !
The turnover is to send a FDF document with the file tag (/F) referencing the jsp page you want to display -
Xml/html to jsp - problem with quotes in attribute values
I am trying to convert a static html document into a jsp using an xsl stylesheet, but run into problems trying to use the jsp expression syntax inside of attribute values.
Here is a sample of the source file:
<input type="text" name="firstName" value=""/>
Here is what I want the resulting jsp file to look like:
<input type="text" name="firstName" value="<jsp:expression>customer.getField("firstName") </jsp:expression>">
Here is what part of my stylesheet looks like:
<xsl:template match="input">
<xsl:copy>
<xsl:copy-of select="@type"/>
<xsl:copy-of select="@name"/>
<xsl:attribute name="value">
<xsl:text disable-output-escaping="yes"><jsp:expression></xsl:text>
<xsl:text disable-output-escaping="yes">customer.getField(</xsl:text>
<xsl:text disable-output-escaping="yes">"</xsl:text>
<xsl:value-of select="@name"/> ")
<xsl:text disable-output-escaping="yes">")</xsl:text>
<xsl:text disable-output-escaping="yes"></jsp:expression></xsl:text>
</xsl:attribute>
</xsl:copy>
</xsl:template>
The problem i have is with the <%= customer.getField("firstName") %>. I have tried several different ways of inserting the double quotes around firstName, but no matter what I try, it always uses the entity reference instead of actually putting the " character. The jsp container will not accept the entity.
I am assuming that the problem is with trying to place double quotes inside of an attribute value. Any ideas how to get around this?
Thanks
DavidWhich App Server are you using?
You should just be able to escape the double quotes.
If that doesn't work, it's a bug in the app-server.
Alternatively, you can use single quotes around the
attribute value.
Hope that helps,
AlexSorry, I'm an idiot. By escaping you meant the unicode character escape "\u0022". I had not tried that. However, once i realized what you meant, I tried it, and it worked. Thanks for your help.
David -
Iplanet webserver 4.1 JSP problem
Hi I am using iplanet webserver 4.1, whenever i change my jsp file, i have to restart my webserver instance otherwise ia gm getting error..is ther any way i can prevent to restart the webserver?
this is the script.
mv /logs/https-`uname -a`-443/access /logs/https-`uname -a`-443/access.yesterday
compress /logs/https-`uname -a`-443/access.yesterday
/opt/netscape/server4/https-`uname -a`-443/restart
the moving and compressing works properly but the restart command doesn't actually kill the and restart the httpd process, and doesn't create the access or error log.
The restart is a graceful restart will not ask for password, the same setting was working fine for a long time. it suddenly started to give this problem.
the webserver is working fine(taking requests ,etc) except that the log files are not being written.
i did a truss and the data collected is above i see that it is giving error #91 ERESTART many times
there is another server with same settings which is working fine the only difference is that its patch level is lower. -
hello i am using netbeans to create a simple login system using a servlet and a jsp. the jsp has the following code:
<form action="login" method="get">
<br>UserID <input type="text" name="userID" size="20" maxlength="20">
<br>Password <input type="password" name="password" size="20" maxlength="20">
<br><input type="submit" value="Login">
</form>
the servlet name is login and located under src/java/login.java
however when i run it its just giving me this msg that it cannot find the servlet:
type Status report
message Servlet login is not available
description The requested resource (Servlet login is not available) is not available.
does anyone know what the problem might be?How have you defined this servlet in your web.xml ?
For example it should be something like this:
<servlet>
<servlet-name>SomeServletAlias</servlet-name>
<servlet-class>servletpackagename.ServletClassName</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>SomeServletAlias</servlet-name>
<url-pattern>/servleturlpattern</url-pattern>
</servlet-mapping>If you have the URL Pattern as: /servleturlpattern , then in your form's action put action="/servleturlpattern" and not action="servleturlpattern"
Where ever you reference the servlet, the URL for the servlet should match exactly as you specify it in the URL-Pattern. Otherwise it wont work. -
JDeveloper 3.1 and JSP problems
Hello everybody.
I present myself. I am a French student in computer sciences who makes a training course in a French company. (You will excuse the bad quality of my English)
I have some difficulties in the use of Oracle JDeveloper tool.
1st problem:
I encountered this problem during the creation of a JSP page for a simple Intranet application connected to an Oracle database.
JDeveloper doesnt want to take into account the fact that one of my tables has two primary (composite) keys;(Each of these two keys is primary key of another table). That results on the one hand in an error during the loading of the default edition form (" JBO-25030: Failed to find or invalidate owning entity ") and in addition by impossibility of consulting the recordings of this table according to one of the two key parameters (selected in RowSetBrowser). Nevertheless, this last aspect works within the Oracle Business Component Browser.
2nd problem:
Imagine, for example, the following simplified conceptual diagram:
Racks ---> Files ---> Sheets (they are tables)
How on a JSP page, can I display in the easiest way (with a JSNavigatorTab and a RowSetBrowser), the recordings of the table Sheets of a particular File, without to use a selection at the table Racks level.
(You choose directly, with a ComboBox or a RowSetBrowser, a File to display all the corresponding Sheets, without to choose a Rack before.)
In fact, I try to have an application as simple and ergonomic as possible.
I thank all those who will be able to inform me on these obscure points which slow down my project considerably.
Regards.
Guillaume Vidal
nullHi,
* For your 1st problem, try to uncheck the "composite association" checkbox in the association object linking your tables together, should work better.
* For the second one,
when you create the application module containing the rack/file and sheet views, add the file view at root level (i.e do not use the view link relationship, which would include it as a detail view for the racks view), then add the sheet view through the file/sheet viewLink.
This way you'll be able to browse the entire file and sheet list in a basic master/detail view.
Good luck, Remi
by Guillaume Vidal:
Hello everybody.
I present myself. I am a French student in computer sciences who makes a training course in a French company. (You will excuse the bad quality of my English)
I have some difficulties in the use of Oracle JDeveloper tool.
1st problem:
I encountered this problem during the creation of a JSP page for a simple Intranet application connected to an Oracle database.
JDeveloper doesnt want to take into account the fact that one of my tables has two primary (composite) keys;(Each of these two keys is primary key of another table). That results on the one hand in an error during the loading of the default edition form (" JBO-25030: Failed to find or invalidate owning entity ") and in addition by impossibility of consulting the recordings of this table according to one of the two key parameters (selected in RowSetBrowser). Nevertheless, this last aspect works within the Oracle Business Component Browser.
2nd problem:
Imagine, for example, the following simplified conceptual diagram:
Racks ---> Files ---> Sheets (they are tables)
How on a JSP page, can I display in the easiest way (with a JSNavigatorTab and a RowSetBrowser), the recordings of the table Sheets of a particular File, without to use a selection at the table Racks level.
(You choose directly, with a ComboBox or a RowSetBrowser, a File to display all the corresponding Sheets, without to choose a Rack before.)
In fact, I try to have an application as simple and ergonomic as possible.
I thank all those who will be able to inform me on these obscure points which slow down my project considerably.
Regards.
Guillaume Vidal
null -
Please Urgent sound applet in jsp problem
Hi please any body hekp me urgently.
I have a problem while playing a sound applet in the jsp file the error is class not found.
My applet class file is in the com.mypack.common
its code is
public class PlayErrorSoundApplet extends Applet
public PlayErrorSoundApplet()
public void init()
public void playSound()
String soundObj = getParameter("soundObj");
AudioClip sound = getAudioClip(getDocumentBase(), "success.wav");
sound.play();
in the jsp i have written the code like this
<applet codebase="com.mypack.common" code="PlayErrorSoundApplet.class" name="soundApplet" width="0" height="0">
<param name="soundObj" value="error.wav">
</applet>
In the applet console i got class not found error.
please help me .....advanced thanks......actually, codbase is a directory. so
<applet codebase="com/mypack/common" code="PlayErrorSoundApplet.class" name="soundApplet" width="0" height="0">
<param name="soundObj" value="error.wav">
</applet>this means you have something like
pacakge com.mypack.common
public class PlayErrorSoundApplet {
Make sure to put the html file in the root directory of the package structure
/myhtmlfile.html
/com
/mypack
/common
PlayErrorSoundApplet.class -
Custom tags in jsp - problems with import in java pgm
Hi,
I am new to JSP and am facing some problems.
I am trying to compile the foll. java program and it is giving an error saying 1."Package javax.servlet.jsp does not exist", 2."Package javax.servlet.jsp.tagext does not exist".
I am using 1.j2sdk1.4.1_02, 2.j2sdkee1.3.1,and 3.Tomcat 4.1
My java_home=C:\j2sdk1.4.1_02
j2ee_home=C:\j2sdkee1.3.1
path=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;c:\j2sdkee1.3.1\bin;c:\j2sdk1.4.1_02\bin;c:\j2sdkee1.3.1\doc\api;c:\jakarta-ant-1.5.1\bin
classpath=c:\j2sdkee1.3.1\bin;c:\j2sdk1.4.1_02\bin;c:\j2sdkee1.3.1\doc\api
can anybody help me with it?
Regards,
newtojsp
import java.io.IOException;
import java.util.Date;
import doc.api.javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
public class TestTag extends TagSupport
public int doStartTag () throws JSPTagException
String dateString = new Date().toString ();
try
JspWriter out = page.context.getOut ();
out.println ("Welcome to the Loan Dept" + " <br>");
out.println ("Today is:" + dateString + "<br>");
return SKIP_BODY;
} catch (IOException ee)
throw JspTagException ("Error Encountered");
public int doEndTag () throws JSPTagException
return EVAL_PAGE;I got the solution for this.
Thanks
Newtojsp -
JSP PROBLEM...THEORETICAL QUESTION
Hi as you all know by now im quite new to jsp and have struggled so far to get something decent working but now that i have im happy :D
quick question for you all...
imagine this scenario. when you submit an application for something...i.e. a job...your application status is 'pending' and when moved to the interview stage the status is changed to 'interview' and then if successful changes to 'job offer'
these 3 'status' would be done as final int data types in java...ive done it before and thats not a problem. however how is one to approach that using jsp?? can it be done...if so, how??
also when the user logs in to check the current status of his/her application they should be presented with this status either pending/interivew/job offer.
any ideas??
at the moment all i have done is an application submission which gets stored in an access database. i am nowworking on the part which manipulates the submitted applications according to criteria
thanks!Level_ID Level_Name
0 Pending
1 Interview
2 Offer
3 Rejection
how would i make a user who logs in to see his status
as the word pending rather than 0?? i.e. how can i
point the Level_ID in Login_Details table to find its
corresponding Level_Name in the Levels table?Create a HashMap at init of your Main Servlet that is populated by this data, keyed by Integer. Make this table reloadable via an HTTP call, that way if you want to update the names you can do so without needing to restart your webserver.
Then when its time to show the name, rather than the number, do :
<%= servlet.statusTable.get( new Integer( user.getStatus() ) ) %>
Probably would be a good idea to put this into a method so you can verify that the object exists, etc., call it showStatus(user)
Maybe you are looking for
-
I installed Firefox on my Mac today (Mac OS 10.5.8) However File>New does not open browser window. Nothing happens. I rebooted and launced Firefox again but this did not help. I had been using Safari. Firefox is clearly running and I must do a "Force
-
Dual cloud dual hub single tier dmvpn with backup service provider
Hi, I have a design issue with a WAN network. I have decided to use dual cloud dual hub single tier DMVPN topology (ref. to http://www.cisco.com/application/pdf/en/us/guest/netsol/ns171/c649/ccmigration_09186a008075ea98.pdf - "Dynamic Multipoint VPN
-
VFP 9.0 SP2 Help File Problem
I downloaded the updated Visual FoxPro 9 SP2 help file (dv_foxhelp.chm) from the Microsoft website. Is anyone else having trouble with this file? When it opens, I see the table of contents, but all the topics just show a "The address is not valid"
-
My credit card information is correct in itunes, but I keep getting a message to put in my security code. This is the same account I have always used. what do I do?
-
CATS (Regular) - configuration document Required
Hi Sap Gurus, Can some one send me CATS(Regular) Configuration Document and steps to Transfer to HR with approval. Full Points will be rewarded immediately. Regards, Vinoth Kumar.R