Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

how to add taglib of jsf in jsp pages

Posted on 2009-04-28
4
Medium Priority
?
3,864 Views
Last Modified: 2013-11-24
i got  this exception while running this jsp code how to handle it please help me

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsf/facelets cannot be resolved in either web.xml or the jar files deployed with this application
      org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
      org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
      org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)
      org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:312)
      org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:147)
      org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:420)
      org.apache.jasper.compiler.Parser.parseDirective(Parser.java:476)
      org.apache.jasper.compiler.Parser.parseElements(Parser.java:1426)
      org.apache.jasper.compiler.Parser.parse(Parser.java:133)
      org.apache.jasper.compiler.ParserController.doParse(ParserController.java:216)
      org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
      org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:167)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
      org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:316)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

note The full stack trace of the root cause is available in the JBossWeb/2.0.1.GA logs.
JBossWeb/2.0.1.GA
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"  "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/facelets" prefix="ui" %>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich" %>
<html>
 
 <body>
 
  <script type="text/javascript" src="swfobject1.js"></script>
 
 
 
  </tbody></table>
  <h3><%=session.getAttribute("flv")%></h3>
</body>
</html>

Open in new window

0
Comment
Question by:RaghupalReddy
  • 2
3 Comments
 
LVL 11

Expert Comment

by:Manish
ID: 24249149
I think u canonot use
<%@ taglib uri="http://java.sun.com/jsf/facelets" prefix="ui" %>

in jsp.
0
 
LVL 11

Expert Comment

by:Manish
ID: 24249165
0
 
LVL 12

Accepted Solution

by:
Gibu George earned 2000 total points
ID: 24261135
Add this to your web.xml file    
       <taglib id="1">
            <taglib-uri>http://java.sun.com/jsf/html</taglib-uri>
            <taglib-location>/WEB-INF/html.tld</taglib-location>
      </taglib>

you need to have the .tld files in the WEB-INF folder and also you need to add similar entries for for other libraries as well
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

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.
A solution for Fortify Path Manipulation.
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.
Suggested Courses
Course of the Month21 days, 4 hours left to enroll

810 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