• Post Reply 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Internal server error

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I have the tld, descriptor and the jsp file,please let me know why the error is coming
Content of test-taglib.tld
<?xml version="1.0" encoding="ISO-8859-1" ?>
<taglib>
<!-- after this the default space is
"http://java.sun.com/j2ee/dtds/jsptaglibrary_1_2.dtd"
-->
<tlibversion>1.0</tlibversion>
<jspversion>1.1</jspversion>
<shortname>test</shortname>
<info>
A tag library from Core Servlets and JavaServer Pages,
http://www.coreservlets.com/.
</info>
<tag>
<name>required</name>
<tagclass>TestTag</tagclass>
<info>Simplest example: inserts one line of output</info>
<bodycontent>EMPTY</bodycontent>
</tag>
<!-- Other tags defined later... -->

Content of the descriptor file RequiredTag.java
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
public class RequiredTag implements Tag
{
private PageContext pageContext;
private Tag parentTag;
public void setPageContext(PageContext pageContext){
this.pageContext = pageContext;
}
public void setParent(Tag parentTag){
this.parentTag = parentTag;
}
public Tag getParent(){
return this.parentTag;
}
public int doStartTag() throws JspException{
try{
JspWriter out = pageContext.getOut();
out.print("<font color='#ff0000'>*</font>");
}catch(Exception e){
throw new JspException("error in RequiredTag.doStartTag()");
}
return SKIP_BODY;
}
public int doEndTag() throws JspException{
return EVAL_PAGE;
}
public void release(){}

}
Content of the TestTaglib.jsp
<html>
<head>
<%@ taglib prefix="test" uri="test-taglib.tld" %>
Name:<test:required /><input type=text name="name">
Password:<test:required /><input type=password name="password">
</head>
</html>
I am getting internal server error 500, please help why this error is coming
 
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<?xml version="1.0" encoding="ISO-8859-1" ?>
add specification of its DTD here.
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic