Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

why these exception please see

 
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Dear sir when i am accessing my jsp file then i am getting thes exception that

org.apache.jasper.JasperException: Unable to initialize TldLocationsCache: XML parsing error on file /WEB-INF/connect.tld: (line 4, col 23)

coding of all 3 file that is tag handler,tld file and jsp file are well if you want to see the coding then coding are as below

[code ]//for jsp file

<html>
<body>
<%@ taglib uri="/connect.tld" prefix="chrt" %>

<chrt:connect />
</body>
</html>
[/code]

[code]//for tld file
<taglib>
<tlib-version>1.0</tlib-version>
<jsp-version>1.2</jsp-version>
<short-name>connect</connect>
<tag>
<name>connect</name>
<tag-class>harbanse.connect</tag-class>
<body-content>empty</body-content>
</tag></taglib>

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

[code] //for tag class
package harbanse;
import java.sql.*;
import java.io.Serializable;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
public class connect extends TagSupport implements Serializable{
String st1,st2,name,pass1,pass2;
public void setSt1(String st1){
this.st1=st1; }

public void setSt2(String st2){
this.st2=st2;}

public void setName(String name){
this.name=name; }

public void setPassword1(String pass1){
this.pass1=pass1; }

public void setPassword2(String pass2){
this.pass2=pass2; }

public int doStartTag(){
try{
JspWriter out=pageContext.getOut(); String st="insert into user_login (user_id,user_password) values (name,pass1);";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection ( "Jdbc dbc:MyDataSource","scott","tiger"); Statement stmt=con.createStatement();
int n=stmt.executeUpdate(st);
}
catch(Exception e){}
return SKIP_BODY;
}
}

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



and at the time of deployment i have give in file refrence for tag as below

/connect.tld /web-inf/connect.tld

sir here i would like to know that why above exception
is server not serching tld file?
server reached at tld file but not reaching to harbanse.connect?

what problem sir

with regard

Arun kumar maalik
 
Ranch Hand
Posts: 393
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
1. Are you sure that <jsp-version> is valid tag in tld. I am not sure, I have never used it..

2. replace the <taglib> element in your told with the following ...
<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 http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
version="2.0">
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place.
 
    Bookmark Topic Watch Topic
  • New Topic