java - Why am I receiving a `Request must not be null` exception when calling getSessionAttribute()? -
why receiving following error code?
error 500: request processing failed; nested exception java.lang.illegalargumentexception: request must not null
code snippet
protected void buildpdfdocument(map modelo, document document, pdfwriter pdfwriter, httpservletrequest request, httpservletresponse response) throws ioexception { // problem here pass httpservletrequest actionrequest or portletrequest actionrequest arequest = (actionrequest) request.getattribute("javax.portlet.request"); // need validate user's session cliente cliente = (cliente) portletutils.getsessionattribute(arequest, atokconstante.cliente_sesion,portletsession.application_scope); }
without stack trace on exception, suspect variable arequest null. means attribute "javax.portlet.request" has not been set in httpservletrequest request object. passing null arequest portletutils.getsessionattribute(), throwing exception.
without other code go on, can recommend investigate lifecycle of request prior buildpdfdocument() method , ensure either expected value saved @ key javax.portlet.request, or using correct key string in first place.
Comments
Post a Comment