Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

param is getting converted to some thing else when i pass special characters getRequestParameterMap

 
Mallika gowd
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is search program...when i search word with special character like tilbehør it is getting converted as tilbehør

xhtml file i have input text...when i pass some text for search..control goes to SearchBB as shown below.getting converted some wierd character for tilbehør ---> tilbehør

Please help me.


Search.xhml:
---------------

<form id="query" method="get">
<input type="text" name="q" id="q" value="#{searchBB.query}" />
<input type="submit" name="submit" id="submit" value="#{msg.txt_common_buttonLabel}" />

SearchBB.java
-------------------

public SearchBB()
{
FacesContext context = FacesContext.getCurrentInstance();
ExternalContext extCtx = context.getExternalContext();

Locale locale = context.getViewRoot().getLocale();
this.locale = locale.getLanguage() + "_" + locale.getCountry();

String sQuery = (String)extCtx.getRequestParameterMap().get( "q" );

try {
if( sQuery != null ) {
query=sQuery;
}
 
Mallika gowd
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any help would be greatly appreciated...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic