Ticket #273 (new defect)

Opened 1 month ago

Form submitError in Opera

Reported by: sdm Assigned to: mpo
Priority: minor Milestone: 0.4
Component: -- unknown -- Version: trunk
Keywords: Cc:

Description

I tested with Opera 10.0.

When you submit a form in Opera, and the POST is handled by a JAX RS resource, a "204 No Content" is returned, which causes Opera to call the Javascript method myForm.submitError instead of myForm.submitSuccess. This way it looks like some error occured, while everything actually went ok, but Opera is misinterpreting the result.

I tried to handle the form submit with the following JAX RS methods:

1) returning void causes "204 No Content" => submitError

@POST
@Consumes("application/json")
public void saveGebruiker(byte[] bytes) throws Exception
{
}

2) returning null causes "204 No Content", => submitError

@POST
@Consumes("application/json")
public String saveGebruiker(byte[] bytes) throws Exception
{
    return null;
}

3) returning an empty string causes "200 OK", => submitSuccess

@POST
@Consumes("application/json")
public String saveGebruiker(byte[] bytes) throws Exception
{
    return "";
}

4) returning a teststring causes "200 OK", but Opera still executes the submitError, with the value of request.responseText being the teststring.

@POST
@Consumes("application/json")
public String saveGebruiker(byte[] bytes) throws Exception
{
    return "blabla";
}