1
org.apache.jasper.JasperException: The absolute uri: http://granule.com/tags cannot be resolved

Open 1 Answers 112 Views Programming
1 1
I am trying to tag http://granule.com/tags in my JSP file as below.

<%@ taglib uri="http://granule.com/tags" prefix="g" %>

But I am getting error as given below:

org.apache.jasper.JasperException: The absolute uri: http://granule.com/tags cannot be resolved in either web.xml or the jar files deployed with this application
    at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:55) ~[tomcat-embed-jasper-8.0.32.jar:8.0.32]

.. ... ...

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_91]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_91]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_91]

 

How do I resolve that?

1 Answer

0
0
  1. Download the binary distribution of Granule Tag Library by following this URL: http://code.google.com/p/granule/downloads/list (granuleNNN.zip) and unpack the compressed file.

  2. Copy granuleNNN.jar in the distribution’s ‘lib’ directory to your web applications WEB-NF\lib directory.

  3. To use the granule compress tag, you must include taglib directive <%@ taglib uri="http://granule.com/tags" prefix="g" %> at the top of each JSP that uses this library.

  4. Copy the and declarations from web.xml (look below) from compressed file into your /WEB-INF/web.xml

    <servlet>
        <servlet-name>CompressServlet</servlet-name>
        <servlet-class>com.granule.CompressServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>CompressServlet</servlet-name>
        <url-pattern>/combined.js</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>CompressServlet</servlet-name>
        <url-pattern>/combined.css</url-pattern>
    </servlet-mapping>
    
  5. Put tags around the lists of script decorations (JS or CSS). For example -

    <g:compress>
      <link rel="stylesheet" type="text/css" href="css/dp.css"/>
      <link rel="stylesheet" type="text/css" href="css/demo.css"/>  
    </g:compress>
    ...
    <div id="datepicker"></div>
      <g:compress>
        <script type="text/javascript" src="common.js"/>
        <script type="text/javascript" src="closure/goog/base.js"/>
        <script>
          goog.require('goog.dom');
          goog.require('goog.date');
          goog.require('goog.ui.DatePicker');
       </script>
      <script type="text/javascript">
        var dp = new goog.ui.DatePicker();
        dp.render(document.getElementById('datepicker'));
      </script>
     </g:compress>
    ...
    
  6. Done.

answered by (151 points)
1Comments

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.
...