hgbdelphi
asked on
resin2.1.x not support jstl???
hi,experts,i want use jstl in resin2.1.x,but it will show some error in my page.
test.jsp
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<html>
<head>
<title></title>
</head>
it's test
</table>
</body>
</html>
when i use resin 2.1.5,it will show some error:
500 Servlet Exception
java.lang.NoClassDefFoundE rror: javax/servlet/jsp/el/Varia bleResolve r
at java.lang.Class.getDeclare dMethods0( Native Method)
at java.lang.Class.privateGet DeclaredMe thods(Clas s.java:164 7)
at java.lang.Class.getDeclare dMethods(C lass.java: 1131)
at java.beans.Introspector$1. run(Intros pector.jav a:1126)
at java.security.AccessContro ller.doPri vileged(Na tive Method)
at java.beans.Introspector.ge tPublicDec laredMetho ds(Introsp ector.java :1124)
at java.beans.Introspector.ge tTargetMet hodInfo(In trospector .java:989)
at java.beans.Introspector.ge tBeanInfo( Introspect or.java:37 0)
at java.beans.Introspector.ge tBeanInfo( Introspect or.java:14 4)
at java.beans.Introspector.ge tBeanInfo( Introspect or.java:20 5)
at java.beans.Introspector.<i nit>(Intro spector.ja va:351)
at java.beans.Introspector.ge tBeanInfo( Introspect or.java:14 4)
at com.caucho.jsp.Taglib.fill Tag(Taglib .java:429)
at com.caucho.jsp.Taglib.fill TagLibrary Info(Tagli b.java:377 )
at com.caucho.jsp.Taglib.<ini t>(Taglib. java:185)
at com.caucho.jsp.JspParser.p rocessTagl ib(JspPars er.java:17 79)
at com.caucho.jsp.JspParser.p arseTaglib Directive( JspParser. java:1764)
at com.caucho.jsp.JspParser.p arseDirect ive(JspPar ser.java:1 435)
at com.caucho.jsp.JspParser.p arseScript let(JspPar ser.java:1 293)
at com.caucho.jsp.JspParser.p arseNode(J spParser.j ava:540)
at com.caucho.jsp.JspParser.p arseJsp(Js pParser.ja va:453)
at com.caucho.jsp.JspParser.p arse(JspPa rser.java: 284)
at com.caucho.jsp.JspParser.p arse(JspPa rser.java: 232)
at com.caucho.jsp.JspManager. createPage (JspManage r.java:175 )
at com.caucho.jsp.PageManager .getPage(P ageManager .java:346)
at com.caucho.jsp.PageManager .getPage(P ageManager .java:201)
at com.caucho.jsp.QServlet.ge tPage(QSer vlet.java: 220)
at com.caucho.server.http.Fil terChainPa ge.doFilte r(FilterCh ainPage.ja va:129)
at com.caucho.server.http.Inv ocation.se rvice(Invo cation.jav a:312)
at com.caucho.server.http.Cac heInvocati on.service (CacheInvo cation.jav a:135)
at com.caucho.server.http.Htt pRequest.h andleReque st(HttpReq uest.java: 221)
at com.caucho.server.http.Htt pRequest.h andleConne ction(Http Request.ja va:163)
at com.caucho.server.TcpConne ction.run( TcpConnect ion.java:1 37)
at java.lang.Thread.run(Threa d.java:534 )
-------------------------- ---------- ---------- ---------- ---------- ---------- ----
Resin 2.1.5 (built Fri Oct 4 12:10:31 PDT 2002)
but when i use resin3.0.8 ,it will show "it's test",not erorr!
resin2.1.X not support jstl???
test.jsp
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<html>
<head>
<title></title>
</head>
it's test
</table>
</body>
</html>
when i use resin 2.1.5,it will show some error:
500 Servlet Exception
java.lang.NoClassDefFoundE
at java.lang.Class.getDeclare
at java.lang.Class.privateGet
at java.lang.Class.getDeclare
at java.beans.Introspector$1.
at java.security.AccessContro
at java.beans.Introspector.ge
at java.beans.Introspector.ge
at java.beans.Introspector.ge
at java.beans.Introspector.ge
at java.beans.Introspector.ge
at java.beans.Introspector.<i
at java.beans.Introspector.ge
at com.caucho.jsp.Taglib.fill
at com.caucho.jsp.Taglib.fill
at com.caucho.jsp.Taglib.<ini
at com.caucho.jsp.JspParser.p
at com.caucho.jsp.JspParser.p
at com.caucho.jsp.JspParser.p
at com.caucho.jsp.JspParser.p
at com.caucho.jsp.JspParser.p
at com.caucho.jsp.JspParser.p
at com.caucho.jsp.JspParser.p
at com.caucho.jsp.JspParser.p
at com.caucho.jsp.JspManager.
at com.caucho.jsp.PageManager
at com.caucho.jsp.PageManager
at com.caucho.jsp.QServlet.ge
at com.caucho.server.http.Fil
at com.caucho.server.http.Inv
at com.caucho.server.http.Cac
at com.caucho.server.http.Htt
at com.caucho.server.http.Htt
at com.caucho.server.TcpConne
at java.lang.Thread.run(Threa
--------------------------
Resin 2.1.5 (built Fri Oct 4 12:10:31 PDT 2002)
but when i use resin3.0.8 ,it will show "it's test",not erorr!
resin2.1.X not support jstl???
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks to sompol_kiatkamolchai ,i copy jsp-api.jar in G:\resin-2.1.9\lib
so it can work well,thanks very much.
Best Regard!
so it can work well,thanks very much.
Best Regard!
ASKER
hi,sompol_kiatkamolchai
i am sorry to interrput you,when i use resin2.1.9,and copy tomcat\common\lib|*.jar in resin2.1.9\lib,it can work ,but
<c:out value="${idCommunity.commu nityName}" />
can work,but ${idCommunity.communityNam e} can not work,
and when i use myself taglib it will say:
/communitmedical/webapp/sy stem/UserM anage.jsp: 4: `http://beltino.com/util/js'
has no matching taglib-uri. The taglib uri must match a taglib-uri for
a taglib specified in the web.xml or implicitly in a taglib.tld in the
tag jar.
or some error like this
beltUtil.tld:6 unknown element `xsi:schemaLocation' in `taglib'
this is my taglib tld:
<?xml version="1.0" encoding="UTF-8" ?>
<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd"
version="2.0">
<description>com.beltino.t ags</descr iption>
<display-name>beltino tags</display-name>
<tlib-version>1.1</tlib-ve rsion>
<short-name>utiltag</short -name>
<uri>http://beltino.com/util</uri>
<tag>
<description>javascript select</description>
<name>jselect</name>
<tag-class>com.beltino.tag s.js.JsSel ectTag</ta g-class>
<body-content>empty</body- content>
<attribute>
<name>value</name>
<required>true</required>
<rtexprvalue>true</rtexprv alue>
</attribute>
<attribute>
<name>type</name>
<required>true</required>
<rtexprvalue>true</rtexprv alue>
</attribute>
<attribute>
<name>name</name>
<required>true</required>
<rtexprvalue>true</rtexprv alue>
</attribute>
</tag>
<tag>
<description>javascript msg</description>
<name>jmsg</name>
<tag-class>com.beltino.tag s.js.JsMsg Tag</tag-c lass>
<body-content>empty</body- content>
<attribute>
<name>value</name>
<required>true</required>
<rtexprvalue>true</rtexprv alue>
</attribute>
</tag>
<tag>
<description>javascript util</description>
<name>jdate</name>
<tag-class>com.beltino.tag s.str.StrT ag</tag-cl ass>
<body-content>tagdependent </body-con tent>
<attribute>
<name>type</name>
<required>true</required>
<rtexprvalue>true</rtexprv alue>
</attribute>
</tag>
</taglib>
and this is my taglib class like this:
/*
* Created on 2004-8-4
*
*/
package com.beltino.tags.js;
import javax.servlet.jsp.JspExcep tion;
import javax.servlet.jsp.JspWrite r;
import javax.servlet.jsp.tagext.S impleTagSu pport;
import java.io.IOException;
public class JsSelectTag extends SimpleTagSupport {
private String type;
private String name;
private String value;
JspWriter out = null;
/**
* @return Returns the name.
*/
public String getName() {
return name;
}
/**
* @param name
* The name to set.
*/
public void setName(String name) {
this.name = name;
}
/**
* @return Returns the type.
*/
public String getType() {
return type;
}
/**
* @param type
* The type to set.
*/
public void setType(String type) {
this.type = type;
}
/**
* @return Returns the value.
*/
public String getValue() {
return value;
}
/**
* @param value
* The value to set.
*/
public void setValue(String value) {
this.value = value;
}
public void doTag() throws JspException, IOException {
out = getJspContext().getOut();
/**
* 选中框&# 30340; 195;ఀ 1;
*/
if ("select".equals(type)) {
getSelectBoxItem();
} else if ("check".equals(type)) {
getCheckBoxItem();
} else if ("radio".equals(type)) {
getRadioBoxItem();
}
}
/**
* 选中select 694;ߑ 3;的 值
*
* @param objName
* select框的 517;ढ 3;
* @param value
* select框的 540;
* @return
*/
private void getSelectBoxItem() {
String retStr = "";
retStr = "<script language='JavaScript'>" + "\n";
retStr = retStr + " document.all." + name + ".value = '" + value + "'"
+ "\n";
retStr = retStr + "</script>";
try {
out.println(retStr);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 选中radioBox&# 26694; 013;௚ 0;值
*
* @param objName
* radioBox框的&# 21517; 383;
* @param value
* radioBox框的&# 20540;
* @return
*/
private void getRadioBoxItem() {
String retStr = "";
retStr = "<script language='JavaScript'>" + "\n";
retStr = retStr + "var obj = document.all;" + "\n";
retStr = retStr + "try {" + "\n";
retStr = retStr + " obj." + name + "[1].checked;" + "\n";
retStr = retStr + " for(i = 0; i < obj." + name + ".length; i++) {"
+ "\n";
retStr = retStr + " if(obj." + name + "[i].value == '" + value
+ "') {" + "\n";
retStr = retStr + " obj." + name + "[i].checked = true;" + "\n";
retStr = retStr + " }" + "\n";
retStr = retStr + " }" + "\n";
retStr = retStr + "}" + "\n";
retStr = retStr + "catch(e) {" + "\n";
retStr = retStr + " obj." + name + ".checked = true;" + "\n";
retStr = retStr + "}" + "\n";
retStr = retStr + "</script>";
try {
out.println(retStr);
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* 选中CheckBox&# 26694; 013;௚ 0;值
*
* @param objName
* CheckBox框的&# 21517; 383;
* @param value
* CheckBox框的&# 20540;
* @return
*/
private void getCheckBoxItem() {
String retStr = "";
value = "," + value + ",";
retStr = "<script language='JavaScript'>" + "\n";
retStr = retStr + "var obj = document.all;" + "\n";
retStr = retStr + "try {" + "\n";
retStr = retStr + " obj." + name + "[1].checked;" + "\n";
retStr = retStr + " for(i = 0; i < obj." + name + ".length; i++) {"
+ "\n";
retStr = retStr + " if('" + value + "'.indexOf(',' + obj." + name
+ "[i].value + ',') > -1) {" + "\n";
retStr = retStr + " obj." + name + "[i].checked = true;" + "\n";
retStr = retStr + " }" + "\n";
retStr = retStr + " }" + "\n";
retStr = retStr + "}" + "\n";
retStr = retStr + "catch(e) {" + "\n";
retStr = retStr + " if('" + value + "'.indexOf(',' + obj." + name
+ ".value + ',') > -1) {" + "\n";
retStr = retStr + " obj." + name + ".checked = true;" + "\n";
retStr = retStr + " }" + "\n";
retStr = retStr + "}" + "\n";
retStr = retStr + "</script>";
try {
out.println(retStr);
} catch (IOException e) {
e.printStackTrace();
}
}
}
but when i use resin3.0.8 it can not error,and all is right,resin2.1.X not support jsp2.0????
thanks!
i am sorry to interrput you,when i use resin2.1.9,and copy tomcat\common\lib|*.jar in resin2.1.9\lib,it can work ,but
<c:out value="${idCommunity.commu
can work,but ${idCommunity.communityNam
and when i use myself taglib it will say:
/communitmedical/webapp/sy
has no matching taglib-uri. The taglib uri must match a taglib-uri for
a taglib specified in the web.xml or implicitly in a taglib.tld in the
tag jar.
or some error like this
beltUtil.tld:6 unknown element `xsi:schemaLocation' in `taglib'
this is my taglib tld:
<?xml version="1.0" encoding="UTF-8" ?>
<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd"
version="2.0">
<description>com.beltino.t
<display-name>beltino tags</display-name>
<tlib-version>1.1</tlib-ve
<short-name>utiltag</short
<uri>http://beltino.com/util</uri>
<tag>
<description>javascript select</description>
<name>jselect</name>
<tag-class>com.beltino.tag
<body-content>empty</body-
<attribute>
<name>value</name>
<required>true</required>
<rtexprvalue>true</rtexprv
</attribute>
<attribute>
<name>type</name>
<required>true</required>
<rtexprvalue>true</rtexprv
</attribute>
<attribute>
<name>name</name>
<required>true</required>
<rtexprvalue>true</rtexprv
</attribute>
</tag>
<tag>
<description>javascript msg</description>
<name>jmsg</name>
<tag-class>com.beltino.tag
<body-content>empty</body-
<attribute>
<name>value</name>
<required>true</required>
<rtexprvalue>true</rtexprv
</attribute>
</tag>
<tag>
<description>javascript util</description>
<name>jdate</name>
<tag-class>com.beltino.tag
<body-content>tagdependent
<attribute>
<name>type</name>
<required>true</required>
<rtexprvalue>true</rtexprv
</attribute>
</tag>
</taglib>
and this is my taglib class like this:
/*
* Created on 2004-8-4
*
*/
package com.beltino.tags.js;
import javax.servlet.jsp.JspExcep
import javax.servlet.jsp.JspWrite
import javax.servlet.jsp.tagext.S
import java.io.IOException;
public class JsSelectTag extends SimpleTagSupport {
private String type;
private String name;
private String value;
JspWriter out = null;
/**
* @return Returns the name.
*/
public String getName() {
return name;
}
/**
* @param name
* The name to set.
*/
public void setName(String name) {
this.name = name;
}
/**
* @return Returns the type.
*/
public String getType() {
return type;
}
/**
* @param type
* The type to set.
*/
public void setType(String type) {
this.type = type;
}
/**
* @return Returns the value.
*/
public String getValue() {
return value;
}
/**
* @param value
* The value to set.
*/
public void setValue(String value) {
this.value = value;
}
public void doTag() throws JspException, IOException {
out = getJspContext().getOut();
/**
* 选中框&#
*/
if ("select".equals(type)) {
getSelectBoxItem();
} else if ("check".equals(type)) {
getCheckBoxItem();
} else if ("radio".equals(type)) {
getRadioBoxItem();
}
}
/**
* 选中select
*
* @param objName
* select框的
* @param value
* select框的
* @return
*/
private void getSelectBoxItem() {
String retStr = "";
retStr = "<script language='JavaScript'>" + "\n";
retStr = retStr + " document.all." + name + ".value = '" + value + "'"
+ "\n";
retStr = retStr + "</script>";
try {
out.println(retStr);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 选中radioBox&#
*
* @param objName
* radioBox框的&#
* @param value
* radioBox框的&#
* @return
*/
private void getRadioBoxItem() {
String retStr = "";
retStr = "<script language='JavaScript'>" + "\n";
retStr = retStr + "var obj = document.all;" + "\n";
retStr = retStr + "try {" + "\n";
retStr = retStr + " obj." + name + "[1].checked;" + "\n";
retStr = retStr + " for(i = 0; i < obj." + name + ".length; i++) {"
+ "\n";
retStr = retStr + " if(obj." + name + "[i].value == '" + value
+ "') {" + "\n";
retStr = retStr + " obj." + name + "[i].checked = true;" + "\n";
retStr = retStr + " }" + "\n";
retStr = retStr + " }" + "\n";
retStr = retStr + "}" + "\n";
retStr = retStr + "catch(e) {" + "\n";
retStr = retStr + " obj." + name + ".checked = true;" + "\n";
retStr = retStr + "}" + "\n";
retStr = retStr + "</script>";
try {
out.println(retStr);
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* 选中CheckBox&#
*
* @param objName
* CheckBox框的&#
* @param value
* CheckBox框的&#
* @return
*/
private void getCheckBoxItem() {
String retStr = "";
value = "," + value + ",";
retStr = "<script language='JavaScript'>" + "\n";
retStr = retStr + "var obj = document.all;" + "\n";
retStr = retStr + "try {" + "\n";
retStr = retStr + " obj." + name + "[1].checked;" + "\n";
retStr = retStr + " for(i = 0; i < obj." + name + ".length; i++) {"
+ "\n";
retStr = retStr + " if('" + value + "'.indexOf(',' + obj." + name
+ "[i].value + ',') > -1) {" + "\n";
retStr = retStr + " obj." + name + "[i].checked = true;" + "\n";
retStr = retStr + " }" + "\n";
retStr = retStr + " }" + "\n";
retStr = retStr + "}" + "\n";
retStr = retStr + "catch(e) {" + "\n";
retStr = retStr + " if('" + value + "'.indexOf(',' + obj." + name
+ ".value + ',') > -1) {" + "\n";
retStr = retStr + " obj." + name + ".checked = true;" + "\n";
retStr = retStr + " }" + "\n";
retStr = retStr + "}" + "\n";
retStr = retStr + "</script>";
try {
out.println(retStr);
} catch (IOException e) {
e.printStackTrace();
}
}
}
but when i use resin3.0.8 it can not error,and all is right,resin2.1.X not support jsp2.0????
thanks!
Yes resin 2.xxx support JSP 1.2 spec, resin 3.xx support JSP 2.0
refer to http://www.caucho.com/resin-2.1/index.xtp
refer to http://www.caucho.com/resin-2.1/index.xtp
ASKER
thanks for your help!
happy!
happy!
This is JSP2.0 library class. you need to download and set to classpath or put in WEB-INF/lib