dcsimg
"VariableInfo.NESTED" in scripting elements of taglib in weblogic not working
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   chander_chaudhary
Posted On:   Thursday, June 14, 2001 01:09 PM

Bonjour Friends i am running taglib in weblogic with following 4 files ,but could not access scripting variables please help! VarHelloTag.java VarHelloTagExtraInfo.java hello5.jsp var5.tld And Error which is coming package tagext; import javax.servlet.jsp.tagext.*; public class VarHelloTagExtraInfo extends TagExtraInfo { public VariableInfo[] getVariableInfo(TagData data) { return new VariableInfo[]{ new VariableInfo("nam", "String", false, VariableInfo.NESTED) , new VariableInfo("classe", "java.lang.String", true, VariableInfo.NESTED), new VariableInfo(   More>>
Bonjour

Friends
i am running taglib in weblogic
with following 4 files ,but could not access scripting variables please help!
VarHelloTag.java

VarHelloTagExtraInfo.java

hello5.jsp

var5.tld

And Error which is coming


package tagext;

import javax.servlet.jsp.tagext.*;

public class VarHelloTagExtraInfo extends TagExtraInfo {

public VariableInfo[] getVariableInfo(TagData data) {
return new VariableInfo[]{
new VariableInfo("nam", "String", false, VariableInfo.NESTED) ,
new VariableInfo("classe", "java.lang.String", true, VariableInfo.NESTED),
new VariableInfo("date", "java.lang.String", true, VariableInfo.NESTED)
};
}






package tagext;

import java.io.IOException;
import java.util.Date;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
import java.sql.*;
public class VarHelloTag extends TagSupport
{
public String nam;

public void setnam(String nam) {

this.nam = nam;
}
public String getnam() {
return nam;
}



public int doStartTag() throws JspTagException {


pageContext.setAttribute("nam",nam);
pageContext.setAttribute("class", getClass());
pageContext.setAttribute("date", new Date());

return EVAL_BODY_INCLUDE;
}

public int doEndTag() throws JspTagException {
return EVAL_PAGE;
}

}





PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">

1.0
1.1
exam

Simple example library.




helloVars
tagext.VarHelloTag
tagext.VarHelloTagExtraInfo
JSP

Simple example defining scripting variables


nam
true
true











<%@ taglib uri="/var5.tld" prefix="exam" %>










HTML.






thiis is
person <%= nam %>
.... <%=classe %>
.... <%=date%>




Plus de HTML.














Following error is coming

Compilation of 'C:weblogicmyserverclassfilesjsp_servlet\_hello5.java' failed:
--------------------------------------------------------------------------------
C:weblogicmyserverclassfilesjsp_servlet\_hello5.java:89: cannot resolve symbol
probably occurred due to an error in /hello5.jsp line 19:
person <%= nam %>

C:weblogicmyserverclassfilesjsp_servlet\_hello5.java:91: cannot resolve symbol
probably occurred due to an error in /hello5.jsp line 20:
.... <%=classe %>

C:weblogicmyserverclassfilesjsp_servlet\_hello5.java:93: cannot resolve symbol
probably occurred due to an error in /hello5.jsp line 21:
.... <%=date%>


--------------------------------------------------------------------------------

   <<Less

Re: "VariableInfo.NESTED" in scripting elements of taglib in weblogic not working

Posted By:   AlessandroA_Garbagnati  
Posted On:   Friday, June 15, 2001 11:03 AM

Hi,

I've tested your code. I've made few modifications because there were some error. For example:

  • Changed the VariableInfo class type from "String" to "java.lang.String" (it's always better to use the full qualified class name instead of just the simple name)

  • I've changed the declare flagfrom 'false' to 'true' (the 'na' object wasn't set before the tag call in your example)

  • The tag code was setting wrong types and names into the page scope: 'date' it's declared as a String and you've put a Date, 'class' was in reality 'classe' and it has been declared as String, while you've put it as Class object

So, excpeft these few errors, the code was perfectly workinq with both my systems running Tomcat and Resin.



Try to fix all the issues and do another test.
About | Sitemap | Contact