I am getting the expected result from the server, namely a 200 status code, the mime type is application/json and the content is as expected. However, "test" isn't printing in the console. What gives?
I don't think you understand my question. More than "true" needs to be returned in a properly formatted JSON response from the server. Otherwise, $.getJSON can't parse it which can result in the behavior you are seeing. If you can show us your complete (scrubbed if need be) response from the server, we can help you determine if it is formatted properly.
I have no idea what the Gson API is. And as far as your problem goes, I don't think we care. Please show us the JSON that gets sent to the browser, not the code generating the JSON. If you are using Firefox, you should really be using Firebug. Otherwise, just log it in your servlet and copy and paste the results here.
The getBytes was from an example I found that another developer had used. So if there is nothing wrong with the JSON, why am I getting "Uncaught SyntaxError: Unexpected token :" ? All my googling reveals is some stuff peculiar to JSONP responses from facebook and google.