AnsweredAssumed Answered

create a new index.jsp with new function

Question asked by terry on Nov 2, 2006
Latest reply on Nov 3, 2006 by snelson
I'm want create a new index.jsp to show some documents of mine , and I added some codes in Root/WEB-INF/classes/org/alfresco/web/pr/Util.java, this codes like :
public static List<PressReleaseBean> getNews(final PageContext pageContext)
     throws Exception
    {………………..}


And I add this codes in pr.tld:
<function>
      <name>getNews</name>
      <function-class>org.alfresco.web.pr.Util</function-class>
      <function-signature>java.util.List getNews(javax.servlet.jsp.PageContext)</function-signature>
    </function>
But when I preview the index.jsp, the Browser throw :
org.apache.jasper.JasperException: Method "getNews" for function "getNews" not found in class "org.alfresco.web.pr.Util"
   org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:50)
   org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
   org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:179)
   org.apache.jasper.compiler.Validator$1MapperELVisitor.visit(Validator.java:1384)
   org.apache.jasper.compiler.ELNode$Function.accept(ELNode.java:122)
   org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:193)
   org.apache.jasper.compiler.ELNode$Visitor.visit(ELNode.java:234)
   org.apache.jasper.compiler.ELNode$Root.accept(ELNode.java:53)
   org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:193)
   org.apache.jasper.compiler.Validator$ValidateVisitor.getFunctionMapper(Validator.java:1394)
   org.apache.jasper.compiler.Validator$ValidateVisitor.getJspAttribute(Validator.java:1112)
   org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:937)
   org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:710)
   org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
   org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
   org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
   org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:640)
   org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1185)
   org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
   org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
   org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:640)
   org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1185)
   org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
   org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
   org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:640)
   org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1185)
   org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
   org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
   org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:640)
   org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1185)
   org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
   org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
   org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:640)
   org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1185)
   org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
   org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
   org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:640)
   org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1185)
   org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
   org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
   org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:640)
   org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1185)
   org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
   org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
   org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:640)
   org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1185)
   org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
   org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
   org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:640)
   org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1185)
   org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
   org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
   org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:640)
   org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1185)
   org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
   org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
   org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:640)
   org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1185)
   org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
   org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
   org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:640)
   org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1185)
   org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
   org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
   org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:409)
   org.apache.jasper.compiler.Node$JspRoot.accept(Node.java:525)
   org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
   org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
   org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
   org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
   org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
   org.apache.jasper.compiler.Validator.validate(Validator.java:1489)
   org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:157)
   org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
   org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
   org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
   org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
   org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
   org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


why? I want know where the class of the Root/WEB-INF/classes/org/alfresco/web/pr/Util.java, add how to work ?

Outcomes