Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002379 [Resin] minor always 01-29-08 07:05 02-13-08 13:38
Reporter wimsie View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version 3.1.3
Summary 0002379: using JSTL core redirect tag causes malformed URIs when context attribute is set to "/"
Description I have the page Resin.html within I want to redirect to another page with
the use of JTSL. But when trying to use JSTLs core redirect-Tag, i always
run into problems.

Here is the source of this page.

Resin.html

<!DOCTYPE html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ taglib prefix="custom" uri="http://example.org/jstl/custom" [^] %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" [^] %>
<html>
<head>
    <title>Resin Test Page</title>
</head>
<body>
    <c:set var="redirURL"><custom:URL jspPage="MyPage"/></c:set>
    <c:redirect url="${redirURL}" context="/">
</body>
</html>

<custom:URL> gives me the absolute path of 'MyPage' within the context of
the webapp as '/context/MyPage.html', where '/context' is configured as
webapp id in resin.conf

resin.conf

<web-app id='/context' root-directory='/home/resin/webapp' work-dir='/home/resin/work'>
...
</web-app>

Without using the context param of c:redirect the page will be redirected to the address
'/context/context/MyPage.html'.

Using a blank context param, i get the following error.

javax.servlet.jsp.JspException: URL context '' must start with '/'

So I thought using context="/", as shown in Resin.html, will bring it to me. But now the
redirect is done to '//context/MyPage.html'.

Is it possible to fix this double slash within com/caucho/jstl/rt/CoreUrlTag.java??

The method normalizeURL at line 157ff only does
value.append(context);
value.append(url);

Wouldn't it be better to check for duplicate slashes??
if (context.equals("/")) {
    value.append(url);
} else {
    value.append(context + url);
}
Additional Information
Attached Files

- Relationships

- Notes
(0002768)
ferg
02-13-08 13:38

jsp/1ck5
 

- Issue History
Date Modified Username Field Change
01-29-08 07:05 wimsie New Issue
02-13-08 09:37 ferg Status new => acknowledged
02-13-08 13:38 ferg Note Added: 0002768
02-13-08 13:38 ferg Assigned To  => ferg
02-13-08 13:38 ferg Status acknowledged => closed
02-13-08 13:38 ferg Resolution open => fixed
02-13-08 13:38 ferg Fixed in Version  => 3.1.5


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
29 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker