Provided a fix for this issue: https://github.com/wso2/product-is/pull/1303.
Please review and merge.

On Sun, Aug 13, 2017 at 1:33 AM, Harsha Kumara <[email protected]> wrote:

> Created JIRA in [1] in a case of we going to add it.
>
>  https://wso2.org/jira/browse/IDENTITY-6257
>
> On Sun, Aug 13, 2017 at 1:31 AM, Harsha Kumara <[email protected]> wrote:
>
>> Hi All,
>>
>> I tried to deploy multiple travelocity applications samples by renaming
>> the web application directory. But it didn't work. The reason for this
>> behavior is in code level we check the web application context path
>> contains travelocity.com. So if I renamed the web application to
>> travelovitysample.com, it won't work as the initial travelocity.property
>> configuration not getting loaded. I think it's better to add this.
>>
>> Code :
>>
>> if(servletContextEvent.getServletContext().getContextPath().contains("travelocity.com"))
>>  {
>>     properties.load(servletContextEvent.getServletContext().
>>             getResourceAsStream("/WEB-INF/classes/travelocity.properties"));
>> } else 
>> if(servletContextEvent.getServletContext().getContextPath().contains("avis.com"))
>>  {
>>     properties.load(servletContextEvent.getServletContext().
>>             getResourceAsStream("/WEB-INF/classes/avis.properties"));
>> }
>>
>> Then I have added an else statement which will switch to
>> travelocity.properties file in its own web application path.
>>
>> if(servletContextEvent.getServletContext().getContextPath().contains("travelocity.com"))
>>  {
>>     properties.load(servletContextEvent.getServletContext().
>>             getResourceAsStream("/WEB-INF/classes/travelocity.properties"));
>> } else 
>> if(servletContextEvent.getServletContext().getContextPath().contains("avis.com"))
>>  {
>>     properties.load(servletContextEvent.getServletContext().
>>             getResourceAsStream("/WEB-INF/classes/avis.properties"));
>> } else {
>>     try {
>>         properties.load(servletContextEvent.getServletContext().
>>                 
>> getResourceAsStream("/WEB-INF/classes/travelocity.properties"));
>>     } catch (Exception e) {
>>         LOGGER.log(Level.SEVERE, "Error while loading the default 
>> configuration in /WEB-INF/classes/travelocity.properties", e);
>>     }
>> }
>>
>> Thanks,
>> Harsha
>> --
>> Harsha Kumara
>> Software Engineer, WSO2 Inc.
>> Mobile: +94775505618 <+94%2077%20550%205618>
>> Blog:harshcreationz.blogspot.com
>>
>
>
>
> --
> Harsha Kumara
> Software Engineer, WSO2 Inc.
> Mobile: +94775505618 <+94%2077%20550%205618>
> Blog:harshcreationz.blogspot.com
>



-- 
Thanks & Regards,

*Johann Dilantha Nallathamby*
Senior Lead Solutions Engineer
WSO2, Inc.
lean.enterprise.middleware

Mobile - *+94777776950*
Blog - *http://nallaa.wordpress.com <http://nallaa.wordpress.com>*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to