Daler
Daler

Reputation: 834

wicket PageParameters encoding

My project is under eclipse, Tomcat, Spring, Hibernate. In my web app when I try go to enother webPage :

public void onSubmit()
        {                                   
            String value="Д";
            PageParameters pars=new PageParameters();
            pars.add("strname", value);
            setResponsePage(FilterClient.class, pars);
        }

and after geting that parameter :

public FilterClient(final PageParameters parameters) {
        String strName="";
        if(parameters.containsKey("strname")){
            strName=parameters.getString("strname");
        }

the value of parameter is

Д instead of Д

Please help me to solve this issue.

Upvotes: 0

Views: 1539

Answers (2)

leonidv
leonidv

Reputation: 1412

You should try to set URIEncoding in Tomcat server.xml configuration file.

http://wiki.apache.org/tomcat/FAQ/CharacterEncoding

Best practice is use only UTF-8 encoding in your application (in database and web-pages).

Upvotes: 5

Martin
Martin

Reputation: 425

what encoding do you use?

You should try using UTF-8.

Try writing following in your templates at the top:

<?xml version="1.0" encoding="UTF-8" ?>

Wicket determines per default the output encoding based on that.

There is a little information about it in the javadoc:

http://wicket.apache.org/docs/1.4/org/apache/wicket/Page.html#configureResponse%28%29

Upvotes: 2

Related Questions