Felipe Schnack wrote:
Sorry, context-parameter? But then I wouldn't have (again) my
servlet's URL written in two different places? This kind of thing
worries me, because somebody can change in one place but not on another.
You're right, this kind of data redundancy can be dangerous, and there
are probably better ways to do it. I was just giving you two
suggestions on where you could store the URL so that it is accessible to
other objects in your webapp.
I think I can understand the HttpServletRequest way of doing it... but
then I could only determine after my servlet is first called, right?
Right, this won't work if you're trying to get the URL from an unrelated
class, like a bean or something, unless you have some way of passing the
request in.
Anyway, how I would do that? Getting all bytes from the string from
the beginning 'till the end or '?' character?
public void doProcessing(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
String url = request.getRequestURL();
}
Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]