cancel
Showing results for 
Search instead for 
Did you mean: 

create a new index.jsp with new function

terry
Champ in-the-making
Champ in-the-making
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 ?
3 REPLIES 3

snelson
Champ in-the-making
Champ in-the-making
The Util.java file needs to be compiled and added to the sample JAR file. You then need to start and stop the virtualization server. This should get things working for you.

terry
Champ in-the-making
Champ in-the-making
The Util.java file needs to be compiled and added to the sample JAR file. You then need to start and stop the virtualization server. This should get things working for you.
Hi,
I compiled the Util.java ,and added to the ROOT\WEB-INF\lib\alfresco-sample-website.jar,and restarted the tomcat ,but the Browser throw :
org.apache.jasper.JasperException: Method "getNews" for function "getNews" not found in class "org.alfresco.web.pr.Util".

snelson
Champ in-the-making
Champ in-the-making
Hi Terry,

Did you restart the virtualization server and not the main alfresco server?