• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem in encoding in the jsp page.  RSS feed

naresh govindaswmay
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In this project i am using struts and EJB is the main.This is fully concentrated on dealer and client chat details.From web page itself admin can able to see what dealer and client conversation.when admin given the request to the struts page it directly calls the Action page.Inside the the Action page just I have created the Object of Bean "I have attached the part of code here "
The code is Action page.
InitialContext initialContext=new InitialContext();
Object obj = initialContext.lookup("LHAdminBeanLocal");
LHAdminLHome lhadminlocalHome = (LHAdminLHome)obj;
LHAdminLocal lhlocal = lhadminlocalHome.create();
ArrayList chats = lhlocal.getDealerChat(request.getParameter("dealer"),date.toString());

while call this method it just check the conditation in the databaase ad returns the values in the bean file itself I have attached the code is bean class .
ResultSet rs = stmt.executeQuery(query);
Chat chat = new Chat();
String dealerChatText=rs.getString("ctext");
System.out.println("Delaer Chat Text-->"+dealerChatText);
This is code is struts.

<logic:iterate id="chat" name="ChatContent" >
<tr class='<%= i++%2==1?"tablerow_1":"tablerow_2" %>'>
<td valign='top'><bean:write name="chat" property="clientid" /></td>
<td valign='top'><bean:write name="chat" property="name" /></td>
<td valign='top'><bean:write name="chat" property="clientcompany" /></td>
<td valign='top'><pre><bean:write name="chat" property="chattext" /></pre></td>
<td valign='top'><bean:write name="chat" property="onlinetime" /></td>
<td valign='top'><bean:write name="chat" property="fromip" /></td>

This is the bean code.After getting all the datas from the database the values are stored in the normal java bean class.after that the bean class is stored in the ArrayList. I have given in bold.I have iterate all the things in jsp file itself.Now the problem is my database contains all of arabic and chinese character.while retriving these datas,browser is showing ??? like this.I have checked UTF-8 and all the charse encoding.Please give me the solution I am waiting for this
vidya sagar
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In logic:iterate tag you did not specify any collection to iterate?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!