Hi all,

Any body why some tags objects create by jasper is'nt members of page
object.

Example : for "/examples/jsp/simpletag/foo.jsp" page jasper generate :

            session = pageContext.getSession();
            out = pageContext.getOut();

            // HTML // begin
[file="/jsp/simpletag/foo.jsp";from=(0,0);to=(6,0)]
                out.write("<html>\r\n<!--\r\n  Copyright (c) 1999 The Apache
Software Foundation.  All rights \r\n  reserved.\r\n-->\r\n<body>\r\n");

            // end
            // HTML // begin
[file="/jsp/simpletag/foo.jsp";from=(6,77);to=(11,0)]
                out.write("\r\n\r\nRadio stations that
rock:\r\n\r\n<ul>\r\n");

            // end
            // begin [file="/jsp/simpletag/foo.jsp";from=(11,0);to=(11,45)]
                /* ----  eg:foo ---- */
                examples.FooTag _jspx_th_eg_foo_0 = new examples.FooTag();
                _jspx_th_eg_foo_0.setPageContext(pageContext);
                _jspx_th_eg_foo_0.setParent(null);
                _jspx_th_eg_foo_0.setAtt1("98.5");
                _jspx_th_eg_foo_0.setAtt2("92.3");
                _jspx_th_eg_foo_0.setAtt3("107.7");
                try {
                    int _jspx_eval_eg_foo_0 =
_jspx_th_eg_foo_0.doStartTag();
                    if (_jspx_eval_eg_foo_0 != Tag.SKIP_BODY) {
                        try {
                            if (_jspx_eval_eg_foo_0 !=
Tag.EVAL_BODY_INCLUDE) {
                              out = pageContext.pushBody();
                              _jspx_th_eg_foo_0.setBodyContent((BodyContent)
out);
                          }
                          _jspx_th_eg_foo_0.doInitBody();
                          do {
                              String member = null;
                              member = (String)
pageContext.findAttribute("member");
                          // end
                          // HTML // begin
[file="/jsp/simpletag/foo.jsp";from=(11,45);to=(12,4)]
                              out.write("\r\n<li>");

























  // -----------------------------------------------------------------------
                          // if you add some embled tag
                          examples.EMBTag _jspx_th_eg_foo_0 = new
examples.EMBTag();
                          ...

There's somme problemes :
        *    For iterations tags all of embled tags is re-create for each
iterations.
        *    The parent tag can not get some static parameter of children
tags.
        *    Is slower

Why jasper don't genrate like :

public class _0002fjsp_0002fsimpletag_0002ffoo_jsp extends HttpJspBase {
                examples.FooTag _jspx_th_eg_foo_0 = new examples.FooTag();
                examples.EMBTag _jspx_th_eg_foo_1 = new examples.EMBTag();
               ......
    public final void _jspx_init() throws org.apache.jasper.JasperException
{
                // Static parameter initialisation only, not fooparam="<%= i
%>"
                _jspx_th_eg_foo_0.setPageContext(pageContext);
                _jspx_th_eg_foo_0.setParent(null);
                _jspx_th_eg_foo_0.setAtt1("98.5");
                _jspx_th_eg_foo_0.setAtt2("92.3");
                _jspx_th_eg_foo_0.setAtt3("107.7");
                _jspx_th_eg_foo_1 = setAtt1("XX") ;
    }

The TLD can descripe static/dynamic attribute.

Thank,

Reply via email to