tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kalle Korhonen (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (TAP5-1414) Add HOSTNAME symbol to SymbolConstants, use in BaseUrlSource
Date Wed, 09 Feb 2011 06:30:57 GMT

     [ https://issues.apache.org/jira/browse/TAP5-1414?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Kalle Korhonen resolved TAP5-1414.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 5.3.0

Fixed in r1068758 but somebody might want to review. It's a tiny issue but it's my first commit...

> Add HOSTNAME symbol to SymbolConstants, use in BaseUrlSource
> ------------------------------------------------------------
>
>                 Key: TAP5-1414
>                 URL: https://issues.apache.org/jira/browse/TAP5-1414
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.2.0, 5.2.1, 5.2.2, 5.2.3, 5.2.4, 5.1.0.0, 5.1.0.1, 5.1.0.2, 5.1.0.3,
5.1.0.4, 5.1.0.5, 5.1.0.6, 5.1.0.7, 5.0.15, 5.0.16, 5.0.17, 5.0.18, 5.0.19
>            Reporter: Kalle Korhonen
>            Assignee: Kalle Korhonen
>            Priority: Minor
>             Fix For: 5.3.0
>
>
> Given that it's such a common need to generate an absolute uri including the hostname
(to be used in email links, redirect urls for extenal apis, etc.) and there's no generic,
reliable way to deduce it on the fly, it'd make sense to reserve HOSTNAME symbol and contribute
some sensible default. For example:
> public static void contributeFactoryDefaults(MappedConfiguration<String, String>
configuration) { 
>   String hostname = null; 
>   try { hostname = System.getenv("HOSTNAME"); } 
>   catch (Exception e) { } 
>   if (hostname == null) hostname = InetAddress.getLocalHost().getHostName();
>   configuration.add(HostSymbols.HOSTNAME, hostname); 
> } 
> Might make sense that only if HOSTNAME == "", BaseUrlSource would use the hostname given
in the request, otherwise the contributed value.
> See the discussion thread on this: http://markmail.org/message/ad7aesumg6nvsvx3

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message