I have just read this article and am working on a web project using it:
There's only one thing that either I'm missing or it doesn't say that I need to do.
If I set up a template tag, how can I use the content data in a scriptlet?
For example, say this is test.jsp:
If know I can do this in template.jsp:
To display:
Test = 500
However, what I need to do is something like the following (and I know I have the types wrong, this is just psuedo-code):
The compiler won't now how to handle that, though, right? Is there another way to do that?
Thanks,
Tom
There's only one thing that either I'm missing or it doesn't say that I need to do.
If I set up a template tag, how can I use the content data in a scriptlet?
For example, say this is test.jsp:
Code:
<%@ taglib uri='/WEB-INF/template/template.tld' prefix='template' %>
<template:insert template='/template.jsp'>
<template:put name='test' content='500' direct='true'/>
</template:insert>
If know I can do this in template.jsp:
Code:
<h1>Test = <template:get name='test'/></h1>
To display:
Test = 500
However, what I need to do is something like the following (and I know I have the types wrong, this is just psuedo-code):
Code:
<%
int i = <template:get name='test'/> * 2;
%>
<h1>Test * 2 = <%= i ></h1>
The compiler won't now how to handle that, though, right? Is there another way to do that?
Thanks,
Tom