You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sakis Chatzinikolaou <sh...@upatras.gr> on 2003/01/08 12:41:26 UTC
JSPWriter prints ???
Hi all,
I am using Struts 1.0.2 with mySQL 3.23.
I have some records in the DB which are in greek charset.
The recorset form mySQL comes OK in Greek from the Action bean.
I verify this in the debugger because the html select is well defined.
I get <select ..... > with the greek characters in the options.
Wher the String text reaches the JSpWriter.print(text)
then I get ???? in the html page in the select box(drop down box).
I use Charset=Iso 8859-7
Is there a problem with JSPWriter ?
I downloaded the International JDK 1.4.1_01 but nothing seems to change from the US English only.
Any ideas ?
Thanks in advance
Sakis
Re: JSPWriter prints ???
Posted by Sakis Chatzinikolaou <sh...@upatras.gr>.
Jim ,
Have you used any special settings in mySQL for the greek characters ?
Thanks
Sakis
----- Original Message -----
From: "Jim Theodoridis" <st...@tera.gr>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, January 09, 2003 2:45 PM
Subject: Re: JSPWriter prints ???
> Hi!..(Geia)
>
> Sory I confused.
> Forget about PageContext. Here is an example jsp
>
> <%@ page contentType="text/html; charset=iso-8859-7" %>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
>
> <html:form action="editArticle.do"
> name="articleForm"
> type="gr.tera.ekozani.article.ArticleForm"
> scope="request"
> focus="title" >
> <table width="265" border="0" cellspacing="1" cellpadding="1"
> align="center" bgcolor="#9bbad6">
> <tr>
> <td align="right"><b>Κατηγορία </b></td>
> <td valign="left">
> <html:select property="categoryID" size="1" styleClass="form">
>
> <html:options collection="users" property="id"
> labelProperty="name" />
>
> </html:select>
> </td>
> </tr>
> </table>
> </html:form>
>
> Where "users" is a Collection it comes from an action.
> What OS are U using?
>
> Jim Theodoridis
> (Geia sou)
>
> ----- Original Message -----
> From: "Sakis Chatzinikolaou" <sh...@upatras.gr>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Thursday, January 09, 2003 1:03 PM
> Subject: Re: JSPWriter prints ???
>
>
> >
> > Hi Jim , (Geia sou)
> >
> > I already use iso-8859-7 in the page as you type in the example
> >
> > Have you set anything else in mySQL for the greek language to be set ?
> >
> > I used an application Navicat to set the greek language in mySQL.
> >
> > The greek chartacters seem ok in the records.
> >
> > Do you think that I shouls explicitly set Page
> Content.setCharacterEncoding
> > ?
> >
> > What should I pass in the setCharacterEncoding ("iso-8859-7") ?
> >
> > Thanks for your concern
> > Eyxaristo :))
> > ----- Original Message -----
> > From: "Jim Theodoridis" <st...@tera.gr>
> > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > Sent: Thursday, January 09, 2003 12:48 PM
> > Subject: Re: JSPWriter prints ???
> >
> >
> > > Hi.
> > >
> > > I use the same database and Struts. The data of the database displays
> well
> > > but only
> > > if i use <%@ page contentType="text/html; charset=iso-8859-7" %>
> > >
> > > I think U must set the corect character encoding for the PageContext
> > >
> > > PageContext .setCharacterEncoding(.....)
> > >
> > > Jim Theodoridis
> > >
> > > ----- Original Message -----
> > > Georg thanks for your concern.
> > > The options are not from the resources file.
> > > They are read from mySQL.
> > > I use the html:select and the html:options tag
> > > to display the records.
> > > I debugged the Options Taga from the struts source
> > > and it calls
> > > ResponseUtils.write(pageContext, sb.toString());
> > >
> > > which is this
> > > public static void write(PageContext pageContext, String text)
> > > throws JspException {
> > >
> > > JspWriter writer = pageContext.getOut();
> > > try {
> > > writer.print(text);
> > > } catch (IOException e) {
> > > RequestUtils.saveException(pageContext, e);
> > > throw new JspException
> > > (messages.getMessage("write.io", e.toString()));
> > > }
> > >
> > > }
> > >
> > > the text in "writer.print(text);"
> > > looks fine before print is called
> > > but in the html I get ???? instead for the records
> > >
> > > Thanks
> > > (Geia sou kai esena)
> > >
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
> >
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: JSPWriter prints ???
Posted by Sakis Chatzinikolaou <sh...@upatras.gr>.
Hi (Geia sou )
Jim The code I use is pretty much the same with the one you supplied.
The problem is not with the select (combo box) but with the options inside.
All the Greek options display in ??? and I used a for a test an English
record which displays normally.
Do you use international JDK1.4.1 ? (Jim)
I use Win2000 SP3
----- Original Message -----
From: "Jim Theodoridis" <st...@tera.gr>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, January 09, 2003 2:45 PM
Subject: Re: JSPWriter prints ???
> Hi!..(Geia)
>
> Sory I confused.
> Forget about PageContext. Here is an example jsp
>
> <%@ page contentType="text/html; charset=iso-8859-7" %>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
>
> <html:form action="editArticle.do"
> name="articleForm"
> type="gr.tera.ekozani.article.ArticleForm"
> scope="request"
> focus="title" >
> <table width="265" border="0" cellspacing="1" cellpadding="1"
> align="center" bgcolor="#9bbad6">
> <tr>
> <td align="right"><b>Κατηγορία </b></td>
> <td valign="left">
> <html:select property="categoryID" size="1" styleClass="form">
>
> <html:options collection="users" property="id"
> labelProperty="name" />
>
> </html:select>
> </td>
> </tr>
> </table>
> </html:form>
>
> Where "users" is a Collection it comes from an action.
> What OS are U using?
>
> Jim Theodoridis
> (Geia sou)
>
> ----- Original Message -----
> From: "Sakis Chatzinikolaou" <sh...@upatras.gr>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Thursday, January 09, 2003 1:03 PM
> Subject: Re: JSPWriter prints ???
>
>
> >
> > Hi Jim , (Geia sou)
> >
> > I already use iso-8859-7 in the page as you type in the example
> >
> > Have you set anything else in mySQL for the greek language to be set ?
> >
> > I used an application Navicat to set the greek language in mySQL.
> >
> > The greek chartacters seem ok in the records.
> >
> > Do you think that I shouls explicitly set Page
> Content.setCharacterEncoding
> > ?
> >
> > What should I pass in the setCharacterEncoding ("iso-8859-7") ?
> >
> > Thanks for your concern
> > Eyxaristo :))
> > ----- Original Message -----
> > From: "Jim Theodoridis" <st...@tera.gr>
> > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > Sent: Thursday, January 09, 2003 12:48 PM
> > Subject: Re: JSPWriter prints ???
> >
> >
> > > Hi.
> > >
> > > I use the same database and Struts. The data of the database displays
> well
> > > but only
> > > if i use <%@ page contentType="text/html; charset=iso-8859-7" %>
> > >
> > > I think U must set the corect character encoding for the PageContext
> > >
> > > PageContext .setCharacterEncoding(.....)
> > >
> > > Jim Theodoridis
> > >
> > > ----- Original Message -----
> > > Georg thanks for your concern.
> > > The options are not from the resources file.
> > > They are read from mySQL.
> > > I use the html:select and the html:options tag
> > > to display the records.
> > > I debugged the Options Taga from the struts source
> > > and it calls
> > > ResponseUtils.write(pageContext, sb.toString());
> > >
> > > which is this
> > > public static void write(PageContext pageContext, String text)
> > > throws JspException {
> > >
> > > JspWriter writer = pageContext.getOut();
> > > try {
> > > writer.print(text);
> > > } catch (IOException e) {
> > > RequestUtils.saveException(pageContext, e);
> > > throw new JspException
> > > (messages.getMessage("write.io", e.toString()));
> > > }
> > >
> > > }
> > >
> > > the text in "writer.print(text);"
> > > looks fine before print is called
> > > but in the html I get ???? instead for the records
> > >
> > > Thanks
> > > (Geia sou kai esena)
> > >
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
> >
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: JSPWriter prints ???
Posted by Jim Theodoridis <st...@tera.gr>.
Hi!..(Geia)
Sory I confused.
Forget about PageContext. Here is an example jsp
<%@ page contentType="text/html; charset=iso-8859-7" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html:form action="editArticle.do"
name="articleForm"
type="gr.tera.ekozani.article.ArticleForm"
scope="request"
focus="title" >
<table width="265" border="0" cellspacing="1" cellpadding="1"
align="center" bgcolor="#9bbad6">
<tr>
<td align="right"><b>Κατηγορία </b></td>
<td valign="left">
<html:select property="categoryID" size="1" styleClass="form">
<html:options collection="users" property="id"
labelProperty="name" />
</html:select>
</td>
</tr>
</table>
</html:form>
Where "users" is a Collection it comes from an action.
What OS are U using?
Jim Theodoridis
(Geia sou)
----- Original Message -----
From: "Sakis Chatzinikolaou" <sh...@upatras.gr>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, January 09, 2003 1:03 PM
Subject: Re: JSPWriter prints ???
>
> Hi Jim , (Geia sou)
>
> I already use iso-8859-7 in the page as you type in the example
>
> Have you set anything else in mySQL for the greek language to be set ?
>
> I used an application Navicat to set the greek language in mySQL.
>
> The greek chartacters seem ok in the records.
>
> Do you think that I shouls explicitly set Page
Content.setCharacterEncoding
> ?
>
> What should I pass in the setCharacterEncoding ("iso-8859-7") ?
>
> Thanks for your concern
> Eyxaristo :))
> ----- Original Message -----
> From: "Jim Theodoridis" <st...@tera.gr>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Thursday, January 09, 2003 12:48 PM
> Subject: Re: JSPWriter prints ???
>
>
> > Hi.
> >
> > I use the same database and Struts. The data of the database displays
well
> > but only
> > if i use <%@ page contentType="text/html; charset=iso-8859-7" %>
> >
> > I think U must set the corect character encoding for the PageContext
> >
> > PageContext .setCharacterEncoding(.....)
> >
> > Jim Theodoridis
> >
> > ----- Original Message -----
> > Georg thanks for your concern.
> > The options are not from the resources file.
> > They are read from mySQL.
> > I use the html:select and the html:options tag
> > to display the records.
> > I debugged the Options Taga from the struts source
> > and it calls
> > ResponseUtils.write(pageContext, sb.toString());
> >
> > which is this
> > public static void write(PageContext pageContext, String text)
> > throws JspException {
> >
> > JspWriter writer = pageContext.getOut();
> > try {
> > writer.print(text);
> > } catch (IOException e) {
> > RequestUtils.saveException(pageContext, e);
> > throw new JspException
> > (messages.getMessage("write.io", e.toString()));
> > }
> >
> > }
> >
> > the text in "writer.print(text);"
> > looks fine before print is called
> > but in the html I get ???? instead for the records
> >
> > Thanks
> > (Geia sou kai esena)
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: JSPWriter prints ???
Posted by Sakis Chatzinikolaou <sh...@upatras.gr>.
Hi Jim , (Geia sou)
I already use iso-8859-7 in the page as you type in the example
Have you set anything else in mySQL for the greek language to be set ?
I used an application Navicat to set the greek language in mySQL.
The greek chartacters seem ok in the records.
Do you think that I shouls explicitly set Page Content.setCharacterEncoding
?
What should I pass in the setCharacterEncoding ("iso-8859-7") ?
Thanks for your concern
Eyxaristo :))
----- Original Message -----
From: "Jim Theodoridis" <st...@tera.gr>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, January 09, 2003 12:48 PM
Subject: Re: JSPWriter prints ???
> Hi.
>
> I use the same database and Struts. The data of the database displays well
> but only
> if i use <%@ page contentType="text/html; charset=iso-8859-7" %>
>
> I think U must set the corect character encoding for the PageContext
>
> PageContext .setCharacterEncoding(.....)
>
> Jim Theodoridis
>
> ----- Original Message -----
> Georg thanks for your concern.
> The options are not from the resources file.
> They are read from mySQL.
> I use the html:select and the html:options tag
> to display the records.
> I debugged the Options Taga from the struts source
> and it calls
> ResponseUtils.write(pageContext, sb.toString());
>
> which is this
> public static void write(PageContext pageContext, String text)
> throws JspException {
>
> JspWriter writer = pageContext.getOut();
> try {
> writer.print(text);
> } catch (IOException e) {
> RequestUtils.saveException(pageContext, e);
> throw new JspException
> (messages.getMessage("write.io", e.toString()));
> }
>
> }
>
> the text in "writer.print(text);"
> looks fine before print is called
> but in the html I get ???? instead for the records
>
> Thanks
> (Geia sou kai esena)
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: JSPWriter prints ???
Posted by Jim Theodoridis <st...@tera.gr>.
Hi.
I use the same database and Struts. The data of the database displays well
but only
if i use <%@ page contentType="text/html; charset=iso-8859-7" %>
I think U must set the corect character encoding for the PageContext
PageContext .setCharacterEncoding(.....)
Jim Theodoridis
----- Original Message -----
Georg thanks for your concern.
The options are not from the resources file.
They are read from mySQL.
I use the html:select and the html:options tag
to display the records.
I debugged the Options Taga from the struts source
and it calls
ResponseUtils.write(pageContext, sb.toString());
which is this
public static void write(PageContext pageContext, String text)
throws JspException {
JspWriter writer = pageContext.getOut();
try {
writer.print(text);
} catch (IOException e) {
RequestUtils.saveException(pageContext, e);
throw new JspException
(messages.getMessage("write.io", e.toString()));
}
}
the text in "writer.print(text);"
looks fine before print is called
but in the html I get ???? instead for the records
Thanks
(Geia sou kai esena)
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>