Message:

   The following issue has been resolved as WON'T FIX.

   Resolver: fabrizio giustina
       Date: Thu, 30 Dec 2004 8:39 AM

I tested the proposed patch but at the end I decided to not to include it in 
displaytag code for the following reasons:

- the problem seems due to a weblogic specific bug or behavior: calling 
encodeURL on a relative path generates an absolute URL without the correct 
request scheme. It works fine on other appservers (no problem in WebSphere 
Portal too).

- if this problem is due to the encodeURL call, this patch will not be enough, 
since there are 4 different places where encodeURL is used (for example if you 
use the "href" or "url" column attributes)

- the patch has a worst drawback: it the user adds an http href to 
display:table in an https page, links will always be generated as https. In 
other words, there will be no way to call an http url from an https page 
anymore.

I think there could be a more clean solution to your problem, without patching 
displaytag: since you are already generating a custom base href using portlet 
APIS, you should simply generate an absolute href, with the https:// prefix. I 
couldn't test it on weblogic, but I anyway hope it will not try to convert full 
https urls to http.


---------------------------------------------------------------------
View the issue:
  http://jira.codehaus.org/browse/DISPL-105

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: DISPL-105
    Summary: https hrefs in Table get generated as http
       Type: Bug

     Status: Resolved
   Priority: Major
 Resolution: WON'T FIX

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: DisplayTag
 Components: 
             Tag Library
   Fix Fors:
             1.0
   Versions:
             1.0 RC2

   Assignee: fabrizio giustina
   Reporter: Ted X. Toth

    Created: Thu, 11 Nov 2004 5:29 PM
    Updated: Thu, 30 Dec 2004 8:39 AM

Description:
If you are on a secure page generated links like sortable column headers aren't 
generated as https but rather http. This only occurs as far as I know on 
WebLogic on Windows. In TableTag.java in the initHref method I've added some 
code to fix this problem:
protected void initHref(RequestHelper requestHelper)
    {
        // get the href for this request
        Href normalHref = requestHelper.getHref();

        if (this.requestUri != null)
        {
            // if user has added a requestURI create a new href

            // call encodeURL to preserve session id when cookies are disabled
            String encodedURI = ((HttpServletResponse) 
this.pageContext.getResponse()).encodeURL(this.requestUri);
                        // Added as work around for WebLogic
                        StringBuffer encodedURIBuf = new 
StringBuffer(encodedURI);
                if (((HttpServletRequest) 
this.pageContext.getRequest()).getScheme() == "https" && 
!encodedURIBuf.toString().startsWith("https")) {
                        encodedURIBuf.replace(0, 4, "https");
                                encodedURI = encodedURIBuf.toString();
                }
            this.baseHref = new Href(encodedURI);

            // ... and copy parameters from the current request
            Map parameterMap = normalHref.getParameterMap();
            this.baseHref.addParameterMap(parameterMap);
        }
        else
        {
            // simply copy href
            this.baseHref = normalHref;
        }
    }

I don't care if you use this code as long as it gets fixed and I don't have to 
patch each release.


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
displaytag-devel mailing list
displaytag-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-devel

Reply via email to