0

I am using Weblogic 12c to deploy my springboot application. I am trying to introduce path variables from web.xml into weblogic.xml so that I will only have to modify one file [web.xml] rather than two files [web.xml, weblogic.xml] when deploying to different environments [ie. Windows, Linux].

web.xml

<!-- For virtual directory mapping -->
<env-entry>
    <env-entry-name>local_path</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>C:\</env-entry-value>
    <!--<env-entry-value>/</env-entry-value>-->
</env-entry>

<env-entry>
    <env-entry-name>url_pattern</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>test/*</env-entry-value>
    <!--<env-entry-value>test/</env-entry-value>-->
</env-entry>

weblogic.xml

<virtual-directory-mapping>
    <local-path>${local_path}</local-path>
    <url-pattern>${url_pattern}</url-pattern>
</virtual-directory-mapping>

However, this is not working. How should this be done?

Kirtana D
  • 3
  • 3
  • This kind of feature does not exist in WebLogic but you can use a [deployment plan](https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/wls/12c/09-DeployPlan--4464/deployplan.htm) to achieve your goal. The value will be set one time in the plan and the plan will be able to update both deployment descriptors. – Emmanuel Collin Oct 25 '19 at 07:47
  • Thanks for the suggestion, I will give that a go. – Kirtana D Oct 25 '19 at 20:45

0 Answers0