I'm working on my first STRUTS project. I have done some MVC web apps before. Typically I would have my controller servlet put a boolean on the request before forwarding it to my JSPs. My JSPs would check for that boolean to be there. If it wasn't there, the JSP would know that the user pointed their browser at the JSP instead of being forwarded to the JSP by the controller. In that case I would just forward them back to some "safe" place.
I'd like to do the same thing in struts, but the only way I can think to do it is to extend strut's action servlet. However, from what I have read, this is a bad idea. Is there another alternative that I am missing?
posted 10 years ago
Yes, put your JSP files somewhere under your WEB-INF directory. Then the users have no access to them and you don't have any extra work.