tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Sidney-Woollett" <joh...@wardbrook.com>
Subject Re: How to stop the URL comming up?
Date Thu, 27 Nov 2003 14:58:10 GMT
Try creating a servlet which maps to a "bookmark-able" URL. Then have the
servlet use the RequestDispatcher to forward the request which will
generate the page (a JSP usually). The forwarded page is generated in the
same request, and the URL won't change.

Using this technique you can have the servlet called one of many JSP pages
to render different pages according to session info, request paremeters or
cookie information.

eg

//create the request dispatcher (for the new URL)
RequestDispatcher rqdD =
request.getRequestDispatcher(response.encodeURL(inclPage));

//and forward the request
rqdD.forward(request, response);

The beauty of this technique is that your servlet can handle all business
logic, generate beans etc, and place them into the request (attributes),
and the jsp page(s) only need concern themselves with presentation.

Hope this helps.

John Sidney-Woollett


Andoni said:
> Hello,
>
> I am looking for a way to stop my users bookmarking pages in the site.
> There is a login screen and they shouldn't even really be let bookmark
> this.  I was given someone's card today an then I went to his site:
> http://www.xeotrope.net and when I find that as I look around the site the
> url in the URL bar of my browser stays at http://www.xeotrope.net and
> never includes the page name.  This means that all bookmarks only bring up
> the main page.
>
> Is there any way to do this with apache / Tocmat?
>
> Thanks.
>
> Andoni.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message