You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Michael Kucera <mk...@bbm.ca> on 2004/04/16 22:47:51 UTC

restricting access to velocity templates

Hello List,

I'm using Struts in combination with VelocityLayoutServlet in my app. So
far its been working really well but now there's something I can't
figure out.

Users access the app through struts actions, the actions in turn
populate the context and then forward to velocity templates (push
architecture). The problem is that the velocity templates are accessible
directly through the browser. Right now if you type something like
www.myapp.ca/templates/welcome.vm into the browser the template is
rendered for the user but the required data is missing and it looks like
a mess. How do I selectively restrict access just to the templates
without interfering with the way struts works? Am I missing something
simple? Am I totally way off? Any help would be appreciated. Thanks.




Michael Kucera
Programmer/Analyst
BBM Canada
mkucera@bbm.ca

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


Re: restricting access to velocity templates

Posted by Mike Kienenberger <mk...@alaska.net>.
Michael Kucera <mk...@bbm.ca> wrote:
> Right now if you type something like
> www.myapp.ca/templates/welcome.vm into the browser the template is
> rendered for the user but the required data is missing and it looks like
> a mess. How do I selectively restrict access just to the templates
> without interfering with the way struts works? Am I missing something
> simple? Am I totally way off? Any help would be appreciated. Thanks.

Move your templates (and anything else you don't want visible via direct 
access) inside WEB-INF.

-Mike

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