You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jspwiki.apache.org by "Jürgen Weber (JIRA)" <ji...@apache.org> on 2007/11/05 21:35:50 UTC

[jira] Created: (JSPWIKI-22) ShortURLConstructor broken

ShortURLConstructor broken
--------------------------

                 Key: JSPWIKI-22
                 URL: https://issues.apache.org/jira/browse/JSPWIKI-22
             Project: JSPWiki
          Issue Type: Bug
          Components: Core & storage
    Affects Versions: 2.6.0
         Environment: apache-tomcat-6.0.14, java 6, XP
            Reporter: Jürgen Weber
            Priority: Blocker
             Fix For: 2.6.0


Downloaded 2.5.149, unpacked with core pages, ran, fine.
Changed jspwiki.urlConstructor to ShortURLConstructor.

Now, navigation is broken: there is one wike element in the URL too much, also it seems the css cannot be found.

http://localhost:8080/JSPWiki/wiki/wiki/OneMinuteWiki

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-22) ShortURLConstructor broken

Posted by "Jürgen Weber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-22?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540535 ] 

Jürgen Weber commented on JSPWIKI-22:
-------------------------------------

No, I hadn't, there wasn't a comment at the urlConstructor parameter that you should ;-)

But anyway, I set jspwiki.baseURL=http://localhost:8080/
images and css are not found, links are wrong: http://localhost:8080/wiki/OneMinuteWiki

I think the baseURL should not be needed as the webapp can learn al necessary from the request object.

> ShortURLConstructor broken
> --------------------------
>
>                 Key: JSPWIKI-22
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-22
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Core & storage
>    Affects Versions: 2.6.0
>         Environment: apache-tomcat-6.0.14, java 6, XP
>            Reporter: Jürgen Weber
>            Priority: Blocker
>             Fix For: 2.6.0
>
>
> Downloaded 2.5.149, unpacked with core pages, ran, fine.
> Changed jspwiki.urlConstructor to ShortURLConstructor.
> Now, navigation is broken: there is one wike element in the URL too much, also it seems the css cannot be found.
> http://localhost:8080/JSPWiki/wiki/wiki/OneMinuteWiki

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-22) ShortURLConstructor broken

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-22?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540280 ] 

Janne Jalkanen commented on JSPWIKI-22:
---------------------------------------

Yah, ShortURLConstructor is broken in lots of other places as well.  Does ShortViewURLConstructor work for you?

> ShortURLConstructor broken
> --------------------------
>
>                 Key: JSPWIKI-22
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-22
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Core & storage
>    Affects Versions: 2.6.0
>         Environment: apache-tomcat-6.0.14, java 6, XP
>            Reporter: Jürgen Weber
>            Priority: Blocker
>             Fix For: 2.6.0
>
>
> Downloaded 2.5.149, unpacked with core pages, ran, fine.
> Changed jspwiki.urlConstructor to ShortURLConstructor.
> Now, navigation is broken: there is one wike element in the URL too much, also it seems the css cannot be found.
> http://localhost:8080/JSPWiki/wiki/wiki/OneMinuteWiki

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-22) ShortURLConstructor broken

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-22?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540600 ] 

Janne Jalkanen commented on JSPWIKI-22:
---------------------------------------

Both RSS and Atom specifications require that the URIs are absolute.

And yes, there are cases in which you also do want to have absolute URIs in the HTML source.  For example when you want to switch between HTTPS and HTTP (e.g. when doing secure logins).  (Well, that, or do redirects, but in our case there is no difference.)

> ShortURLConstructor broken
> --------------------------
>
>                 Key: JSPWIKI-22
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-22
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Core & storage
>    Affects Versions: 2.6.0
>         Environment: apache-tomcat-6.0.14, java 6, XP
>            Reporter: Jürgen Weber
>            Priority: Blocker
>             Fix For: 2.6.0
>
>
> Downloaded 2.5.149, unpacked with core pages, ran, fine.
> Changed jspwiki.urlConstructor to ShortURLConstructor.
> Now, navigation is broken: there is one wike element in the URL too much, also it seems the css cannot be found.
> http://localhost:8080/JSPWiki/wiki/wiki/OneMinuteWiki

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-22) ShortURLConstructor broken

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-22?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540537 ] 

Janne Jalkanen commented on JSPWIKI-22:
---------------------------------------

Well, there *is* a comment on baseURL that you should :)

The baseURL cannot be determined if a) there is no request object (which does happen e.g. during initialization), or, more importantly, b) when the wiki is behind a proxy or a firewall or a tunnel.  Trust me, it's very useful.

Your baseURL must be wrong, by the way: it's missing the name of your wiki.  E.g.

jspwiki.baseURL = http://localhost:8080/JSPWiki/

Only if you put it in your ROOT, then the baseURL can be http://localhost:8080/

Closing this bug; it's a configuration issue.

> ShortURLConstructor broken
> --------------------------
>
>                 Key: JSPWIKI-22
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-22
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Core & storage
>    Affects Versions: 2.6.0
>         Environment: apache-tomcat-6.0.14, java 6, XP
>            Reporter: Jürgen Weber
>            Priority: Blocker
>             Fix For: 2.6.0
>
>
> Downloaded 2.5.149, unpacked with core pages, ran, fine.
> Changed jspwiki.urlConstructor to ShortURLConstructor.
> Now, navigation is broken: there is one wike element in the URL too much, also it seems the css cannot be found.
> http://localhost:8080/JSPWiki/wiki/wiki/OneMinuteWiki

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-22) ShortURLConstructor broken

Posted by "Jürgen Weber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-22?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540592 ] 

Jürgen Weber commented on JSPWIKI-22:
-------------------------------------

No, the context path starts after the port.

And there should be no need for hostname or port to appear in any html source as browsers automatically prepend them.

> ShortURLConstructor broken
> --------------------------
>
>                 Key: JSPWIKI-22
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-22
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Core & storage
>    Affects Versions: 2.6.0
>         Environment: apache-tomcat-6.0.14, java 6, XP
>            Reporter: Jürgen Weber
>            Priority: Blocker
>             Fix For: 2.6.0
>
>
> Downloaded 2.5.149, unpacked with core pages, ran, fine.
> Changed jspwiki.urlConstructor to ShortURLConstructor.
> Now, navigation is broken: there is one wike element in the URL too much, also it seems the css cannot be found.
> http://localhost:8080/JSPWiki/wiki/wiki/OneMinuteWiki

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (JSPWIKI-22) ShortURLConstructor broken

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JSPWIKI-22?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Janne Jalkanen resolved JSPWIKI-22.
-----------------------------------

    Resolution: Invalid

> ShortURLConstructor broken
> --------------------------
>
>                 Key: JSPWIKI-22
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-22
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Core & storage
>    Affects Versions: 2.6.0
>         Environment: apache-tomcat-6.0.14, java 6, XP
>            Reporter: Jürgen Weber
>            Priority: Blocker
>             Fix For: 2.6.0
>
>
> Downloaded 2.5.149, unpacked with core pages, ran, fine.
> Changed jspwiki.urlConstructor to ShortURLConstructor.
> Now, navigation is broken: there is one wike element in the URL too much, also it seems the css cannot be found.
> http://localhost:8080/JSPWiki/wiki/wiki/OneMinuteWiki

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-22) ShortURLConstructor broken

Posted by "Jürgen Weber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-22?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540289 ] 

Jürgen Weber commented on JSPWIKI-22:
-------------------------------------

No, does not work either.

Seems if you keep clicking RecentChanges the wiki count grows: http://localhost:8080/JSPWiki/wiki/wiki/wiki/wiki/wiki/wiki/RecentChanges

Pity, as I'd rather give away an url like http://localhost:8080/JSPWiki/wiki/OneMinuteWiki

Still better were http://localhost:8080/JSPWiki/OneMinuteWiki
but then you'd need a / servlet-mapping and handle all filetypes yourself.

> ShortURLConstructor broken
> --------------------------
>
>                 Key: JSPWIKI-22
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-22
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Core & storage
>    Affects Versions: 2.6.0
>         Environment: apache-tomcat-6.0.14, java 6, XP
>            Reporter: Jürgen Weber
>            Priority: Blocker
>             Fix For: 2.6.0
>
>
> Downloaded 2.5.149, unpacked with core pages, ran, fine.
> Changed jspwiki.urlConstructor to ShortURLConstructor.
> Now, navigation is broken: there is one wike element in the URL too much, also it seems the css cannot be found.
> http://localhost:8080/JSPWiki/wiki/wiki/OneMinuteWiki

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-22) ShortURLConstructor broken

Posted by "Jürgen Weber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-22?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540564 ] 

Jürgen Weber commented on JSPWIKI-22:
-------------------------------------

Fine, both are working, ShortURLConstructor and ShortViewURLConstructor.

But in the default jspwiki.properties in the #  URL Constructor there should be mention of that you need a jspwiki.baseURL

Also, the 

#  Example:
#  jspwiki.baseURL = http://www.jspwiki.org/

isn't very lucky, as it misses the context part.




> ShortURLConstructor broken
> --------------------------
>
>                 Key: JSPWIKI-22
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-22
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Core & storage
>    Affects Versions: 2.6.0
>         Environment: apache-tomcat-6.0.14, java 6, XP
>            Reporter: Jürgen Weber
>            Priority: Blocker
>             Fix For: 2.6.0
>
>
> Downloaded 2.5.149, unpacked with core pages, ran, fine.
> Changed jspwiki.urlConstructor to ShortURLConstructor.
> Now, navigation is broken: there is one wike element in the URL too much, also it seems the css cannot be found.
> http://localhost:8080/JSPWiki/wiki/wiki/OneMinuteWiki

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-22) ShortURLConstructor broken

Posted by "Jürgen Weber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-22?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540361 ] 

Jürgen Weber commented on JSPWIKI-22:
-------------------------------------

I only changed jspwiki.urlConstructor = ShortViewURLConstructor

> ShortURLConstructor broken
> --------------------------
>
>                 Key: JSPWIKI-22
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-22
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Core & storage
>    Affects Versions: 2.6.0
>         Environment: apache-tomcat-6.0.14, java 6, XP
>            Reporter: Jürgen Weber
>            Priority: Blocker
>             Fix For: 2.6.0
>
>
> Downloaded 2.5.149, unpacked with core pages, ran, fine.
> Changed jspwiki.urlConstructor to ShortURLConstructor.
> Now, navigation is broken: there is one wike element in the URL too much, also it seems the css cannot be found.
> http://localhost:8080/JSPWiki/wiki/wiki/OneMinuteWiki

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-22) ShortURLConstructor broken

Posted by "Chuck Smith (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-22?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12544813 ] 

Chuck Smith commented on JSPWIKI-22:
------------------------------------

A comment should really be added under URL Constructors that the jspwiki.baseURL, because I almost just posted this same bug until I realized what the problem was...

> ShortURLConstructor broken
> --------------------------
>
>                 Key: JSPWIKI-22
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-22
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Core & storage
>    Affects Versions: 2.6.0
>         Environment: apache-tomcat-6.0.14, java 6, XP
>            Reporter: Jürgen Weber
>            Priority: Blocker
>             Fix For: 2.6.0
>
>
> Downloaded 2.5.149, unpacked with core pages, ran, fine.
> Changed jspwiki.urlConstructor to ShortURLConstructor.
> Now, navigation is broken: there is one wike element in the URL too much, also it seems the css cannot be found.
> http://localhost:8080/JSPWiki/wiki/wiki/OneMinuteWiki

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-22) ShortURLConstructor broken

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-22?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540356 ] 

Janne Jalkanen commented on JSPWIKI-22:
---------------------------------------

Um.  Yes, it does work, as shown by sandbox.jspwiki.org and www.jspwiki.org.  Are you sure you didn't touch the configuration *at all*?

> ShortURLConstructor broken
> --------------------------
>
>                 Key: JSPWIKI-22
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-22
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Core & storage
>    Affects Versions: 2.6.0
>         Environment: apache-tomcat-6.0.14, java 6, XP
>            Reporter: Jürgen Weber
>            Priority: Blocker
>             Fix For: 2.6.0
>
>
> Downloaded 2.5.149, unpacked with core pages, ran, fine.
> Changed jspwiki.urlConstructor to ShortURLConstructor.
> Now, navigation is broken: there is one wike element in the URL too much, also it seems the css cannot be found.
> http://localhost:8080/JSPWiki/wiki/wiki/OneMinuteWiki

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-22) ShortURLConstructor broken

Posted by "Jürgen Weber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-22?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540576 ] 

Jürgen Weber commented on JSPWIKI-22:
-------------------------------------

As concerning baseURL determination, I think less necessary parameters the better. If you need an information in init() that you cannot get until the first doGet() do a lazy initialization in doGet().

Concerning the proxy argument for baseURL:

"RFC 1945 5.1.2 Request-URI

   The Request-URI is a Uniform Resource Identifier (Section 3.2) and
   identifies the resource upon which to apply the request."

So a proxy should not change the resource identification. In j2ee container, the part after the slash always denotes the context.

getServletPath() and getContextPath() must deliver baseURL, else the j2ee dispatching to web apps would not work.

A proxy should be transparent, so the web container should work regardless of being behind a proxy or not.
So, if a proxy or firewall or loadbalancer is not transparent, the work-around for this should not be a default, but rather a fix for only those needing it.



> ShortURLConstructor broken
> --------------------------
>
>                 Key: JSPWIKI-22
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-22
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Core & storage
>    Affects Versions: 2.6.0
>         Environment: apache-tomcat-6.0.14, java 6, XP
>            Reporter: Jürgen Weber
>            Priority: Blocker
>             Fix For: 2.6.0
>
>
> Downloaded 2.5.149, unpacked with core pages, ran, fine.
> Changed jspwiki.urlConstructor to ShortURLConstructor.
> Now, navigation is broken: there is one wike element in the URL too much, also it seems the css cannot be found.
> http://localhost:8080/JSPWiki/wiki/wiki/OneMinuteWiki

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-22) ShortURLConstructor broken

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-22?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540365 ] 

Janne Jalkanen commented on JSPWIKI-22:
---------------------------------------

You *do* have jspwiki.baseURL set, don't you?

> ShortURLConstructor broken
> --------------------------
>
>                 Key: JSPWIKI-22
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-22
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Core & storage
>    Affects Versions: 2.6.0
>         Environment: apache-tomcat-6.0.14, java 6, XP
>            Reporter: Jürgen Weber
>            Priority: Blocker
>             Fix For: 2.6.0
>
>
> Downloaded 2.5.149, unpacked with core pages, ran, fine.
> Changed jspwiki.urlConstructor to ShortURLConstructor.
> Now, navigation is broken: there is one wike element in the URL too much, also it seems the css cannot be found.
> http://localhost:8080/JSPWiki/wiki/wiki/OneMinuteWiki

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-22) ShortURLConstructor broken

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-22?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540581 ] 

Janne Jalkanen commented on JSPWIKI-22:
---------------------------------------

Nope.  Cannot do it lazily.  We need it before any GET requests to set up e.g. RSS generation (which creates a static file for performance reasons).

It used to be a fix for those who needed it (e.g. people with stunnel), but since then it's turned out to be too useful.  It's theoretically possible to rip it out, but I wouldn't start doing it now... We would need to change our entire URL generation schemes, RSS generation, and probably many, many other things as well.

What I mean my proxy is that the host name may change.  Or to be more probable, the port in which the app is running may be different.  For example, with basic forwarding the servlet container might think it's running in port 8080, but the outside world sees it in port 80.  The context path would therefore be wrong.  This is typical in quite a few apache setups which for some reason or another are not using mod_jk or mod_proxy.

> ShortURLConstructor broken
> --------------------------
>
>                 Key: JSPWIKI-22
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-22
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Core & storage
>    Affects Versions: 2.6.0
>         Environment: apache-tomcat-6.0.14, java 6, XP
>            Reporter: Jürgen Weber
>            Priority: Blocker
>             Fix For: 2.6.0
>
>
> Downloaded 2.5.149, unpacked with core pages, ran, fine.
> Changed jspwiki.urlConstructor to ShortURLConstructor.
> Now, navigation is broken: there is one wike element in the URL too much, also it seems the css cannot be found.
> http://localhost:8080/JSPWiki/wiki/wiki/OneMinuteWiki

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.