user2444474
user2444474

Reputation: 573

Can able to view httpservletrequest data in browser tools?

Is there any way to see the data getting through HttpServletRequest in browser tools ? like firebug or chrome dev tools ?

httpservletrequest.getServletRequest().getHeader("email");

I'm getting null values , another application guy saying that there is data passing , i'm not getting data. So i would like to see the data in browser, because this http.

I have check System.out.println()... Eventhough is any way ?

Thanks

Upvotes: 0

Views: 2303

Answers (1)

Jason C
Jason C

Reputation: 40336

The HttpServletRequest object is never directly accessible by the client (all of your Java code executes server side).

Either use the solution @Sotirios Delimanolis described in the comments, or add some temporary server-side code to write the relevant information from the HttpServletRequest to the output.

There is no other way to access that object client-side. You will have to rely on information that is already being sent to the client (e.g. looking at headers in Wireshark), or send information to the client explicitly (explicitly format and write to output).

Added: If you don't want to clutter up the page itself with debugging info, you can generate the dump as comments in the HTML, or generate some JavaScript that directly prints messages to the JS console.

Upvotes: 3

Related Questions