Win a copy of Learn Java with Math: Using Fun Projects and Games this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Websphere Commerce : from Java filter to Struts action mapping

 
Greenhorn
Posts: 6
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

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)

Here is the full stacktrace :



Can anyone help ?

Thanks alot,

Nils
 
Nils Quairiat
Greenhorn
Posts: 6
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem solved ! The solution was to put the custom filter AFTER all the WebsphereCommerce-related filters in web.xml
 
I've got no option but to sell you all for scientific experiments. Or a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!