Thanks for all your help.
But I still have questions :-). I know that the body content of the tag is the
runtime entity. I think the value of some attributes is also runtime entity, if
its value can be EL. The method generateAttribute can generate the code in the
generated x_jsp.java file which returns the dynamic value of the attribute. So
I can write such code to get the dynamic value in the x_jsp.java file:
//in jsp file
<c:out value="${xxx}/">
//in the tag plugin file
ctxt.generateJavaSource("String s = (String)");
ctxt.generateAttribute("value");
ctxt.generateJavaSource(";");
The generated code is:
String s = (String) (Object)
org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate
("${xxx}", java.lang.Object.class, (PageContext)
_jspx_page_context, null, false);
But if I write such code:(just for example)
//the jsp file
<c:out value="asd">${xxx}</c:out>
//in the tag plugin file
ctxt.generateJavaSource("String s = (String)");
ctxt.generateBody();
ctxt.generateJavaSource(";");
the generated code is:
String s = (String) out.write((Object)
org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate
("${xxx}", java.lang.Object.class, (PageContext)
_jspx_page_context, null, false));
and this code's syntax is wrong.
I think that there should be a method to provide the functionality similar to
the one of the generateAttribute which doesn't output the "out.write" source
code, so that I can use the body content in the generated file x_jsp.java.
I am not so good at English so perhaps my expression is not very clear. Sorry
about that.
---------------------------------
DO YOU YAHOO!?
雅虎免费G邮箱-中国第一绝无垃圾邮件骚扰超大邮箱