0

request from a jsp page in a servlet

asked 2006-10-20 09:44:10 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3972624

By: nobody

Hello,

I have implemented a MVC application using jsp (with zk tags), javabeans and servlets. The application works properly when making inserts, updates and deletes to an oracle database, but when latin characters like "a, a, i, i K" are used. When I insert one of them and want to insert or update, the characters inserted in the database are not correct.

I have monitorized all the process, and the information contained in the jsp (in zk and html components) it's ok before making a submit, but when I obtain the information of the request on the Servlet these characters are incorrect.

In the web.xml I have the listener declared in order to process all the pages jps's (*.jsp)

Could anybody help me with this?
Many thanks in advance.

Maria

delete flag offensive retag edit

6 Replies

Sort by ยป oldest newest

answered 2006-10-23 01:55:52 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3975534

By: henrichen

Did you properly set your page's charset? We suggest using UTF-8.

/henri

link publish delete flag offensive edit

answered 2006-10-23 06:50:10 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3975683

By: nobody

Hello,

Yes, I have the UTF-8 tag in all pages. These include the tag "<%@page pageEncoding="UTF-8"%>" in the first line. The project web.xml also includes the tag "<?xml version=" 1.0" encoding="UTF-8"?>".

When the Zk filter processes the jsp page and shows it on the navigator, the latin characters appear correctly, but when the information is sent to the Servlet the characters are changed. For instance, the word "rubi" is replaced by "rubA".

I think that the Zk filter could be the problem. Do you think it is possible?

I'm developing the application on Netbeans 5.0 with tomcat 5.5.9.



link publish delete flag offensive edit

answered 2006-10-24 02:15:51 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3976990

By: henrichen

Can you replace the ZK component with regular HTML input component and try again?

I mean, for example, replace zk's <textbox ...> with an HTML <input type="text"
..>, key in the special character and submit. See if is ok.

We need to verify whether it is ZK's issue. Since submit is really done by browswer, not ZK.

/henri

link publish delete flag offensive edit

answered 2006-10-24 08:00:56 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3977239

By: nobody

Hello,

These is the jps code without zk components:

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>InsertPercebe</title>
</head>
<body>
<form action="/Zkintra2/rsServlet" method="post">
<input type="hidden" name="opcio" value="20" />
<input id="name" type="text" name="nom" />
<input id="llinatge1" type="text" name="llinatge1" />
<input id="llinatge2" type="text" name="llinatge2" />
<input type="submit" value="Dessar"/>

</form>
</body>
</html>

--------------------------------------------------------------------------------
---
These is the html show on the navigator, pocessed by the listener:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>InsertPercebe</title>
</head>
<body>
<form action="/Zkintra2/rsServlet" method="post">
<input type="hidden" name="opcio" value="20" />
<input id="name" type="text" name="nom" />
<input id="llinatge1" type="text" name="llinatge1" />
<input id="llinatge2" type="text" name="llinatge2" />
<input type="submit" value="Dessar"/>

</form>
</body>
</html>

--------------------------------------------------------------------------------
---
These is the code returned to the navigator (another page jsp) after the servlet process the request (The same information it's on the servlet):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">







<html><body id="_pc2">


<div id="_pc3" zk_type="zul.grid.Grid" class="grid">

<div id="_pc3!body" class="grid-body">
<table width="100%" border="0" cellpadding="0" cellspacing="0"
class="grid-btable">




<tbody id="_pc4">
<tr id="_pc5" valign="rigth">
<td id="_pc6!chdextr" class="gridev">


<table id="_pc6" zk_type="Box" cellpadding="0" cellspacing="0"> <tr valign="top" id="_pc6!cave">
<td id="_pc7!chdextr" class="hbox">

<span id="_pc7">Resultat de la Operacio</span></td> </tr> </table>

</td>
</tr>






<tr id="_pc8" valign="rigth">
<td id="_pc9!chdextr" class="gridev">


<table id="_pc9" zk_type="Box" cellpadding="0" cellspacing="0"> <tr valign="top" id="_pc9!cave">
<td id="_pca!chdextr" class="hbox">

<span id="_pca">Hi ha hagut una errada en l'execucio del procediment.
(0)</span></td>

</tr>
</table>
</td>
</tr>






<tr id="_pcb" valign="rigth">
<td id="_pcc!chdextr" class="gridev">


<table id="_pcc" zk_type="Box" cellpadding="0" cellspacing="0"> <tr valign="top" id="_pcc!cave">
<td id="_pcd!chdextr" class="hbox">

<span id="_pcd">nom

=

aixA2


llinatge2

=

una

prova
llinatge1

=

Acs


opcio

=

20</span></td>

</tr>
</table>
</td>
</tr>






<tr id="_pce" valign="rigth">
<td id="_pcf!chdextr" class="gridev">


<table id="_pcf" zk_type="Box" cellpadding="0" cellspacing="0"> <tr valign="top" id="_pcf!cave">
<td id="_pcg!chdextr" class="hbox"><a id="_pcg"
href="/Zkintra2/rsServlet?opcio=0">Tornar a la Llista de Perceptors</a></td> </tr>

</table>
</td>
</tr>
</tbody>

</table>
</div>
</div>

<script type="text/javascript">

</script>
</body></html>

<link rel="stylesheet" type="text/css"
href="/Zkintra2/zkau/web/zul/css/normmoz.css.dsp"/>

<script type="text/javascript">
zk_action="/Zkintra2/zkau";
zk_desktopId="g6be";
</script>

<script type="text/javascript" src="/Zkintra2/zkau/web/js/ext/prototype/prototype.js"
charset="UTF-8">
</script>
<script type="text/javascript" src="/Zkintra2/zkau/web/js/ext/aculo/effects.js"
charset="UTF-8">
</script>
<script type="text/javascript" src="/Zkintra2/zkau/web/js/ext/aculo/dragdrop.js"
charset="UTF-8">
</script>
<script type="text/javascript" src="/Zkintra2/zkau/web/js/zk/html/boot.js"
charset="UTF-8">
</script>
<script type="text/javascript" src="/Zkintra2/zkau/web/js/zk/html/lang/mesg_es.js"
charset="UTF-8">
</script>
<script type="text/javascript" src="/Zkintra2/zkau/web/js/zk/html/common.js"
charset="UTF-8">
</script>
<script type="text/javascript" src="/Zkintra2/zkau/web/js/zk/html/au.js"
charset="UTF-8">
</script>

<script type="text/javascript" src="/Zkintra2/zkau/web/js/zk/locale.js.dsp"
charset="UTF-8">
</script>
<script type="text/javascript">
zk.mods["fckez.fckez"]="2.3";
zk.mods["dojoz.dojo"]="0.2.2";
</script>




link publish delete flag offensive edit

answered 2006-10-24 21:49:48 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3978381

By: nobody

Hello,

I'm investigating about this problem.
May be the problem are in the tomcat.

see these links:
http://forum.java.sun.com/thread.jspa?threadID=459525&messageID=2102807
http://www.theserverside.com/discussions/thread.tss?thread_id=39530

link publish delete flag offensive edit

answered 2006-10-25 08:06:58 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3978838

By: nobody

Hello,

The problem it's on tomcat server.
The solution to the problem is to add the next code before to read any parameter.

try {
req.setCharacterEncoding("UTF-8");
} catch (UnsupportedEncodingException e)
{ System.out.println("Error setting the character encoding from the request " + e); }


Thans's

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2006-10-20 09:44:10 +0800

Seen: 366 times

Last updated: Oct 25 '06

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More