Solved

Absolute URL includes with JSP

Posted on 2002-03-19
6
568 Views
Last Modified: 2013-11-24
My group is working on using JSP includes to make a webpage template. We want to use some absolute URL includes in the template but with testing and a review of Sun's JSP documentation website, the two available include commands do not support absolute URLs.

Is there a work around or do we have to make a local copy of the contents of the absolute URL (which we do own)?

P.S. We use variables to store the include values whether they are local webpages or absolute urls. We then use the include functions to call the variable.
0
Comment
Question by:daluu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 6

Expert Comment

by:kotan
ID: 6881692
<jsp:include> only supports the inclusion of resources within the same web application.

Anyway, to support this ficture, you can use "standard Taglib" from Jakarta project.

Here is the url to download standard taglib package.
http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html

In this taglib, you can write
  <c:import url="ftp://ftp.acme.com/README"/>
to include external rescoures.

For further documentation, please refer

http://jakarta.apache.org/taglibs/doc/jsptl-doc/IOT_Import_FunctionalDescription_5_EA2.html

If you don't know how to use taglib, feel free to ask me and I will guide you.
0
 
LVL 4

Author Comment

by:daluu
ID: 6883746
thanks, for the info, I'll try that out.
0
 
LVL 4

Author Comment

by:daluu
ID: 6884595
kotan, can you guide me thru the steps from install to usage. I am the web designer and just learning JSP. My colleague who manages the server and does JSP couldn't get it to work with the online documentation. I'll post her comment to me below.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Author Comment

by:daluu
ID: 6884597
hi david,

i've downloaded the standard library and tried to use it as per the
instruction but failed.
i found several instruction files and they give different usage and no one
could work.
could you send email to that guy to ask for detail steps? from download the
files to the usage? the following is my steps:
1, downloaded the jakarta-taglibs-20020316.zip file
2, extracted it
3, found the folder 'standard', and copy the standard.jar and jstl.jar into
the /<Tomcat 4.0>/WEB-INFO/lib/
4, in the /<Tomcat 4.0>/WEB-INFO/web.xml, added
    <taglib>
     <taglib-uri>http://java.sun.com/jstl/ea/core</taglib-uri>
     <taglib-location>/WEB-INF/c.tld</taglib-location>
    </taglib>
I couldn't find the standard.tld file in the 'standard' folder.
5, in my.jsp file, added
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
6, error:
Unable to load class org.apache.taglibs.standard.tag.el.core.ImportTag

jessie
0
 
LVL 6

Accepted Solution

by:
kotan earned 50 total points
ID: 6884691
1. He had download "nightly build" version which is very unstable. If you only need the standard package, you can download jakarta-taglibs-standard-beta1.zip from http://jakarta.apache.org/builds/jakarta-taglibs/releases/standard/ which is "release" version and it is more stable.

2. extracted it

3. copy standard.jar & jstl.jar from /jakarta-taglibs/jstl-beta1/ into /<Tomcat4.0>/WEB-INF/lib/

4. copy c.tld into /<Tomcat4.0>/WEB-INF/

5. Edit web.xml - add

<taglib>
  <taglib-uri>http://jakarta.apache.org/taglibs/standard/c</taglib-uri>
  <taglib-location>/WEB-INF/c.tld</taglib-location>
</taglib>

6. In jsp file, add
<%@ taglib uri="http://jakarta.apache.org/taglibs/standard/c" prefix="c" %>

(The uri must be same as the taglib-uri define in web.xml)

7. Then you will be able to call
 <c:import url="ftp://ftp.acme.com/README"/>

Since you have upload new jar files, remmeber to restart tomcat to take effect.

Good Luck!
0
 
LVL 4

Author Comment

by:daluu
ID: 6887257
Thanks alot kotan.

The code works perfect. My superiors will be happy.
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jar file executable 12 67
Windows and other UI names - The Proper names for the Various elements! 1 139
eclipse buid path vs tomcat lib path 10 45
How to build a web site 17 93
Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
The viewer will learn how to implement Singleton Design Pattern in Java.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

740 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