Welcome to Dream.In.Code
Become a Java Expert!

Join 150,188 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 2,062 people online right now. Registration is fast and FREE... Join Now!




jsp help

 
Reply to this topicStart new topic

jsp help

IMU
12 Sep, 2008 - 01:01 AM
Post #1

New D.I.C Head
*

Joined: 7 Aug, 2008
Posts: 38

hi guys..new to jsp so need help..here is the code
CODE
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>

    <h1>JSP Page</h1>
    <%
  
    System.out.println( "Evaluating date now" );
    java.util.Date date = new java.util.Date();
    System.out.println("Evaluation of system properties");
    
    %>
Hello <%=date %>
properties<%=new System.getProperty();%>

    <%--
    This example uses JSTL, uncomment the taglib directive above.
    To test, display the page like this: index.jsp?sayHello=true&name=Murphy
    --%>
    <%--
    <c:if test="${param.sayHello}">
        <!-- Let's welcome the user ${param.name} -->
        Hello ${param.name}!
    </c:if>
    --%>
    
    </body>
</html>

i need the output to display system properties such as java.version, java.home, OS.name, user.name, user.home, user.dir etc.

please help me..

User is offlineProfile CardPM
+Quote Post

lordms12
RE: Jsp Help
12 Sep, 2008 - 05:03 AM
Post #2

D.I.C Regular
Group Icon

Joined: 16 Feb, 2008
Posts: 322



Thanked: 17 times
Dream Kudos: 225
My Contributions
Here is an example in JAVA
java
import java.util.Properties;

public class PropertiesTest {
public static void main(String[] args) throws Exception {
Properties p = new Properties(System.getProperties());
System.out.println(p.getProperty("file.separator"));
System.out.println(p.getProperty("java.class.path"));
System.out.println(p.getProperty("java.home"));
System.out.println(p.getProperty("java.vendor"));
System.out.println(p.getProperty("java.vendor.url"));
System.out.println(p.getProperty("java.version"));
System.out.println(p.getProperty("line.separator"));
System.out.println(p.getProperty("os.arch"));
System.out.println(p.getProperty("os.name"));
System.out.println(p.getProperty("os.version"));
System.out.println(p.getProperty("path.separator"));
System.out.println(p.getProperty("user.dir"));
System.out.println(p.getProperty("user.home"));
System.out.println(p.getProperty("user.name"));

//OR
// System.getProperties().list(System.out);
}
}

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 04:09AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month