Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJWCD
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Web Component Certification (OCEJWCD)
Can somebody help me with jsp:invoke?
alzamabar
Ranch Hand
Posts: 379
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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.
Marco Tedone<br />SCJP1.4,SCJP5,SCBCD,SCWCD
Ritu varada
Ranch Hand
Posts: 119
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Maybe this will help
http://java.sun.com/products/jsp/syntax/2.0/syntaxref2021.html#8837
SCJP,SCWCD(1.4)
alzamabar
Ranch Hand
Posts: 379
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I visited the link but still I couldn't have an example to run.
I wrote the Tag file as follows:
<%@ attribute name="name" required="false" rtexprvalue="true" %> <%@ attribute name="aFragment" fragment="true" %> <div align="center"> <h1>Hello ${name}</h1><br> <jsp:invoke fragment="aFragment" /> </p> </div>
And the JSP file as follows:
<%@ taglib prefix="myTags" tagdir="/WEB-INF/tags" %> <%-- <myTags:Hello name="Marco Tedone"> Once upon a time there was a prince named Percival.<br> </br>His aim was to save the princess Eleonore from the hands of the monster. </myTags:Hello> --%> <myTags:Hello> <jsp:attribute name="aFragment"> <b>This is a fragment</b> </jsp:attribute> </myTags:Hello>
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
Marco Tedone<br />SCJP1.4,SCJP5,SCBCD,SCWCD
Ritu varada
Ranch Hand
Posts: 119
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
SCJP,SCWCD(1.4)
Ritu varada
Ranch Hand
Posts: 119
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Or this one!
http://today.java.net/pub/a/today/2003/11/25/tagfiles.html
SCJP,SCWCD(1.4)
Marcos Doria
Greenhorn
Posts: 1
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Try to change aFragment to afragment, thats it, will work.
att,
Marcos Turisco.
I found a beautiful pie. And a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
jsp:doBody V/S jsp:invoke
difference between jsp:doBody and jsp:invoke actions
jsp:invoke
regarding jsp:invoke
Custom tags and standard actions
More...