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

SkipPageException problm

 
Sree Nivas
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying HF P:513 book example. This is my code:
JSP-->
<%@ taglib prefix="myTags" uri="simpleTags" %>
<html><body>
About to invoke a tag that throws SkipPageException <br>
<myTags:simple6/>
<br>Back in the page after invoking the tag.
</body></html>

The tag handler doTag() method

package foo;
import javax.servlet.jsp.tagext.SimpleTagSupport;
import javax.servlet.jsp.*;
import java.io.*;
import java.util.*;
public class SimpleTagTest6 extends SimpleTagSupport {

public void doTag() throws JspException,IOException {
boolean thingsDontWork=true;
getJspContext().getOut().print("Message from within doTag().<br>");
getJspContext().getOut().print("About to throw a SkipPageException");
if (thingsDontWork) {
throw new SkipPageException(); }

}
}

I have correct entries in web.xml and am using jakarta-tomcat-5.0.12. But as mentioned in the book it's not working. It's printing message after throwing the SkipPageException. My output looks like this:

About to invoke a tag that throws SkipPageException
Message from within doTag().
About to throw a SkipPageException
Back in the page after invoking the tag.

I tried with this line in jsp also:
<%@ page errorPage="errorPage.jsp" %>
But still the sameoutput.
My doubt is why it's printing message after throwing SkipPageException?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic