Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can somebody help me with jsp:invoke?

 
alzamabar
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I looked at the JSP 2.0 specs, I tried to invoke it on my tag files, but still I don't understand how jsp:invoke works. Is there anyone who can explain this to me?

Thanks.
 
Ritu varada
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe this will help

http://java.sun.com/products/jsp/syntax/2.0/syntaxref2021.html#8837
 
alzamabar
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I visited the link but still I couldn't have an example to run.

I wrote the Tag file as follows:



And the JSP file as follows:



I get the following exception:

org.apache.jasper.JasperException: /HelloTag.jsp(11,0) Unable to find setter method for attribute: aFragment
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:150)
org.apache.jasper.compiler.Generator$GenerateVisitor.evaluateAttribute(Generator.java:2677)
org.apache.jasper.compiler.Generator$GenerateVisitor.generateSetters(Generator.java:2825)
org.apache.jasper.compiler.Generator$GenerateVisitor.generateCustomDoTag(Generator.java:2363)
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1663)
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.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.Generator.generate(Generator.java:3272)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:244)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)



I am puzzled
 
Ritu varada
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know much about jsp:invoke and I am taking the exam tomorrow! Anyway, I found this example in the web.See if this makes sense.

http://www.oracle.com/technology/sample_code/tech/java/codesnippet/jsps/customtag/how-to-tagfile.html#jsp
 
Ritu varada
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or this one!
http://today.java.net/pub/a/today/2003/11/25/tagfiles.html
 
Marcos Doria
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to change aFragment to afragment, thats it, will work.


att,

Marcos Turisco.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic