Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Java
Apache JDBC utils
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Jan Burse, post: 5021042"] Yes, the argument that goes against <% %> since they are not true XML tags doesn't work since the Java source files are generated as text/plain. But a template language could nevertheless be used that is based on XML. Only problem here is if one wants to generate an instruction from the template language itself. Which is normaly not the case for Java code, since it has hardly raw XML. But In general the problem is agravated whenever one wants to use a template language X to generate code in the same template language X. For example in a couple of places I use JSP to generate JSP. The workaround here is to define a custom tag that generates the <% and %>. Here is the code for this Taglet: /** * <p>This tag generates the <% %> pair. * * <p>Matula 1.3 (a beans and jsp generator) * <br>GPL 2003-2005, Jan Burse, XLOG Switzerland */ public class ScriptJava extends TagSupport { public int doStartTag() throws JspException { try { pageContext.getOut().print("<%"); } catch (IOException x) { throw new JspException(x); } return TagSupport.EVAL_BODY_INCLUDE; } public int doEndTag() throws JspException { try { pageContext.getOut().print("%>"); } catch (IOException x) { throw new JspException(x); } return TagSupport.EVAL_PAGE; } } Bye [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Java
Apache JDBC utils
Top