You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Brad Rhoads <br...@zethcon.com> on 2002/07/22 20:25:54 UTC

session var missing in .jsp

All but one of my .jsps are views and go though my template. They're all
mapped to <screenname>.screen. I have code (shown below) at the top my
template to check a session var to see if the user has logged on. That works
fine.

But now I have a .jsp that's just for displaying an (crystal clear report
viewer) applet. And the .jsp has call back functions used by the applet, so
I can't use the template. I put this code at the top of my rptloader.jsp,
but I get a NPE in this case.


<%
try
{
        if (session != null){
            com.monolith.model.administration.User user =

(com.monolith.model.administration.User)session.getAttribute(
                        com.monolith.webapp.Constants.USER_KEY);
            if (user == null)
                response.sendRedirect("/WebSynapse/signon.screen?prob=no");
        }
        else
            response.sendRedirect("/WebSynapse/signon.screen?prob=yes");
}
catch(NullPointerException npe)
{
    response.sendRedirect("/WebSynapse/signon.screen?prob=npe");
}

%>

I have a selectreport.screen that ends up at my ReportViewAction where I
figure out what kind of report was requested. Then to actually execute the
report I do:

if (usePDF == true)
            return (new ActionForward("/report.pdf", false));
        else if (useHTM == true)
              return (new ActionForward("/report.htmr", false));
        else

//response.sendRedirect("/rptloader.jsp?report=/reports/"+reportType.trim()+
".rpt&dll=pdsora7.dll");
            return (new
ActionForward("/rptloader.jsp?report=/reports/"+reportType.trim()+".rpt&dll=
pdsora7.dll", true));
            //return (new
ActionForward("/rptloader.screen?report=/reports/"+reportType.trim()+".rpt&d
ll=pdsora7.dll", false));


It's the default case I'm talking about (the other's will eventually go
away). I've tried several different options for kicking off rptloader.jsp.

It seams that when I go directly to rptloader.jsp, my session var is
missing. What am I doing wrong?




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>