I'm working on a project using Websphere Commerce v7.0 and I'm currently blocked on the following issue.
We use a CMS to store url's in a database. Some data is stored in regards to each of those url's. When the user enters an URL in the browser, we want to check if that url is stored in our database, and if it is the case, add some data to the request, and then forward to a particular view which is mapped in struts-config-ext.xml. If nothing is found in database, just do nothing (let websphere commerce handle the request as usual, instead of using a specific Struts mapping)
Unfortunately, I cannot reach the specific struts entry programmatically (due to a Java error). Here is what I did. I can add more code if necessary.
- I added a java filter in web.xml (the very first filter, mapped on "/*" )
- I implemented the filter, which uses access beans to make checks on the database, and adds attributes to the request if something is found. No problem until now
- I tried a few ways to dispatch the request to the right Struts entry, notably :
But this leads to a NullPointerException.
If we try to access the specific Struts entry by typing it in the URL, then it works (but that's not the goal)