JSP Basics - calling Java inside of JSP's


/ Published in: Java
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <% out.println(new java.util.Date()); %> // Scriptlet Syntax
  2.  
  3.  
  4. <%= new java.util.Date() %> // Expression element syntax
  5.  
  6. // Declaration element syntax
  7. // Purpose is to initialize variables and methods and make them available to other Declarations, Scriptlets, and Expressions
  8. <%! public java.util.Date PrintDate()
  9. {
  10. return(new java.util.Date());
  11. }
  12. %>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.