This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Accessing input/reader in forwarded servlet

 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looking in servlet spec and do not see an answer. What's is right behavior of container in the following situation:
1. servlet invoked by client and processes a multipart request
2. servlet decides to forward request to another servlet
3. another servlet is capable process muktipart requests as well, so my questions are:
- what is a request method of a forwarded servlet? (An original or PUT?)
- what happens if a forwarded servlet acceesses request input/reader? (Illegal state or EOS?)

I know that a servlet can manage if it called by due forward, but I need answers to provide right container behaivor when serlet doesn't take care of that.

PS it's for 2.4/2.5.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13045
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is a request method of a forwarded servlet? (An original or PUT?)
- what happens if a forwarded servlet acceesses request input/reader? (Illegal state or EOS?)


1. The request object retains the original method.
2. If the initial servlet read the input stream, the second servlet can not back it up or regenerate it but has to work with the input stream in the condition left by the first. If the first servlet created any objects from the multiparts, they could be attached to the forwarded request.

Bill
 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.

BTW what is relaible way to figure out that servlet forwarded? Check request attribute "javax.servlet.forward.request_uri" ?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic