File: jsp

package info (click to toggle)
ruby-rouge 4.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,844 kB
  • sloc: ruby: 38,489; sed: 2,071; perl: 152; makefile: 8
file content (29 lines) | stat: -rw-r--r-- 820 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.time.LocalDateTime" %>

<%! int day = 3; %> 

<!DOCTYPE html>
<html>
	<head>
		<title>Simple JSP Application</title>
	</head>
	<body>
        <%-- This is a JSP comment --%>
		<h1>Hello world!</h1>
		<h2>Current time is <%= LocalDateTime.now() %></h2>

        <% if (day == 1 || day == 7) { %>
            <p> Today is weekend</p>
        <% } else { %>
            <p> Today is not weekend</p>
        <% } %>

        h2>Using JavaBeans in JSP</h2>
        <jsp:useBean id="test" class="action.TestBean" />
        <jsp:setProperty name="test"  property="message"  value="Hello JSP..." />
        
        <p>Got message:</p>
        <jsp:getProperty name="test" property="message" />
	</body>
</html>