• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

print the request body

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You save more money with a clothesline than dozens of light bulb purchases. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic