• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Websphere Commerce : from Java filter to Struts action mapping

 
Greenhorn
Posts: 6
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Problem solved ! The solution was to put the custom filter AFTER all the WebsphereCommerce-related filters in web.xml
 
get schwifty. tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic