This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Very Simple JSP problem  RSS feed

 
And Green
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just started learning about JSP. I have been given a an embedded JSP expression:

<HTML>
<BODY>
Hello! The time is now <%= new java.util.Date() %>
</BODY>
</HTML>

Which correctly displays the current date,

and using this structure, have been asked to write a JSP to output the values returned by System.getProperty for various system properties such as java.version, java.home, os.name, user.name, user.home, user.dir

I can't for the life of me figure out the correct syntax from the Java API's to get any result from System.getProperty java.version for example.

I imagine this is pretty straightforward and am suitably embarassed. Any help most appreciated.
 
Jesus Angeles
Ranch Hand
Posts: 2070
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by And Green:
Just started learning about JSP. I have been given a an embedded JSP expression:

<HTML>
<BODY>
Hello! The time is now <%= new java.util.Date() %>
</BODY>
</HTML>

Which correctly displays the current date,

and using this structure, have been asked to write a JSP to output the values returned by System.getProperty for various system properties such as java.version, java.home, os.name, user.name, user.home, user.dir

I can't for the life of me figure out the correct syntax from the Java API's to get any result from System.getProperty java.version for example.

I imagine this is pretty straightforward and am suitably embarassed. Any help most appreciated.


Once you use the

you merely put in between them, the data you want displayed.

For



you can put

 
And Green
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your time mate. Hope that good deed is repaid to you in some way today!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!