You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Wei Zhao <we...@yahoo.com.cn> on 2005/09/14 01:00:49 UTC
Scripting variable is not generated
I am migrating some code from tomcat 4.* to 5.5.
However, I got some compilation error regarding the
scripting variable from taglib.
This is the definition of the scripting variable in
TEI file:
VariableInfo vSystemName = new VariableInfo(
"SystemName",
"String",
true,
VariableInfo.AT_END
);
This is how this tag is used in the JSP page:
If( some condition )
{
<system:getSystemName/>
<%=SystemName%>
}
else
{
<system:getSystemName/>
<%=SystemName%>
}
But a got a Java compilation error saying the second
SystemName cannot be resolved.
I looked into the generated java code and it seems
that only one SystemName is declared which is within
the âifâ and not visible in the âelseâ. If I
remove the âsystem:getSystemNameâ inside if,
âSystemNameâ is now declared inside âelseâ.
This works differently from Tomcat 4.* which always
generate the declaration of the âSystemNameâ in
above case. And I donât think itâs consistent with
the spec. The variable is defined as âAT_ENDâ
scope and âdeclareâ is set to true. So it should
always be declared or a lot of existing code will be
broken.
Any thoughts? Did I miss anything?
Thanks
Wei
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
RE: Scripting variable is not generated
Posted by Wei Zhao <we...@yahoo.com.cn>.
Hi Mark:
Thank you for your response. That definitely answered my question.
Do you know what's the status on this issue? Is Tomcat not going to support the relevant code before 4.1? It will be a huge effort (if possible) to work around the problem using either of the ways described in the bug entries you provided.
Thanks
Wei
-----Original Message-----
From: Mark Thomas [mailto:markt@apache.org]
Sent: Tuesday, September 13, 2005 11:09 PM
To: Tomcat Users List
Subject: Re: Scripting variable is not generated
Have a look at http://issues.apache.org/bugzilla/show_bug.cgi?id=21390
and http://issues.apache.org/bugzilla/show_bug.cgi?id=23425
Mark
Wei Zhao wrote:
> I am migrating some code from tomcat 4.* to 5.5.
> However, I got some compilation error regarding the
> scripting variable from taglib.
>
> This is the definition of the scripting variable in
> TEI file:
>
> VariableInfo vSystemName = new VariableInfo(
> "SystemName",
> "String",
> true,
> VariableInfo.AT_END
> );
>
> This is how this tag is used in the JSP page:
>
> If( some condition )
> {
> <system:getSystemName/>
> <%=SystemName%>
> }
> else
> {
> <system:getSystemName/>
> <%=SystemName%>
> }
>
> But a got a Java compilation error saying the second
> SystemName cannot be resolved.
> I looked into the generated java code and it seems
> that only one SystemName is declared which is within
> the “if†and not visible in the “elseâ€. If I
> remove the “system:getSystemName†inside if,
> “SystemName†is now declared inside “elseâ€.
>
> This works differently from Tomcat 4.* which always
> generate the declaration of the “SystemName†in
> above case. And I don’t think it’s consistent with
> the spec. The variable is defined as “AT_ENDâ€
> scope and “declare†is set to true. So it should
> always be declared or a lot of existing code will be
> broken.
>
> Any thoughts? Did I miss anything?
>
> Thanks
>
> Wei
>
>
>
>
>
> __________________________________
> Yahoo! Mail - PC Magazine Editors' Choice 2005
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
__________________________________________________
Do You Yahoo!?
�Ż����G���䣭�й���һ���������ʼ�ɧ�ų�������
http://cn.mail.yahoo.com/?idw071
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Scripting variable is not generated
Posted by Mark Thomas <ma...@apache.org>.
Have a look at http://issues.apache.org/bugzilla/show_bug.cgi?id=21390
and http://issues.apache.org/bugzilla/show_bug.cgi?id=23425
Mark
Wei Zhao wrote:
> I am migrating some code from tomcat 4.* to 5.5.
> However, I got some compilation error regarding the
> scripting variable from taglib.
>
> This is the definition of the scripting variable in
> TEI file:
>
> VariableInfo vSystemName = new VariableInfo(
> "SystemName",
> "String",
> true,
> VariableInfo.AT_END
> );
>
> This is how this tag is used in the JSP page:
>
> If( some condition )
> {
> <system:getSystemName/>
> <%=SystemName%>
> }
> else
> {
> <system:getSystemName/>
> <%=SystemName%>
> }
>
> But a got a Java compilation error saying the second
> SystemName cannot be resolved.
> I looked into the generated java code and it seems
> that only one SystemName is declared which is within
> the “if” and not visible in the “else”. If I
> remove the “system:getSystemName” inside if,
> “SystemName” is now declared inside “else”.
>
> This works differently from Tomcat 4.* which always
> generate the declaration of the “SystemName” in
> above case. And I don’t think it’s consistent with
> the spec. The variable is defined as “AT_END”
> scope and “declare” is set to true. So it should
> always be declared or a lot of existing code will be
> broken.
>
> Any thoughts? Did I miss anything?
>
> Thanks
>
> Wei
>
>
>
>
>
> __________________________________
> Yahoo! Mail - PC Magazine Editors' Choice 2005
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org