Hi All,
Here is what I am trying to accomplish:
1) Use DynamicMappingFilter
2) Keep all JSP's under WEB-INF
3) Take advantage of the DefaultViewActionBean so that I can stay true to the
pre-action pattern and avoid directly accessing JSPs while not having to create
an action bean just to forward to the JSP
4) Allow my default document (ex: index.jsp) to use the DefaultViewActionBean
and resolve to index.jsp under WEB-INF
I am using a couple of concepts from the Stripes book. The first, on page
288...overriding a method in NameBasedActionResolver to make it check the
WEB-INF directory for a jsp matching the request. Here is the code:
public class MyActionResolver extends NameBasedActionResolver {
@Override
protected List<String> getFindViewAttempts(String url) {
List<String> defaultViews =
super.getFindViewAttempts(url);
List<String> customViews =
new ArrayList<String>(defaultViews.size());
for (String view : defaultViews) {
customViews.add("/WEB-INF/jsp" + view);
}
return customViews;
}
}
I put this in my extensions directory and when the server starts up, it is being
loaded. I tried this with the typical stripes config (no dynamicmappingfilter)
and this works as advertised. However, when I replace the standard config and
use DynamicMappingFilter, it seems that the actionresolver is no longer being
called. From the documentation on DMF, it seems that it should be. It says the
DMF follows this process:
" This filter takes the following approach to determining when to dispatch an
ActionBean:
1. Allow the request to process normally, trapping any HTTP errors that are
returned.
2. If no error was returned then do nothing, allowing the request to complete
successfully. If any error other than 404 was returned then send the error
through. Otherwise ...
3. Check the ActionResolver to see if an ActionBean is mapped to the URL. If
not, then send the 404 error through. Otherwise...
4. Invoke StripesFilter and DispatcherServlet
"
At step 3, it should use my actionresolver to check to see if it can find an
actionbean (in this case, the DefaultViewActionBean). However, when debugging,
it never seems to be accessed.
If anyone can provide some insight on this, I'd be grateful.
Thanks in advance!
J
-------------------------------------------------------------------------
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
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users