Solved

resin2.1.x not support jstl???

Posted on 2004-08-12
6
1,407 Views
Last Modified: 2013-11-24
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.NoClassDefFoundError: javax/servlet/jsp/el/VariableResolver
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at java.lang.Class.privateGetDeclaredMethods(Class.java:1647)
      at java.lang.Class.getDeclaredMethods(Class.java:1131)
      at java.beans.Introspector$1.run(Introspector.java:1126)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1124)
      at java.beans.Introspector.getTargetMethodInfo(Introspector.java:989)
      at java.beans.Introspector.getBeanInfo(Introspector.java:370)
      at java.beans.Introspector.getBeanInfo(Introspector.java:144)
      at java.beans.Introspector.getBeanInfo(Introspector.java:205)
      at java.beans.Introspector.<init>(Introspector.java:351)
      at java.beans.Introspector.getBeanInfo(Introspector.java:144)
      at com.caucho.jsp.Taglib.fillTag(Taglib.java:429)
      at com.caucho.jsp.Taglib.fillTagLibraryInfo(Taglib.java:377)
      at com.caucho.jsp.Taglib.<init>(Taglib.java:185)
      at com.caucho.jsp.JspParser.processTaglib(JspParser.java:1779)
      at com.caucho.jsp.JspParser.parseTaglibDirective(JspParser.java:1764)
      at com.caucho.jsp.JspParser.parseDirective(JspParser.java:1435)
      at com.caucho.jsp.JspParser.parseScriptlet(JspParser.java:1293)
      at com.caucho.jsp.JspParser.parseNode(JspParser.java:540)
      at com.caucho.jsp.JspParser.parseJsp(JspParser.java:453)
      at com.caucho.jsp.JspParser.parse(JspParser.java:284)
      at com.caucho.jsp.JspParser.parse(JspParser.java:232)
      at com.caucho.jsp.JspManager.createPage(JspManager.java:175)
      at com.caucho.jsp.PageManager.getPage(PageManager.java:346)
      at com.caucho.jsp.PageManager.getPage(PageManager.java:201)
      at com.caucho.jsp.QServlet.getPage(QServlet.java:220)
      at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:129)
      at com.caucho.server.http.Invocation.service(Invocation.java:312)
      at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
      at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:221)
      at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:163)
      at com.caucho.server.TcpConnection.run(TcpConnection.java:137)
      at java.lang.Thread.run(Thread.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???
0
Comment
Question by:hgbdelphi
  • 3
  • 3
6 Comments
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11790990
javax/servlet/jsp/el/VariableResolver

This is JSP2.0 library class. you need to download and set to classpath or put in WEB-INF/lib
0
 
LVL 11

Accepted Solution

by:
sompol_kiatkamolchai earned 50 total points
ID: 11791038
You can get that library by download this and install to hard drive.
http://www.signal42.com/mirrors/apache/jakarta/tomcat-5/v5.0.27/bin/jakarta-tomcat-5.0.27.exe
The library located in

C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib\jsp-api.jar

0
 

Author Comment

by:hgbdelphi
ID: 11791174
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!
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:hgbdelphi
ID: 11806706
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.communityName}"/>
can work,but ${idCommunity.communityName} can not work,
and when i use myself taglib it will say:
/communitmedical/webapp/system/UserManage.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.tags</description>
  <display-name>beltino tags</display-name>
  <tlib-version>1.1</tlib-version>
  <short-name>utiltag</short-name>
  <uri>http://beltino.com/util</uri>
 
  <tag>
    <description>javascript select</description>
    <name>jselect</name>
    <tag-class>com.beltino.tags.js.JsSelectTag</tag-class>
    <body-content>empty</body-content>
    <attribute>      
            <name>value</name>
        <required>true</required>
        <rtexprvalue>true</rtexprvalue>
    </attribute>
    <attribute>
        <name>type</name>
        <required>true</required>
        <rtexprvalue>true</rtexprvalue>
    </attribute>
    <attribute>
        <name>name</name>
        <required>true</required>
        <rtexprvalue>true</rtexprvalue>
     </attribute>
  </tag>


  <tag>
    <description>javascript msg</description>
    <name>jmsg</name>
    <tag-class>com.beltino.tags.js.JsMsgTag</tag-class>
    <body-content>empty</body-content>
    <attribute>      
            <name>value</name>
        <required>true</required>
        <rtexprvalue>true</rtexprvalue>
    </attribute>
  </tag>
 
  <tag>
    <description>javascript util</description>
    <name>jdate</name>
    <tag-class>com.beltino.tags.str.StrTag</tag-class>
    <body-content>tagdependent</body-content>
    <attribute>      
            <name>type</name>
        <required>true</required>
        <rtexprvalue>true</rtexprvalue>
    </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.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.SimpleTagSupport;
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();
    /**
     * &#36873;&#20013;&#26694;&#30340;&#20195;&#30721;
     */    
        if ("select".equals(type)) {
            getSelectBoxItem();
        } else if ("check".equals(type)) {
            getCheckBoxItem();
        } else if ("radio".equals(type)) {
            getRadioBoxItem();
        }
             
    }
    /**
     * &#36873;&#20013;select&#26694;&#20013;&#30340;&#20540;
     *
     * @param objName
     *            select&#26694;&#30340;&#21517;&#23383;
     * @param value
     *            select&#26694;&#30340;&#20540;
     * @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();
        }
    }
    /**
     * &#36873;&#20013;radioBox&#26694;&#20013;&#30340;&#20540;
     *
     * @param objName
     *            radioBox&#26694;&#30340;&#21517;&#23383;
     * @param value
     *            radioBox&#26694;&#30340;&#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();
        }
    }
    /**
     * &#36873;&#20013;CheckBox&#26694;&#20013;&#30340;&#20540;
     *
     * @param objName
     *            CheckBox&#26694;&#30340;&#21517;&#23383;
     * @param value
     *            CheckBox&#26694;&#30340;&#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!
0
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11806827
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
0
 

Author Comment

by:hgbdelphi
ID: 11806851
thanks for your help!

happy!
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
array6 challenfge 6 100
Which is the latest version of Apache Tomcatl 3 56
jsp login check 12 30
sql import cannot be resolved jsp 3 19
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question