zamies banno

Greenhorn
+ Follow
since Jun 17, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by zamies banno

This would mean that the servlet container takes care of it?
Like with the implicit conversion in setProperty() with JavaBeans?
16 years ago
JSP
Hi you all,

I encountered an example of a custom tag and deployment of that tag which raised a question. The example is as follows:

A custom tag implementing the Tag interface.

public class ifTag implements Tag
{
private boolean condition;
public void setCondition(boolean condition)
{
this.condition = condition;
}
public int doStartTag() throws JspException
{
if (condition)
....something
else
...something else
}
...all other methods
....
}

Now if I deploy this custom tag in a TLD as follows:
<tag>
...name
... etc
<attribute>
.....
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>

Isn't this wrong? Shouldn't you get an compile time error because of mismatching types? No type means default java.lang.String type? I mean aren't you supposed to declare the type of the attribute as being boolean?
And what if you declare the following in the TLD:

<attribute>
...
<rtexprvalue>true</rtexprvalue>
<type>boolean</type>
</attribute>

Does that means you can't use a request parameter as the trexprvalue for this custom tag directly, because you'll have to convert it from String to boolean first?

well any help appreciated (on this subject that is).

grtsBanno
16 years ago
JSP
Yes its in the context of one webapplication not in the context of the servletcontainer. To share data try using a database or flat file.
16 years ago