File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes print the request body Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "print the request body" Watch "print the request body" New topic
Author

print the request body

Mike Phillip
Ranch Hand

Joined: Dec 05, 2007
Posts: 37
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

Joined: Jan 10, 2002
Posts: 61594
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
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


Merrill
Consultant, Sima Solutions
Mike Phillip
Ranch Hand

Joined: Dec 05, 2007
Posts: 37
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

Joined: Jan 10, 2002
Posts: 61594
    
  67

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: print the request body