You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by "I-Sampige, Srinivas" <sr...@boeing.com> on 2002/06/29 02:08:43 UTC

evalutation of a tags output as JSP

Hi 

     I have developed and extended tag that outputs a set of extended tags.
But that is happening is , when I see the source of the HTML screen that
comes up, I see those raw extended tags that were output by my JSP. As I
understand it, the output of a tag is interpreted as HTML. What do I need to
do to treat the output of an extended tag as JSP at runtime? Here is the
section of code from my extended tag   that outputs the extended tags (my
doStartTag method returns EVAL_BODY_TAG)-

=================================================================
public int doAfterBody() 
{
	if (count==0)
	{
		try
		{
			count++;
			BodyContent body = getBodyContent();
			JspWriter out = body.getEnclosingWriter();
			String opMode =
(EtracSessionManager.getUserSessionInfo(pageContext.getSession())).getOpMode
();
			StringBuffer buffer = new StringBuffer();
			buffer.append("<html:form name=\"navigateToForm\"
type=\"com.boeing.etrac.actionform.NavigateToForm\" method=\"post\"
action=\"/navigateTo\"> \n");
			buffer.append("<input type=\"hidden\"
name=\"navigateTo\" value=\"\"/> \n");
			buffer.append("<input type=\"hidden\"
name=\"opMode\" value=\"");
			buffer.append(opMode);
			buffer.append("\"/> \n");
			buffer.append("</html:form> \n");
			System.out.println(buffer.toString());
			out.write(buffer.toString());
		}catch(Exception e)
		{
			e.printStackTrace();
		}
		return EVAL_BODY_TAG;
	}
	else if(count == 1)
	{

		count ++;
		return EVAL_BODY_TAG;
	}		
	else
	{
		
		return EVAL_PAGE;	
	}
}
============================================================================
=========


When I do a view source of the HTML page that comes up I see the raw
<html:form> tags like this .............
============================================================================
===============
<html:form name="navigateToForm"
type="com.boeing.etrac.actionform.NavigateToForm" method="post"
action="/navigateTo"> 
<input type="hidden" name="navigateTo" value=""/> 
<input type="hidden" name="opMode" value="null"/> 
</html:form> 



<table width="925" border="0" cellspacing="0">
  <tr> 
    <td><img height="12" width="921" src="images/header_pxl.gif"></td>
  </tr>
</table>
============================================================================
====================


Here is the JSP code :-
============================================================================
================================
<etrac:navigateTo></etrac:navigateTo>


<table width="925" border="0" cellspacing="0">
  <tr> 
    <td><img height="12" width="921" src="images/header_pxl.gif"></td>
  </tr>
</table>
============================================================================
====================================

ANY HELP IS GRATELY APPRECIATED!

thanks in advance
Srinivas Sampige

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>