• 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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
 
get schwifty. tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic