Skip to content

Instantly share code, notes, and snippets.

@raunakhajela
raunakhajela / scriplet-test.jsp
Last active January 11, 2018 06:57
JSP: Scriplets
<!--scriplets let us insert 1 to many lines of Java code. Scriplets make use of out.println() to print java code-->
<html>
<body>
<h3>Hello World</h3>
<%
for(int i=1; i<=5; i++){
out.println("</br>I really luv2code: " + i);
}
%>
</body>
@raunakhajela
raunakhajela / expressions.jsp
Created January 11, 2018 06:51
JSP: Expressions
<html>
<body>
Converting a string to uppercase: <%= new String("Hello World").toUpperCase() %>
<br><br>
25 x 4 = <%= 25*4 %>
<br><br>
Is 75 less than 69? <%= 75 < 69 %>
</body>
</html>
@raunakhajela
raunakhajela / helloworld.jsp
Created January 11, 2018 06:44
JSP: Hello World
<html>
<body>
<h3>Hello World</h3>
<p>The time on the server is <%= new java.util.Date() %></p>
</body>
</html>