You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Matthew Wood <mw...@chello.com> on 2001/05/04 18:58:04 UTC
velocity & servlet redirection
i'm still finding my feet with velocity and servlets, so apols if i've got
this all wrong:
i'm looking to implement a webapp which requires user login - certain pages
can only be reached after you've logged in.
i was looking to implement something like this:
public class LoginRequired extends VelocityServlet {
...
public Template handleRequest (Context ctx) {
...
if (loggedIn() == false) {
RequestDispatcher d =
getServletContext().getRequestDispatcher("/app/servlet/Login");
try {
d.forward(res, req);
....
It doesn't work, and I feel like I'm trying to cross the streams here.
If there's a 'proper' way to do this kind of thing with velocity, I'd be
grateful for a clue.