• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

print the request body

 
Mike Phillip
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I want to print the content of a HttpServlet, here is what I'm doing with struts:




but it doesnt print anything

can anyone help?

thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know for sure, but a guess would be that by the time the Struts action gets executed, the body has already been read in order to gather the request parameters.

I'd suggest using a raw servlet so that you have complete control.

Moving to the Struts forum for any further discussion.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would help if we knew what you are trying to accomplish by reading the request in this way. If you're trying to upload a file, there's a much easier way to do it:

http://www.roseindia.net/struts/strutsfileupload.shtml
 
Mike Phillip
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Merrill Higginson:
It would help if we knew what you are trying to accomplish by reading the request in this way. If you're trying to upload a file, there's a much easier way to do it:

http://www.roseindia.net/struts/strutsfileupload.shtml


thanks, but it's not that.

I'll try to explain better:
I have this jsp page, and say it has a link to an action, when you click in the link I would like to print in the server console the code of the jsp it belongs to
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JSP that contains the link? Not possible. That request went out of scope when the HTML was delivered to the browser.

It's still not clear what you're trying to do. It doesn't seem very useful.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic