I used Stripes with JSP and action bean first approach, (all JSPs were under
/WEB-INF/jsp/)
I used action beans like:
@UrlBinding(some-url.xhtml)
public class HomeActionBean extends BaseActionBean {
@DefaultHandler
@DontValidate
public Resolution display() {
return new
As an alternative, you could create a servlet filter that maps to the
pattern *.tfl and throws an exception or forwards to an access denied
page and/or sets the appropriate HTTP error code.
Chris.
On Oct 21, 2008, at 1:11 PM, Marcus wrote:
I used Stripes with JSP and action bean first
Or you could subclass FreemarkerServlet and test wether the response has
been forwarded or not. The code inside doGet/doPost would look something
like
if (request.getAttribute(javax.servlet.forward.servlet_path) == null)) {
response.sendError(HttpServletResponse.SC_NOT_FOUND);
} else {
If preventing direct access to the templates by putting them under /WEB-INF,
just like you were doing with JSPs, is enough for you, that should work.
In other words, I've switched from JSPs to FTL in the way that you describe
and it worked; I did not get 404 errors. Note that you still need the
I also expected this to work... But as it was not I become to think that it
shouldn't.
I guess something wrong with web.xml I tried several variants of web.xml here
is my current file (note that Dynamic Mapping Filter)
File location is /WEB-INF/templates/frontend/index.ftl
this one works (but
Here's what we have
servlet
servlet-nameFreemarker/servlet-name
servlet-classcom.upmc.cancercenters.pathways.web.FreemarkerServlet/servlet-class
init-param
param-nameTemplatePath/param-name
param-value//param-value
Thank you guys,
After changing TemplatePath to / it works nice.
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK win great prizes