I want to get the URL of a servlet (XMLServletBuilder), which my login servlet (LoginServlet) has redirected to. The new page which the login page has redirected to is a servlet, which build a XML document.
You could have the login page print the URL in the servlet log before redirecting.
But more seriously, who is this "I" that needs that? I assume that you personally don't need to find out, but there is some piece of code somewhere that may need to know it. How is this piece of code related to the login page, or to the page it redirects to? Is it running in the same servlet container, or is it somewhere else?
posted 14 years ago
I want to allow the customers to access the invoice data in a big "shop" order system through XML files. I need to do some user authentification, where all login informations is stored in the database.
Then I could choose to 1) Make a login servlet which redirect to the XML page - the XML document where they can parse the data, or 2) Do the user authentification in each XML page by calling a java class.
I think that to print the redirect URL in a log file is a bad solution!
I didn�t thought it was a problem to get the URL from the page being redirected to?! I just hoped you could do something like:
Okay, let me try again. You have a login servlet (good idea) -- let's call it L -- and then you forward or redirect to a servlet that's going to do something with an XML document -- let's call it X. And X needs to know its own URL. Yes? But why does it need to know that? (If you redirect to X, then you can get X's URL from the request via its getRequestURL() method.)
Actually I am still confused. Your original post seems to say that X is going to pass itself to an XML parser. But that doesn't make sense to me either. It is going to pass some XML document to the parser, no?
posted 14 years ago
You have a login servlet (good idea) -- let's call it L -- and then you forward or redirect to a servlet that's going to do something with an XML document -- let's call it X. And X needs to know its own URL. Yes? But why does it need to know that?
No not correct! :-) X is the a servlet which build the XML document on the fly. The customer and other applications use a SAXParser file -- lets call this P -- to parse X. Before I can parse (with P) the XML document created by X, we need the URL of X, but we don�t request X, but instead the login servlet L, which redirect to X.