In BrightSpotCMS HOWTO inspect the “request” object from HttpServlet before the JSP is rendered for a “Content” object

StackOverflow https://stackoverflow.com//questions/22027000

In many MVC frameworks when a request is made it goes to a controller/action class (based on the URL pattern among other things). If the developer wants to do something with the request object or other processes then it does that with in the execute or doGet or doPost etc methods & then forwards it to the dispatcher. The response type could be a JSON, JSP, XML etc.

I have a brightspot cms webapp in which I want to do something similar. It is based on the open source project dari framework.

In case of a object of type Content if I want to setup some pre-processing of variables to be used in the JSP page based on the request object, how can I do it? I am unable to find the point of intervention between the request going to conten type object AND request being forwarded to the backing JSP page.

I know I can just add scriptlets to the JSP page, but I had rather not do it for variety of reasons.

有帮助吗?

解决方案

I was able to resolve this by adding a Filter for the URL pattern I was interested in. More info here.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top