Coding in Eclipse EE

Asked

Viewed 768 times

1

I have the following problem: I have a web service in Java using Jetty, the same works normally if I request other applications to the server, but my unit tests are returning the encoding all wrong.

{"message":"Não foi possível criar o usuário. Error: E-mail já cadastrado.","status":"error"}

I am using the Eclipse IDE, and I have tried to modify in several places, but none works:

I tried to

File > Properties > Resource > Text File Encoding;

Window > Preferences > General > Workspace > Text File Encoding

Botão direito no projeto > Preferences > Text File Encoding

My method of making the requisition is like this:

public static void executeMethod() throws IOException, HttpException {
        PostMethod post = createRequestPost(params, SIGNUP_ROTE);
        int status = HttpClient().executeMethod(aMethod);;
        String resultado = post.getResponseBodyAsString();
    }

Could someone help me?

  • You know which encoding is being used in the return text of your Webservice?

1 answer

1

You can right click on your project and go to Properties.

On the tab Resource has the group box "Text file encoding".

You can change to there to use special characters.

Editing: allows you to use even special characters. Type and things like.

The allows you to use accents and cedilla. ;)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.