You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jspwiki.apache.org by "Florian Holeczek (JIRA)" <ji...@apache.org> on 2009/08/20 10:54:14 UTC

[jira] Created: (JSPWIKI-590) way of integrating JavaScript libraries in default template

way of integrating JavaScript libraries in default template
-----------------------------------------------------------

                 Key: JSPWIKI-590
                 URL: https://issues.apache.org/jira/browse/JSPWIKI-590
             Project: JSPWiki
          Issue Type: Bug
          Components: Default template
    Affects Versions: 2.8.3
            Reporter: Florian Holeczek
            Priority: Minor


I've just configured JSPWiki to run on a Tomcat 6 behind an Apache 2.2 web server, connected via mod_proxy_ajp.
The client URL is https://wiki.somewhere.com/ and the real URL on Tomcat is ajp://my.intra.com:8009/my-context-path/

Everything is running fine, there's just one little problem left:
On the Edit page, two JavaScript libraries can't be loaded because the browser is searching for them under /my-context-path/scripts/xyz.js instead of /scripts/xyz.js:

<script type='text/javascript' src='/my-context-path/scripts/jspwiki-edit.js'></script>
<script type='text/javascript' src='/my-context-path/scripts/posteditor.js'></script>

This is because of the following lines in templates/default/editors/plain.jsp:

TemplateManager.addResourceRequest( context, "script",  contextPath + "/scripts/jspwiki-edit.js" );
TemplateManager.addResourceRequest( context, "script",  contextPath + "/scripts/posteditor.js" );

Now I'm not sure whether this is a bug in JSPWiki or I have to configure anything more in Tomcat.
WDYT?

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


[jira] Updated: (JSPWIKI-590) way of integrating JavaScript libraries in default template

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

Florian Holeczek updated JSPWIKI-590:
-------------------------------------

    Attachment: JSPWIKI-590.patch

Harry,

yes, you got it right. So I tested getPathInfo(), but it's not the correct method for this case. It also returns null if there _is_ an effectively used context path. See my attached patch using relative paths. It works, however I don't know if there are any arguments against doing it this way, that's why I haven't committed it yet.

regards
 Florian

> way of integrating JavaScript libraries in default template
> -----------------------------------------------------------
>
>                 Key: JSPWIKI-590
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-590
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Default template
>    Affects Versions: 2.8.3
>            Reporter: Florian Holeczek
>            Priority: Minor
>         Attachments: JSPWIKI-590.patch
>
>
> I've just configured JSPWiki to run on a Tomcat 6 behind an Apache 2.2 web server, connected via mod_proxy_ajp.
> The client URL is https://wiki.somewhere.com/ and the real URL on Tomcat is ajp://my.intra.com:8009/my-context-path/
> Everything is running fine, there's just one little problem left:
> On the Edit page, two JavaScript libraries can't be loaded because the browser is searching for them under /my-context-path/scripts/xyz.js instead of /scripts/xyz.js:
> <script type='text/javascript' src='/my-context-path/scripts/jspwiki-edit.js'></script>
> <script type='text/javascript' src='/my-context-path/scripts/posteditor.js'></script>
> This is because of the following lines in templates/default/editors/plain.jsp:
> TemplateManager.addResourceRequest( context, "script",  contextPath + "/scripts/jspwiki-edit.js" );
> TemplateManager.addResourceRequest( context, "script",  contextPath + "/scripts/posteditor.js" );
> Now I'm not sure whether this is a bug in JSPWiki or I have to configure anything more in Tomcat.
> WDYT?

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


[jira] Resolved: (JSPWIKI-590) way of integrating JavaScript libraries in default template

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

Dirk Frederickx resolved JSPWIKI-590.
-------------------------------------

    Resolution: Fixed

Fixed on svn 2.8.3-svn-14, using relative paths on javascript libs.
Suggest to open another jira issue, in case other url-resolution problems occur related to this issues of 'external url rewriting'.

dirk

> way of integrating JavaScript libraries in default template
> -----------------------------------------------------------
>
>                 Key: JSPWIKI-590
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-590
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Default template
>    Affects Versions: 2.8.3
>            Reporter: Florian Holeczek
>            Priority: Minor
>         Attachments: JSPWIKI-590.patch
>
>
> I've just configured JSPWiki to run on a Tomcat 6 behind an Apache 2.2 web server, connected via mod_proxy_ajp.
> The client URL is https://wiki.somewhere.com/ and the real URL on Tomcat is ajp://my.intra.com:8009/my-context-path/
> Everything is running fine, there's just one little problem left:
> On the Edit page, two JavaScript libraries can't be loaded because the browser is searching for them under /my-context-path/scripts/xyz.js instead of /scripts/xyz.js:
> <script type='text/javascript' src='/my-context-path/scripts/jspwiki-edit.js'></script>
> <script type='text/javascript' src='/my-context-path/scripts/posteditor.js'></script>
> This is because of the following lines in templates/default/editors/plain.jsp:
> TemplateManager.addResourceRequest( context, "script",  contextPath + "/scripts/jspwiki-edit.js" );
> TemplateManager.addResourceRequest( context, "script",  contextPath + "/scripts/posteditor.js" );
> Now I'm not sure whether this is a bug in JSPWiki or I have to configure anything more in Tomcat.
> WDYT?

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


[jira] Commented: (JSPWIKI-590) way of integrating JavaScript libraries in default template

Posted by "Dirk Frederickx (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12746024#action_12746024 ] 

Dirk Frederickx commented on JSPWIKI-590:
-----------------------------------------

Florian,

Your patch seems to work ok, but I'm not sure it works in all types of configurations.

Normally, I would expect relative paths to work ok. However it is a bit funny in this case, cause the path is relative to the root of the web-app, and not relative to the path of the plain.jsp ;-)


Note: the other jsp's  refering to "TemplateManager.addResourceRequest" are already using a relative paths. (FCK.jsp, UserPreferences.jsp)



dirk

> way of integrating JavaScript libraries in default template
> -----------------------------------------------------------
>
>                 Key: JSPWIKI-590
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-590
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Default template
>    Affects Versions: 2.8.3
>            Reporter: Florian Holeczek
>            Priority: Minor
>         Attachments: JSPWIKI-590.patch
>
>
> I've just configured JSPWiki to run on a Tomcat 6 behind an Apache 2.2 web server, connected via mod_proxy_ajp.
> The client URL is https://wiki.somewhere.com/ and the real URL on Tomcat is ajp://my.intra.com:8009/my-context-path/
> Everything is running fine, there's just one little problem left:
> On the Edit page, two JavaScript libraries can't be loaded because the browser is searching for them under /my-context-path/scripts/xyz.js instead of /scripts/xyz.js:
> <script type='text/javascript' src='/my-context-path/scripts/jspwiki-edit.js'></script>
> <script type='text/javascript' src='/my-context-path/scripts/posteditor.js'></script>
> This is because of the following lines in templates/default/editors/plain.jsp:
> TemplateManager.addResourceRequest( context, "script",  contextPath + "/scripts/jspwiki-edit.js" );
> TemplateManager.addResourceRequest( context, "script",  contextPath + "/scripts/posteditor.js" );
> Now I'm not sure whether this is a bug in JSPWiki or I have to configure anything more in Tomcat.
> WDYT?

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


[jira] Commented: (JSPWIKI-590) way of integrating JavaScript libraries in default template

Posted by "Harry Metske (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12745875#action_12745875 ] 

Harry Metske commented on JSPWIKI-590:
--------------------------------------

sorry cut/paste typo, my last line should say:

see: http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServletRequest.html#getPathInfo()

> way of integrating JavaScript libraries in default template
> -----------------------------------------------------------
>
>                 Key: JSPWIKI-590
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-590
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Default template
>    Affects Versions: 2.8.3
>            Reporter: Florian Holeczek
>            Priority: Minor
>
> I've just configured JSPWiki to run on a Tomcat 6 behind an Apache 2.2 web server, connected via mod_proxy_ajp.
> The client URL is https://wiki.somewhere.com/ and the real URL on Tomcat is ajp://my.intra.com:8009/my-context-path/
> Everything is running fine, there's just one little problem left:
> On the Edit page, two JavaScript libraries can't be loaded because the browser is searching for them under /my-context-path/scripts/xyz.js instead of /scripts/xyz.js:
> <script type='text/javascript' src='/my-context-path/scripts/jspwiki-edit.js'></script>
> <script type='text/javascript' src='/my-context-path/scripts/posteditor.js'></script>
> This is because of the following lines in templates/default/editors/plain.jsp:
> TemplateManager.addResourceRequest( context, "script",  contextPath + "/scripts/jspwiki-edit.js" );
> TemplateManager.addResourceRequest( context, "script",  contextPath + "/scripts/posteditor.js" );
> Now I'm not sure whether this is a bug in JSPWiki or I have to configure anything more in Tomcat.
> WDYT?

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


[jira] Commented: (JSPWIKI-590) way of integrating JavaScript libraries in default template

Posted by "Florian Holeczek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12746070#action_12746070 ] 

Florian Holeczek commented on JSPWIKI-590:
------------------------------------------

Seems as if the problem is more general: When logging out, Logout.jsp also seems to redirect to an URL with ContextPath.
My thoughts:
In server.xml, you can define proxyName and proxyPort for a connector, so that a Java webapp gets aware of the first parts of its "real URL" via getServerName() and so on.
This way, I think web.xml should provide an analogue property proxyPath for configuring the application path part of the "real URL". But AFAIK there is no such functionality. Does anyone know about the opposite, or maybe can tell whether this is just crazy talk?


> way of integrating JavaScript libraries in default template
> -----------------------------------------------------------
>
>                 Key: JSPWIKI-590
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-590
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Default template
>    Affects Versions: 2.8.3
>            Reporter: Florian Holeczek
>            Priority: Minor
>         Attachments: JSPWIKI-590.patch
>
>
> I've just configured JSPWiki to run on a Tomcat 6 behind an Apache 2.2 web server, connected via mod_proxy_ajp.
> The client URL is https://wiki.somewhere.com/ and the real URL on Tomcat is ajp://my.intra.com:8009/my-context-path/
> Everything is running fine, there's just one little problem left:
> On the Edit page, two JavaScript libraries can't be loaded because the browser is searching for them under /my-context-path/scripts/xyz.js instead of /scripts/xyz.js:
> <script type='text/javascript' src='/my-context-path/scripts/jspwiki-edit.js'></script>
> <script type='text/javascript' src='/my-context-path/scripts/posteditor.js'></script>
> This is because of the following lines in templates/default/editors/plain.jsp:
> TemplateManager.addResourceRequest( context, "script",  contextPath + "/scripts/jspwiki-edit.js" );
> TemplateManager.addResourceRequest( context, "script",  contextPath + "/scripts/posteditor.js" );
> Now I'm not sure whether this is a bug in JSPWiki or I have to configure anything more in Tomcat.
> WDYT?

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


[jira] Updated: (JSPWIKI-590) way of integrating JavaScript libraries in default template

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

Dirk Frederickx updated JSPWIKI-590:
------------------------------------

    Fix Version/s: 2.8.3

> way of integrating JavaScript libraries in default template
> -----------------------------------------------------------
>
>                 Key: JSPWIKI-590
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-590
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Default template
>    Affects Versions: 2.8.3
>            Reporter: Florian Holeczek
>            Priority: Minor
>             Fix For: 2.8.3
>
>         Attachments: JSPWIKI-590.patch
>
>
> I've just configured JSPWiki to run on a Tomcat 6 behind an Apache 2.2 web server, connected via mod_proxy_ajp.
> The client URL is https://wiki.somewhere.com/ and the real URL on Tomcat is ajp://my.intra.com:8009/my-context-path/
> Everything is running fine, there's just one little problem left:
> On the Edit page, two JavaScript libraries can't be loaded because the browser is searching for them under /my-context-path/scripts/xyz.js instead of /scripts/xyz.js:
> <script type='text/javascript' src='/my-context-path/scripts/jspwiki-edit.js'></script>
> <script type='text/javascript' src='/my-context-path/scripts/posteditor.js'></script>
> This is because of the following lines in templates/default/editors/plain.jsp:
> TemplateManager.addResourceRequest( context, "script",  contextPath + "/scripts/jspwiki-edit.js" );
> TemplateManager.addResourceRequest( context, "script",  contextPath + "/scripts/posteditor.js" );
> Now I'm not sure whether this is a bug in JSPWiki or I have to configure anything more in Tomcat.
> WDYT?

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


[jira] Commented: (JSPWIKI-590) way of integrating JavaScript libraries in default template

Posted by "Dirk Frederickx (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12746437#action_12746437 ] 

Dirk Frederickx commented on JSPWIKI-590:
-----------------------------------------


Florian,

I think I now start to understand your problem.
You try to use a different URL vs. the tomcat installation path ?

As long as tomcat doesn't know the URL, the only way to resolve this issues is to use relative paths, I assume.


I couldn't trace any use of ContextPath in the Logout.jsp.  Can you describe this issue ?

dirk

(note: FCK.jsp is still using the ContextPath; need to resolve that one too)



> way of integrating JavaScript libraries in default template
> -----------------------------------------------------------
>
>                 Key: JSPWIKI-590
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-590
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Default template
>    Affects Versions: 2.8.3
>            Reporter: Florian Holeczek
>            Priority: Minor
>         Attachments: JSPWIKI-590.patch
>
>
> I've just configured JSPWiki to run on a Tomcat 6 behind an Apache 2.2 web server, connected via mod_proxy_ajp.
> The client URL is https://wiki.somewhere.com/ and the real URL on Tomcat is ajp://my.intra.com:8009/my-context-path/
> Everything is running fine, there's just one little problem left:
> On the Edit page, two JavaScript libraries can't be loaded because the browser is searching for them under /my-context-path/scripts/xyz.js instead of /scripts/xyz.js:
> <script type='text/javascript' src='/my-context-path/scripts/jspwiki-edit.js'></script>
> <script type='text/javascript' src='/my-context-path/scripts/posteditor.js'></script>
> This is because of the following lines in templates/default/editors/plain.jsp:
> TemplateManager.addResourceRequest( context, "script",  contextPath + "/scripts/jspwiki-edit.js" );
> TemplateManager.addResourceRequest( context, "script",  contextPath + "/scripts/posteditor.js" );
> Now I'm not sure whether this is a bug in JSPWiki or I have to configure anything more in Tomcat.
> WDYT?

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


[jira] Commented: (JSPWIKI-590) way of integrating JavaScript libraries in default template

Posted by "Harry Metske (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12745873#action_12745873 ] 

Harry Metske commented on JSPWIKI-590:
--------------------------------------

So, if I understand your situation correctly :

* your JSPWiki baseURL is https://wiki.somewhere.com/
* your apache's access logs show requests without /my-context-path

In that case, I think the plain.jsp should be changed : getContextPath() => getPathInfo() right ?

see: my-context-path: http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServletRequest.html#getPathInfo()

> way of integrating JavaScript libraries in default template
> -----------------------------------------------------------
>
>                 Key: JSPWIKI-590
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-590
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Default template
>    Affects Versions: 2.8.3
>            Reporter: Florian Holeczek
>            Priority: Minor
>
> I've just configured JSPWiki to run on a Tomcat 6 behind an Apache 2.2 web server, connected via mod_proxy_ajp.
> The client URL is https://wiki.somewhere.com/ and the real URL on Tomcat is ajp://my.intra.com:8009/my-context-path/
> Everything is running fine, there's just one little problem left:
> On the Edit page, two JavaScript libraries can't be loaded because the browser is searching for them under /my-context-path/scripts/xyz.js instead of /scripts/xyz.js:
> <script type='text/javascript' src='/my-context-path/scripts/jspwiki-edit.js'></script>
> <script type='text/javascript' src='/my-context-path/scripts/posteditor.js'></script>
> This is because of the following lines in templates/default/editors/plain.jsp:
> TemplateManager.addResourceRequest( context, "script",  contextPath + "/scripts/jspwiki-edit.js" );
> TemplateManager.addResourceRequest( context, "script",  contextPath + "/scripts/posteditor.js" );
> Now I'm not sure whether this is a bug in JSPWiki or I have to configure anything more in Tomcat.
> WDYT?

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