Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp tagdependent custom tag

 
Ranadhir Nag
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a Bodytagsupport subclassed class with the following :
public int doAfterBody() throws JspException {

try{
JspWriter out = getPreviousOut();
BodyContent bodyContent = getBodyContent();
String thisbody=bodyContent.getString();
thisbody+="\n";
thisbody+=param;
out.print(thisbody);

}
catch(Exception e) {

e.printStackTrace();
}
return SKIP_BODY;
}
Here param is an attribute of the tag;which is to be appended to the tag body-simple,isnt it?
the JSP content is :
<table border=1 cellspacing=0 cellpadding=2>
<sample:echotag param="IBM">
<tr><td> ${firstname} </td></tr>
</sample:echotag>
</table>

In the resulting html i get IBm printed before ${firstname},why?
 
Ranadhir Nag
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The dostarttag is as follows:
public int doStartTag() throws JspException {
try {
JspWriter out = pageContext.getOut();

} catch (Exception e) {
e.printStackTrace();
}

return EVAL_BODY_BUFFERED;
}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic