Tuesday, November 29, 2011

Submitting form and getting annoying "<pre>" tags in the response


I'm using GWT 2.4. I have a form in which I create a submit button
like so

private Button createSaveButton() {
final Button saveButton = new Button("Save");
saveButton.addClickHandler(new ClickHandler() {

public void onClick(ClickEvent event) {
return saveButton;
} // createSaveButton

I define an onComplete handler for the form like so

formPanel.addSubmitCompleteHandler(new SubmitCompleteHandler() {

public void onSubmitComplete(SubmitCompleteEvent event) {

The servlet I submit the form to returns results as plain text.

final PrintWriter out = res.getWriter();

However, when I actually do the alert, it will attach "<pre>" tags to
the output. For example, if the servlet outputs "true", what is
alerted to the user is "<pre>true</pre>". How do I get this only to
output what was written to the response? I could do some string
manipulation to remove the "<pre>" tags, but that seems like I'm not
addressing the core issue.

Thanks, - Dave

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment