Skip to content

Environmental Variable for Proxy URL #15

Open
@gaoagong

Description

@gaoagong

I'm loving your ProxyServlet except for one thing. Since the URL that the servlet is proxying to is set in the web.xml file, I am not able to modify it and set it more dynamically. My specific case is that I want to be able to hit a different URL given the environment (Dev, Testing, Prod). I have yet to find an elegant way to dynamically load the URL on startup using a property file that is environment specific. Is there an easy way to do this that I have overlooked?

I looked into servlet filters, maven like tokens in the web.xml, and even extending your servlet class to use spring to inject the URL value in from a property file. The best solution I can think of is to copy your code and manipulate it to not use the initParams, but instead use a spring injected property. My case does not need to change the URL once it is loaded, but I want to be able to have an environment specific value without packaging a separate build for the Testing and Prod environments.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions