Or if it's because you want to separate your logic, just have your java class with a method that would return what you need then in your jsp, instantiate the class and call the method to get what you need.
Sara. -----Original Message----- From: Paul Spencer [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 12, 2002 11:24 AM To: Jetspeed Users List Subject: Re: Problem with EcsServletElement Stefan, Is their a reason you are not doing the calculation in the JSP? The JSP has access to all of the parameters passed in the HTTP request and portlet parameters. See JSP <jetspeed_home>/WEB-INF/templates/jsp/portlets/html/JSP1_2andJetspeedTagLib. jsp Paul Spencer Stefan Kuhn wrote: > Hi everybody, > I've got a portlet which is a java class. I want that portlet to do some > calculations and to return the result via a JSP. I understood that the > EcsServletElement is the way to do that. So I wrote the following code: > > public ConcreteElement getContent(RunData runData) { > HttpServletRequest req = runData.getRequest(); > String spec = req.getParameter("spectrum"); > //Here the calculations > StringElement base=new StringElement(); > base.addElement(new EcsServletElement(runData,"result.jsp")); > return(base); > } > > I did it the way it's described in the Portlet Howto. It seems jetspeed can't > find the jsp. The log is as follows: > > > [Tue Feb 12 12:13:04 CET 2002] -- ERROR -- EcsServletElement: Could not > include the following URL: result.jsp : null > Exception: java.lang.NullPointerException > Stack Trace follows: > java.lang.NullPointerException > at > org.apache.jetspeed.util.servlet.EcsServletElement.output(EcsServletElement. java:127) > at > org.apache.jetspeed.util.servlet.EcsServletElement.output(EcsServletElement. java:110) > at org.apache.ecs.ConcreteElement.output(ConcreteElement.java:322) > at org.apache.ecs.GenericElement.toString(GenericElement.java:723) > at > org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.jav a) > at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java) > > and so on. > I tried to give the absolute URL (I copied it from my browser where I get a > result), but it isn't working. I understood, that if I give no path the JSP > is looked for in the directory given in the TurbineResources.properties with > > services.JspService.templates =/WEB-INF/templates/jsp > > But it's working in no way. > Help would be much appreciated. Thanks a lot! > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
