开发者

Unable to see server response under MOzilla Firebug Console Tab

I am trying to use Mozilla Firebug for checking the response form the server side

I have written a sample program as shown

public class Test extends HttpServlet {

    public void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {

        response.setContentType("text/html");
开发者_如何学Python
        PrintWriter io = response.getWriter();
        io.println("Hi Rai");

    }

}

The response is coming in the browser , but there isn't any response inside the console tab of the Firebug

Please see the screenshot of the response under Browser and Mozilla Firebug console tab

http://imageshack.us/f/716/seea.jpg/ Please help me if i am doing anything wrong .


Short answer:

Enable scripts debugging.
Switch to Console in Firebug and click Profier button to enable profiler.
Reload the page.
Click the profiler button again to see the loaded data. 

That would work with a well-formed xml document, loaded into browser.

In your case:

As we can see from the code, you only generate text, not a well-formed html.

Console tab in Firebug is for displaying a consolidated firebug data. You should switch to HTML tab in firebug to see your HTML markup, since your page is just a string of text. For console to work you also need to enable java script debugging in firebug, which you also don't have on your page.

The main problem with this example is that you are returning a plain text string from a server. Firebug is capable and intended for the debugging of structured XML data, not strings of text.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜