SystemProperties.jsp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <%@ page language="java" import="java.util.*,java.io.*" %>
  2. <%@ page contentType="text/html;charset=euc-kr" %>
  3. <%
  4. Properties props = System.getProperties(); // get list of properties
  5. /*FileOutputStream output = null;
  6. String file_separator = (String)(props.get("file.separator"));
  7. String current_dir = "";
  8. String Path = "";
  9. String Full_path = request.getRealPath(request.getServletPath());
  10. if (file_separator.equals("\\"))
  11. {
  12. current_dir = Full_path.substring(0,Full_path.lastIndexOf("\\")+1);
  13. Path = current_dir + "\\";
  14. }
  15. else
  16. {
  17. current_dir = Full_path.substring(0,Full_path.lastIndexOf("/")+1);
  18. Path = current_dir + "/";
  19. }
  20. */
  21. // START getprops
  22. try{
  23. //output = new FileOutputStream(new File(Path + "SystemProperties.txt"));
  24. // Print properties using Enumeration
  25. for (Enumeration enum1 = props.propertyNames(); enum1.hasMoreElements();) {
  26. String key = (String)enum1.nextElement();
  27. out.println(key + " = " + (String)(props.get(key)));
  28. out.println("<br>");
  29. //output.write(new String(key + " = " + (String)(props.get(key) + "\n")).getBytes());
  30. //output.flush();
  31. }
  32. }catch (IOException e){
  33. e.printStackTrace();
  34. out.println("<br>");
  35. } finally {
  36. try {
  37. out.println("<br>");
  38. } catch (IOException e) {
  39. // TODO Auto-generated catch block
  40. e.printStackTrace();
  41. out.println("<br>");
  42. }
  43. }
  44. %>