views:

394

answers:

1

I know this might sound crazy...but i am integrating with some third party api's and unfortunately they have a utility class which only takes a pageContext object..I did some peeking around and found that they are doing a lot of stuff with pageContext... Is there a way to get to or create a pageContext from HttpServeletRequest.

+1  A: 

You could use MockPageContext from the Spring API. It's designed for testing, but it would do a fine job of fooling the app into thinking it was the real thing.

skaffman
Thanks for the answer...but Unfortunaley that solution ...I don't want to fool my app....
Fooling your app is exactly what you're trying to do. You don't have a PageContext, and you want to simulate one. MockPageContext is a perfectly valid implementation of PageContext, you're going to have to use something like it anyway. Might as well use one that's already written.
skaffman
well the point that you are making is correct...but i am still not sure...will fool around with some workarounds a bit..