• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Retreiving AJAX xml from request in Servlet

 
Tom Katz
Ranch Hand
Posts: 169
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can do the above in a servlet when I call



Which all works fine.

What I want to do is save off the request information for after I redirect to a login page, so I can retreive the request (and it's xml stream) after a successful login.

For a non-ajax request I was simply saving off the necessary URL +



So, basically, I need to do the same thing with the xml being sent in. Not quite sure how to at this point...

thanks,
Tom
 
Tom Katz
Ranch Hand
Posts: 169
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would saving off the inputStream of the request (to a Session variable) a safe way to handle this? Or even the best way?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64196
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't have much of an idea of what you are trying to accomplish, but from the point of view of the server an Ajax request and a "normal" request are identical. What's the issue?
[ January 11, 2008: Message edited by: Bear Bibeault ]
 
Tom Katz
Ranch Hand
Posts: 169
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will try to clarify.

I'm receiving request in my servlet. It was sent as an AJAX-type request and contains an xml stream.

There's a security issue that requires redirecting the user to the login page.

After a successful login, I want to have access to that xml stream, and process it in the original servlet the request was made to.

Part of the issue is that it becomes another request (I believe) at the login page, so I no longer can just call



I may be looking at this the wrong way (from how lost I am, it's entirely possible) but I was thinking I could save off the request's xml inputStream as a session object, for retrieval later.

What I'm realizing as I'm typing is that, I can process the stream as I need to before taking the action that requires the eventual redirection, and already have the information that I'll need afterwards( I think ). Hope this works, saving off an inputStream didn't sound like a good idea at all!

sorry if I needlessly took up anyone's time! thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64196
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right, you cannot save the request or the stream for another request later. The request and its resources are only valid for that single request.

Grabbing the data in the request biody and tucking it away for later is perfectly legitimate.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic