This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes BEA/Weblogic and the fly likes Default value for webapp.encoding.default in weblogic-application.xml ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Default value for webapp.encoding.default in weblogic-application.xml ?" Watch "Default value for webapp.encoding.default in weblogic-application.xml ?" New topic
Author

Default value for webapp.encoding.default in weblogic-application.xml ?

David Balažic
Ranch Hand

Joined: May 15, 2008
Posts: 86
If webapp.encoding.default is not defined in weblogic-application.xml, what encoding is used by default?

I am interested in the encoding of URI/URL parameters, as explained here: http://www.lucamasini.net/Home/java-enterprise/non-ascii-char-and-http-requests-with-tomcat-weblogic
(also see the WebLogic docs at http://docs.oracle.com/cd/E21764_01/web.1111/e13706/app_xml.htm#r6c1-t2 )


Thanks,
David
German Gonzalez-Morris
Ranch Hand

Joined: Nov 16, 2009
Posts: 157

the parameter itself is null by default.
however default encoding is hardcoded set to ISO-8859-1

http://devwebcl.blogspot.com/
German Gonzalez-Morris
Ranch Hand

Joined: Nov 16, 2009
Posts: 157

as required by JSP/Servlet specification
David Balažic
Ranch Hand

Joined: May 15, 2008
Posts: 86
The encoding of URI/URL parameters is not mentioned in the specs.
German Gonzalez-Morris
Ranch Hand

Joined: Nov 16, 2009
Posts: 157

David Balažic wrote:The encoding of URI/URL parameters is not mentioned in the specs.


are we talking about ServletResponse ?
(perhaps method encodeRedirectURL)

From spec Servlet 2.5 :

If the servlet does not specify a character encoding before the getWriter
method of the ServletResponse interface is called or the response is committed,
the default ISO-8859-1 is used.
David Balažic
Ranch Hand

Joined: May 15, 2008
Posts: 86
No, I'm talking .... http://www.example.com/foo?bar=about_this_here
German Gonzalez-Morris
Ranch Hand

Joined: Nov 16, 2009
Posts: 157

Well, the value for webapp.encoding.default is ISO-8859-1

Could you be more specific how are you generating that URL ?

If it is for a sendRedirect() you need to encode it by yourself:

URLEncoder.encode(e.getType(), "UTF-8")

 
 
subject: Default value for webapp.encoding.default in weblogic-application.xml ?
 
Similar Threads
java (What is application.xml?)
Problem in running apache CXF webservice in weblogic 10 server
java (What is application.xml?)
Load external properties files into EJB 3 app running on WebLogic 11
Weblogic 10.3- EJB3 - Hibernate "The user must supply a JDBC connection" Exception