Hi skilled,
I need assistance with follow problem :( ...

I have some abstract class that I use as base class for my custom tags.
It has an attribute of Generic type:


public abstract class BaseGetValueTag<S> extends TagSupport{
.......

private S t_source = null;

public void setSource(S source)
{
t_source = source;
}

public S getSource()
{
return t_source;
}
......
Then I define some tag class that extends BaseGetValueTag:

public class TestTag extends BaseGetValueTag<test.Message>
{.....
tld:
<tag>
<name>test</name>
<tagclass>test.TestTag</tagclass>
<bodycontent>empty</bodycontent>
<attribute>
<name>var</name>
<required>true</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<name>source</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
JSP (a instance of test.Message):
<t:test var="test" source="${a}"/>


As result I have follow exception:

org.apache.jasper.JasperException: PWC6033: Unable to compile class for JSP
PWC6197: An error occurred at line: 14 in the jsp file: /success.jsp
PWC6199: Generated servlet error:
string:///success_jsp.java:130: setSource(test.Message) in test.BaseGetValueTag<test.Message> cannot be applied to (java.lang.Object)
PWC6199: Generated servlet error:
Note: string:///success_jsp.java from uses unchecked or unsafe operations.
PWC6199: Generated servlet error:
Note: Recompile with -Xlint:unchecked for details.
at org.apache.jasper.compiler.DefaultErrorHandler.jav acError(DefaultErrorHandler.java:123)
at org.apache.jasper.compiler.ErrorDispatcher.javacEr ror(ErrorDispatcher.java:296)
at org.apache.jasper.compiler.Compiler.generateClass( Compiler.java:376)
at org.apache.jasper.compiler.Compiler.compile(Compil er.java:437)
at org.apache.jasper.JspCompilationContext.compile(Js pCompilationContext.java:608)
at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:360)
...

All works fine if I change my BaseGetValueTag to :


public abstract class BaseGetValueTag extends TagSupport{
.......

private test.Message t_source = null;

public void setSource(test.Message source)
{
t_source = source;
}

public test.Message getSource()
{
return t_source;
}
......
Could anybody said where I'm wrong?