This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Servlets and the fly likes Absolute vs Relative paths Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Absolute vs Relative paths" Watch "Absolute vs Relative paths" New topic

Absolute vs Relative paths

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I'm experiencing problems with paths in my JSP.
Look at this code below:
<%@taglib uri="/WEB-INF/lib/dbtags.jar" prefix="jdbc" %>
My Windows NT system doesn't find the file and doesn't compile unless I put the absolute path like so:
<%@taglib uri="file:c:\\forte4j\\Development\\cdshopcart\\WEB-INF\\lib\\dbtags.jar" prefix="jdbc" %>
Also...notice that I have to use back slashes because I'm running Windows. (This makes my code platform specific)
How do I fix this problem.
Do I have to set classpaths?
Will setting the classpath fix the problem?
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
That taglib location can go in your web.xml file.
In my web.xml file I have:
In the JSP page:
<title>Student Signin</title></head>
<%@ taglib uri="JSPbook/taglib" prefix="ch11" %>

<ch11:signin studentId='<%= request.getParameter("stuid") %>'
studentPw='<%= request.getParameter("stupw") %>'
course='<%= request.getParameter("course") %>' >

author of:
I agree. Here's the link:
subject: Absolute vs Relative paths
It's not a secret anymore!