Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
David Balažic
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 265
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the parameter itself is null by default.
however default encoding is hardcoded set to ISO-8859-1
 
German Gonzalez-Morris
Ranch Hand
Posts: 265
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
as required by JSP/Servlet specification
 
David Balažic
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The encoding of URI/URL parameters is not mentioned in the specs.
 
German Gonzalez-Morris
Ranch Hand
Posts: 265
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, I'm talking .... http://www.example.com/foo?bar=about_this_here
 
German Gonzalez-Morris
Ranch Hand
Posts: 265
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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")

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic