You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@click.apache.org by "Andrey Rybin (JIRA)" <ji...@apache.org> on 2010/02/17 20:08:27 UTC
[jira] Created: (CLK-629) ExternalLink unexpected href behavior
ExternalLink unexpected href behavior
-------------------------------------
Key: CLK-629
URL: https://issues.apache.org/jira/browse/CLK-629
Project: Click
Issue Type: Bug
Components: extras
Affects Versions: 2.1.0
Reporter: Andrey Rybin
Priority: Minor
All (most of) links in Click are "context-aware" ;-) i.e. /link will be converted to /servletcontextpath/link
but
ExternalLink is different.
It uses link (targetPath) "as is" without any modifications.
It is unexpected behavior.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CLK-629) ExternalLink unexpected href behavior
Posted by "Andrey Rybin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CLK-629?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12834974#action_12834974 ]
Andrey Rybin commented on CLK-629:
----------------------------------
>Finn Bock
>I wouldn't want any modification made to a targetPath like "http://www.google.com/". It should be used as href exactly as is.
Don't be afraid ;-)
What I mean:
===
http://click.apache.org/docs/user-guide/htmlsingle/click-book.html#redirect
"If the redirect location begins with a "/" character the redirect location will be prefixed with the web applications context path. For example if an application is deployed to the context "mycorp" calling setRedirect("/customer/details.htm") will redirect the request to: "/mycorp/customer/details.htm".
===
Same can apply to ExternalLink.
If target path == http://www.google.com/ or www.google.com/ or foobar then it will be used as is - without modifications.
But if target path starts with / then - it is of course on your server,
but usually wrong: http://myserver/target_path
instead of (right): http://myserver/servletcontextpath/target_path
You don't know usually servletcontextpath in your webApp (you should call getContextPath()) and i think you rarely need something in others webapps.
> ExternalLink unexpected href behavior
> -------------------------------------
>
> Key: CLK-629
> URL: https://issues.apache.org/jira/browse/CLK-629
> Project: Click
> Issue Type: Bug
> Components: extras
> Affects Versions: 2.1.0
> Reporter: Andrey Rybin
> Priority: Minor
>
> All (most of) links in Click are "context-aware" ;-) i.e. /link will be converted to /servletcontextpath/link
> but
> ExternalLink is different.
> It uses link (targetPath) "as is" without any modifications.
> It is unexpected behavior.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CLK-629) ExternalLink unexpected href behavior
Posted by "Andrey Rybin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CLK-629?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12834941#action_12834941 ]
Andrey Rybin commented on CLK-629:
----------------------------------
And also ExternalLink doesn't have handy constructor:
public ExternalLink(String name, String targetPath, String label)
It looks just like mistake.
> ExternalLink unexpected href behavior
> -------------------------------------
>
> Key: CLK-629
> URL: https://issues.apache.org/jira/browse/CLK-629
> Project: Click
> Issue Type: Bug
> Components: extras
> Affects Versions: 2.1.0
> Reporter: Andrey Rybin
> Priority: Minor
>
> All (most of) links in Click are "context-aware" ;-) i.e. /link will be converted to /servletcontextpath/link
> but
> ExternalLink is different.
> It uses link (targetPath) "as is" without any modifications.
> It is unexpected behavior.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (CLK-629) ExternalLink unexpected href behavior
Posted by "Adrian A. (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CLK-629?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Adrian A. updated CLK-629:
--------------------------
Issue Type: Sub-task (was: Bug)
Parent: CLK-543
> ExternalLink unexpected href behavior
> -------------------------------------
>
> Key: CLK-629
> URL: https://issues.apache.org/jira/browse/CLK-629
> Project: Click
> Issue Type: Sub-task
> Components: extras
> Affects Versions: 2.1.0
> Reporter: Andrey Rybin
> Priority: Minor
>
> All (most of) links in Click are "context-aware" ;-) i.e. /link will be converted to /servletcontextpath/link
> but
> ExternalLink is different.
> It uses link (targetPath) "as is" without any modifications.
> It is unexpected behavior.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CLK-629) ExternalLink unexpected href behavior
Posted by "Malcolm Edgar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CLK-629?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12834963#action_12834963 ]
Malcolm Edgar commented on CLK-629:
-----------------------------------
+1 on another constructor
> ExternalLink unexpected href behavior
> -------------------------------------
>
> Key: CLK-629
> URL: https://issues.apache.org/jira/browse/CLK-629
> Project: Click
> Issue Type: Bug
> Components: extras
> Affects Versions: 2.1.0
> Reporter: Andrey Rybin
> Priority: Minor
>
> All (most of) links in Click are "context-aware" ;-) i.e. /link will be converted to /servletcontextpath/link
> but
> ExternalLink is different.
> It uses link (targetPath) "as is" without any modifications.
> It is unexpected behavior.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CLK-629) ExternalLink unexpected href behavior
Posted by "Finn Bock (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CLK-629?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12834952#action_12834952 ]
Finn Bock commented on CLK-629:
-------------------------------
I wouldn't want any modification made to a targetPath like "http://www.google.com/". It should be used as href exactly as is.
Regarding the missing constructor, I agree. The 2 most common pieces of information on a ExternalLink is the href and the label so it would be nice to a constructor for that.
IMO the only surprising thing about ExternalLink is its location in the extras package.
> ExternalLink unexpected href behavior
> -------------------------------------
>
> Key: CLK-629
> URL: https://issues.apache.org/jira/browse/CLK-629
> Project: Click
> Issue Type: Bug
> Components: extras
> Affects Versions: 2.1.0
> Reporter: Andrey Rybin
> Priority: Minor
>
> All (most of) links in Click are "context-aware" ;-) i.e. /link will be converted to /servletcontextpath/link
> but
> ExternalLink is different.
> It uses link (targetPath) "as is" without any modifications.
> It is unexpected behavior.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.