Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Glassfish encoding

I'm using the code in this example example and in the runUpdate() function which i put in a javabean in a web application in Netbeans 6.8 with Glassfish v3. It seems i have an encoding problem because question marks appear in the table.

I have tried so far:

  1. In nbproject->private->private.properties add runtime.encoding=UTF-8>
  2. In project->properties->sources->encoding utf-8
  3. In program files->netbeans->etc->netbeans_conf in netbeans_default_options i add -J-DFile.encoding=UTF-8
  4. In project->properties->build->compiling->additional compiler options -encoding utf-8
  5. In sun-web.xml i added <locale-charset-info default-locale="UTF-8"> <locale-charset-map locale="" charset=""/> <parameter-encoding default-charset="UTF-8"/> </locale-charset-info>

Also when i use system.out.print() in the glassfish output panel i get gibberish. I'm in the last level of madness please take a look. Thank you.

EDIT Also when i do listing .5 i get a glassfish error:

WARNING: WEB0500: default-locale attribute of locale-charset-info element is being ignored
like image 215
Argiropoulos Stavros Avatar asked Feb 26 '10 11:02

Argiropoulos Stavros


People also ask

What is GlassFish used for?

Eclipse GlassFish Server provides a server for the development and deployment of Java Platform, Enterprise Edition (Java EE platform) applications and web technologies based on Java technology.

Is GlassFish free for commercial use?

GlassFish is free software and was initially dual-licensed under two free software licences: the Common Development and Distribution License (CDDL) and the GNU General Public License (GPL) with the Classpath exception.

What is GlassFish web XML?

The glassfish-web.xml file configures a web application (WAR file). The element hierarchy is as follows: glassfish-web-app . context-root . security-role-mapping . . role-name . .

What is GlassFish server target?

From the NetBeans help: Target: (Optional) Enter a value that is used to identify a cluster and/or stand-alone instance. This value will be used as the value for the target option when running server administration tasks from the IDE.


1 Answers

Have you tried using glassfish-web.xml instead of sun-web.xml ?

To change default Glassfish POST fields encoding, I put this to WEB-INF/glassfish-web.xml, and it worked (I use glassfish 3.1.2):

<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD
GlassFish Application Server 3.1 Servlet 3.0//EN"
"http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app>
    <parameter-encoding default-charset="UTF-8" />
</glassfish-web-app>

I'm not sure if it will help you, but may help other people having the same problem as me.

like image 142
Maciek Łoziński Avatar answered Sep 22 '22 21:09

Maciek Łoziński