I am having a problem with bean:define and wls 6.1 sp5 when using it from a
<%@ include %> code.  I don't have this problem with sp4.

For example here is a simple test case (this code works on WebLogic 6.1 SP4,
but it does not work on WebLogic 6.1 SP5):

----FILE NAMED: wlstest.jsp----
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld"  prefix="bean"  %>
<html>
<head>
<title>wlstest</title>
</head>
<body>
On the first page: this is a test<br>
<%@ include file="wlstest2.jsp" %>
</body>
</html>

----FILE NAMED: wlstest2.jsp----
<bean:define id="myMessage" value="this is another test"
type="java.lang.String"/>
On the second page: <%= myMessage %><br>



With SP5 I get an error that:
/opt/home/weblogic/bea/wlserver6.1/config/SCRO/applications/.wlnotdelete/wla
p22883/WEB-INF/_tmp_war_SCRO_Server_SCRO_SCRO-WAR-0.1-dev/jsp_servlet/__wlst
est.java:118: Undefined variable: myMessage
probably occurred due to an error in /wlstest2.jsp line 2:
On the second page: <%= myMessage %><br>

It looks to me like SP5 allows me to use my struts-bean.tld that was defined
in the outer jsp,  but when I try to use that bean:define tag from the inner
jsp then it is as if the scripting variable that it sets is not accessible
from the inner jsp.

Just as a curiosity if I add a <jsp:useBean> to the inner JSP as shown in
the following, then it works fine on SP5, but fails on SP4:

----FILE NAMED: wlstest2.jsp----
<bean:define id="myMessage" value="this is another test"
type="java.lang.String"/>
<jsp:useBean id="myMessage" class="java.lang.String" /> 
On the second page: <%= myMessage %><br>

With SP4 that jsp:useBean will result in what to me is the expected error:
/wlstest.jsp(2): a variable named "myMessage" was previously declared at
line 1 of /wlstest2.jsp
probably occurred due to an error in /wlstest.jsp line 2:
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> 

This is bugging me because I used the <%@ include > quite a bit in my code
and now that we are trying to move to SP5 it is all screwy.  I know I could
go through and instead use jsp:include but I don't want to if I don't have
to.  Anybody have any ideas? Am I missing something? is sp5 missing
something?

- Jim Piper



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to