1

I have spring boot application and I want to run it in weblogic.But I have someproperties when I execute spring with jar no problem.Also I can put these properties in application.properties and turn our package to war file.But when we deploy in weblogic ,it doesnt see this parameters in application properties.

 String myvalue = System.getProperty("server.servlet.contextPath"); //doesnt work in code in weblogic

How can we pass our system properties to web logic

1 Answer 1

1

Your property is a system property, so it must be set in the java command line :

java -Dserver.servlet.contextPath="..."

or directly in your application code :

System.setProperty("server.servlet.contextPath","...");
Sign up to request clarification or add additional context in comments.

2 Comments

also I dont want to add code for that reason I added application.prop but doesnt work,I can pass it for command line but I specially asked for correct way to pass these parameter in weblogic jboss
For WebLogic, the correct way is to set the system property as a jvm property (-Dserver.servlet.contextPath="...") If you want to read this property from the application.prop file you will have to change your code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.