my dog learned polymorphism*
The moose likes JSP and the fly likes JSTL c:import issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSTL c:import issue" Watch "JSTL c:import issue" New topic
Author

JSTL c:import issue

dkumar kizhakkel
Greenhorn

Joined: Apr 25, 2008
Posts: 19
Hi

I import an external page to one of my webpage using jstl <%c:import%>
It works with windows,But when i run the page in Linux it shows

"org.apache.jasper.JasperException: javax.servlet.jsp.JspException: Problem accessing the absolute URL "+urlname


versions
Red Hat Enterprise Linux WS release 3 (Taroon)
Java 1.5
Apache Tomcat 5.5.26

Process I did
Copy standard.jar and jstl.jar to WEB-INF/lib dir
create tlds dir and copy c.tld
web.xml
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/tlds/c.tld</taglib-location>
</taglib>

The webpage includes

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
...
<c:import url="<%=urlpage%>" />

urlpage is dynamic

Can anyone help me to clear the issue.

Thanks
Dinesh
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61084
    
  66

There are a few errors in your setup. I'm not sure if they're causing your problem or not, but it's best to get everything squared away before diagnosing any further.

Originally posted by dkumar kizhakkel:
Process I did ...

create tlds dir and copy c.tld

Why? The tld files are already in the jar files in the classpath. Extracting them to the file system is not only unnecessary, it can cause issues with versions mismatches going forward. Remove these files.


web.xml

....

<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/tlds/c.tld</taglib-location>
</taglib>

Also remove these entries for the same reason.

As I said, this may not solve your issue, but it will get those potential problems out of the way.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
dkumar kizhakkel
Greenhorn

Joined: Apr 25, 2008
Posts: 19
I remove the tlds directory.Also change web.xml. But still the issue remaining..What change i want to do in configurations?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61084
    
  66

"org.apache.jasper.JasperException: javax.servlet.jsp.JspException: Problem accessing the absolute URL "+urlname

Is this the actual wording of the error message? It doesn't seen to match anything in your source.
dkumar kizhakkel
Greenhorn

Joined: Apr 25, 2008
Posts: 19
type Exception report

message

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

exception

org.apache.jasper.JasperException: javax.servlet.jsp.JspException: Problem accessing the absolute URL "http://micro.shoretel.com/www?p=overview&s=2&l=us&v=all". java.net.UnknownHostException: micro.shoretel.com
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:460)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause

javax.servlet.ServletException: javax.servlet.jsp.JspException: Problem accessing the absolute URL "http://micro.shoretel.com/www?p=overview&s=2&l=us&v=all". java.net.UnknownHostException: micro.shoretel.com
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:837)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
org.apache.jsp.shoretelpage_jsp._jspService(shoretelpage_jsp.java:200)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause

java.net.UnknownHostException: micro.shoretel.com
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
java.net.Socket.connect(Socket.java:520)
java.net.Socket.connect(Socket.java:470)
sun.net.NetworkClient.doConnect(NetworkClient.java:157)
sun.net.www.http.HttpClient.openServer(HttpClient.java:388)
sun.net.www.http.HttpClient.openServer(HttpClient.java:523)
sun.net.www.http.HttpClient.<init>(HttpClient.java:231)
sun.net.www.http.HttpClient.New(HttpClient.java:304)
sun.net.www.http.HttpClient.New(HttpClient.java:321)
sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:813)
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:765)
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:690)
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:934)
org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireReader(ImportSupport.java:331)
org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireString(ImportSupport.java:241)
org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTag(ImportSupport.java:161)
org.apache.jsp.shoretelpage_jsp._jspService(shoretelpage_jsp.java:176)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Your server can not find micro.shoretel.com.

Does your server have access to the internet?
If so, does it have a working DNS entry?

Try pinging that url from the command line.
I just did from my machine and it found that URL.



If ping can't find it, you'll need to talk with your system administrator or network administrator to find out why that machine can't find that URL.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
dkumar kizhakkel
Greenhorn

Joined: Apr 25, 2008
Posts: 19
Thanks. Now it works.

It was a problem with DNS setting.
Thanks for your valuable suggestions!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSTL c:import issue