T
Thomas Hoheneder
Hello,
I have written a class that should calculate the n-th power of a given
number, e. g. number=2, power=3 => result=8.
I work with Eclipse 3.0, Tomcat 5.0.28, JDK 1.4.2, J2EE SDK 1.3.1 and I use
a JSP custom tag to display my calculation result.
My scenario consists of four files:
PowerTag.java (the functionality I use as described above)
powertagdemo.jsp (jsp demo page for my Java functionality)
web.xml (deployment descriptor)
mytld.tld (tag library descriptor)
The full code of these files I have summarized in the file
http://www.thomas-hoheneder.de/temp/java/customtag.txt
for better understanding.
My written class implements javax.servlet.jsp.tagext.IterationTag. There's
also a method named doAfterBody() to be implemented and as far as my book
says this function can is invoked iteratively at run time, depending on the
return value defined. With return value EVAL_BODY_AGAIN doAfterBody() is
invoked one more time and with return value SKIP_BODY it is not invoked any
more. This principle I use to calculate the n-th power of my given number.
The problem now is, that the doAfterBody() NEVER gets invoked which is very
surprising to me. My debug output into the Java console evidences this
theory. My JSP always shows 2^3=1 which means that for the result the
initial value of my result variable is token.
What's wrong here? Why does the doAfterBody() method NEVER get invoked
instead of being invoked iteratively?
Any help to this would be very appreciated. Thanks in advance.
Nice greetings from
Thomas
I have written a class that should calculate the n-th power of a given
number, e. g. number=2, power=3 => result=8.
I work with Eclipse 3.0, Tomcat 5.0.28, JDK 1.4.2, J2EE SDK 1.3.1 and I use
a JSP custom tag to display my calculation result.
My scenario consists of four files:
PowerTag.java (the functionality I use as described above)
powertagdemo.jsp (jsp demo page for my Java functionality)
web.xml (deployment descriptor)
mytld.tld (tag library descriptor)
The full code of these files I have summarized in the file
http://www.thomas-hoheneder.de/temp/java/customtag.txt
for better understanding.
My written class implements javax.servlet.jsp.tagext.IterationTag. There's
also a method named doAfterBody() to be implemented and as far as my book
says this function can is invoked iteratively at run time, depending on the
return value defined. With return value EVAL_BODY_AGAIN doAfterBody() is
invoked one more time and with return value SKIP_BODY it is not invoked any
more. This principle I use to calculate the n-th power of my given number.
The problem now is, that the doAfterBody() NEVER gets invoked which is very
surprising to me. My debug output into the Java console evidences this
theory. My JSP always shows 2^3=1 which means that for the result the
initial value of my result variable is token.
What's wrong here? Why does the doAfterBody() method NEVER get invoked
instead of being invoked iteratively?
Any help to this would be very appreciated. Thanks in advance.
Nice greetings from
Thomas