Dandelion and Shiro context null. NullPointerException

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Dandelion and Shiro context null. NullPointerException

abrahamarellanotavara
Hi,

I'm having a serious problem with the migration from 0.9.3 version to 1.1.0.

My application is using Shiro for security and the problem is that the between the "DandelionFilter" to the call of "DandelionServlet" the "HttpRequestRequest" object changes and the context is lost.

The problem that in the following line of the "DandelionFilter" we set an attribute to the request:
- request.setAttribute(WebConstants.DANDELION_CONTEXT_ATTRIBUTE, context);

But the request is intercepted and changed. Causing the problem in the "DandelionServlet":
- Context context = (Context) request.getAttribute(WebConstants.DANDELION_CONTEXT_ATTRIBUTE); ------> The "context" is NULL.

After several hours I cannot avoid the lost of the "HttpRequestRequest" and I need your support to solve this issue.

The problem looks similar to: http://dandelion-forum.48353.x6.nabble.com/Configuring-DandelionFilter-on-anything-other-than-cause-NullPointerException-td1786.html   --- however I'm not making it work with any path.

Thanks for your support!
Reply | Threaded
Open this post in threaded view
|

Re: Dandelion and Shiro context null. NullPointerException

MaggiWuerze
did you (or anyone else) find a solution to this?
Reply | Threaded
Open this post in threaded view
|

Re: Dandelion and Shiro context null. NullPointerException

elmehdi
Hi,

I overrid it and I change the source classe like :

if (request.getAttribute(DatatableComponent.DDL_DT_REQUESTATTR_TABLES) == null || BigDecimal.ZERO.equals(request.getAttribute(DatatableComponent.DDL_DT_REQUESTATTR_TABLES))) {
            List<HtmlTable> htmlTables = new ArrayList<HtmlTable>();
            htmlTables.add(table);
            request.setAttribute(DatatableComponent.DDL_DT_REQUESTATTR_TABLES, htmlTables);
         }
         else {
            List<HtmlTable> htmlTables = (List<HtmlTable>) request
                  .getAttribute(DatatableComponent.DDL_DT_REQUESTATTR_TABLES);
            htmlTables.add(table);
         }