[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Absolute URL includes with JSP

Posted on 2002-03-19
6
Medium Priority
?
587 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 200 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
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…
Suggested Courses

650 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