Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

jbuilder encoding

  Asked By: Chisisi    Date: Feb 25    Category: Java    Views: 1233
  

I used these tags and codes to connect to a DB inserting and selceting unicode characters and it worked


<%@ page import="java.sql.*" %>

<%@ page import="java.util.Properties" %>

<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>

<% request.setCharacterEncoding("utf-8");%>

.....



Properties props = new Properties();

props.put ("user", userName);

props.put ("password", userPsw);

props.put ("charSet", "UTF-8");

con = DriverManager.getConnection (url, props);





I could insert and select data from my DB this way

but there is still a problem when I use Jbuilder to edit and run my jsp page

how can I configure and use Jbuilder to create

a jsp page with utf-8 unicode?

I changed project properties to support unicode utf8 but it doesn't help

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Faeezah Khan     Answered On: Feb 25



<html>
<%@ page  pageEncoding="UTF-8"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.util.Properties"%>
<body bgcolor="#ffffff">
<%!String printString = "ÓáÇã";%>
<%
request.setCharacterEncoding("UTF-8"); //Baraye daryafte dadehaye farsi az safhehaye digar.
response.setCharacterEncoding("UTF-8"); //For jdk1.5, later .Baraye encoding  dadehaye khode safhe.
%>
<%=printString %></body>
</html>

 
Didn't find what you were looking for? Find more on jbuilder encoding Or get search suggestion and latest updates.




Tagged: