0

I am new to JSP and I am wondering if it is possible to get java runtime parameters from whithin a JSP file (display it on the web page). The thing I am looking for is the javaagent option, I want to show all the java agents that the enviorment is using.

On my linux machine I can write

ps -ax | grep java

and all the parameters are shown, and the java agent will be visible: -javaagent:/Path/Agent.jar

Is there any way to see the agent of the server?

Explanation: I am running my application on a web server, and I have a JSP page which runs on it, and I want to get the above parameters.

Edit2 : This is not a duplicate of the enviorment variable question since the javaagent doesnt appear in the enviorment variables, one way to add a java agent is via the JAVA_OPTS variable but its not the case here.

uraimo
  • 19,081
  • 8
  • 48
  • 55
antonpuz
  • 3,256
  • 4
  • 25
  • 48
  • `the distant server` --- huh? What? Why would you even want to retrieve such weird information? What has this to do with JSP? – specializt May 26 '15 at 11:18
  • @specializt hi, I edited the question with more information. – antonpuz May 26 '15 at 11:21
  • @Smutje please read edit2 in the question, the javaagent doesnt appear in the enviorment variables – antonpuz May 26 '15 at 11:29
  • yet again : **what has this to do with a `distant server`??** – specializt May 26 '15 at 11:31
  • @specializt I have changed it to server, it really doesnt matter if its local or not – antonpuz May 26 '15 at 11:34
  • that is a **big** difference, one is about retrieving JVM-parameters and the other is about transmitting them over the internet - its like comparing apples to space shuttles and claiming theres "no difference" – specializt May 26 '15 at 11:35
  • try checking this http://stackoverflow.com/questions/5234620/how-to-get-java-opts-value-in-jsp – Srinath Ganesh May 26 '15 at 11:36
  • I don't know if this works from within a jsp, but it's worth a try: http://stackoverflow.com/questions/13958318/is-it-possible-to-get-the-command-used-to-launch-the-jvm-in-java – StephaneM May 26 '15 at 11:36
  • @specializt I want to print the variable to the web page and show it as a web page content, I really dont see how this matters if I print it on my local server and if I print it on the distant server – antonpuz May 26 '15 at 11:37
  • i think you need to do some research about IT basics first ... especially the topic "client & server". Values on distant servers are different from the ones on your local instance. – specializt May 26 '15 at 11:43

0 Answers0