File: jsp

package info (click to toggle)
ruby-rouge 4.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,836 kB
  • sloc: ruby: 38,168; sed: 2,071; perl: 152; makefile: 8
file content (142 lines) | stat: -rw-r--r-- 4,180 bytes parent folder | download | duplicates (3)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<%@ taglib uri="uri" prefix="prefixOfTag" %>
<%@taglib prefix="c" uri="uri"%>
<%@ page isELIgnored = "false" %>

 <%-- This is 
 a 
 multiline
 comment
  --%> 

<html>
   <head><title>Hello World</title></head>
   <c:set var="realm" value='<%=AppConfig.getRealm().name()%>' />
   
   <body>
      Hello World!<br/>

    <script type="text/javascript">
        <c:if test="${includeJS}">
            alert("hello!");
            var country = "argentina";
        </c:if>
        <jsp:scriptlet>
             out.println("Your IP address is " + request.getRemoteAddr());
        </jsp:scriptlet>
    </script>

    <style>
        .timer {position:relative; height:8px; margin-bottom:2px; font-size:1px;}
        <c:if test="${includeJS}">
            .timer2 {position:absolute;}
        </c:if>
    </style>

    <div class="nav-link" style="display:<%=isAdmin ? "inline" : "none" %>">
    </div>

    <a href="/search?q=<c:out value="${query}"/>&h_pageNumber=1&h_pageSize=10">
        A link!
    </a>

    <select name="role" <c:if test="${isAdmin}">disabled="disabled"</c:if>>
        <option value="User" <c:if test="${user.role eq 'ENTITY_USER'}">selected="selected"</c:if>></option>
    </select>

<%-- Interpolations --%> 

    <input type="${'hidden'}" id="sampleCertificate" value="<c:out value ="${sampleCertificate}"/>" />

    <c:text>
        ${myViewModel.myProperty}
    </c:text>

<%-- Scriptlets --%> 

      <%
         out.println("Your IP address is " + request.getRemoteAddr());
      %>
        <jsp:scriptlet>
             out.println("Your IP address is " + request.getRemoteAddr());
        </jsp:scriptlet>

<%-- Declarations --%> 

    <%! int i=0; %> 
    <%! int a, b, c; %> 
    <%! Circle a=new Circle(2.0); %> 

    <jsp:declaration>
        Rectangle r=new Rectangle(2.0);
    </jsp:declaration>

<%-- Expressions --%>

    <p>Today's date: <%= (new java.util.Date()).toLocaleString()%></p>

        <jsp:expression>
            (new java.util.Date()).toLocaleString();
        </jsp:expression>

<%-- Directives --%>

            <%@ page attribute="value" %>
            <jsp:directive.page attribute="value" />
            <%@ include file="relative url" %>
            <jsp:directive.include file="relative url" />
            <%@ taglib uri="uri" prefix="prefixOfTag" %>
            <jsp:directive.taglib uri="uri" prefix="prefixOfTag" />

<%-- Actions --%>    

            <jsp:include page="relative URL" flush="true" />
            <jsp:useBean id="name" class="package.class" />
            <jsp:useBean id="myName" class="package.class"  >
            <jsp:setProperty name="myName" property="someProperty" />
            </jsp:useBean>
            <jsp:getProperty name="myName" property="someProperty" />
            <jsp:forward page="date.jsp" />
            <jsp:plugin type="applet" codebase="dirname" code="MyApplet.class"
            width="60" height="80">
            <jsp:param name="fontcolor" value="red" />
            <jsp:param name="background" value="black" />
            
            <jsp:fallback>
                Unable to initialize Java Plugin
            </jsp:fallback>
            
            </jsp:plugin>
            <jsp:element name="xmlElement">
                <jsp:attribute name="xmlElementAttr">
                    Value for the attribute
                </jsp:attribute>
                
                <jsp:body>
                    Body for XML element
                </jsp:body>

            </jsp:element>
            <jsp:text>Template data</jsp:text>

<%-- Using tag libraries --%>

        <c:set var="nameofvariable" value="10"/>
        <c:if test="nameofvariable == 10">
            <p>Condition is true!</p>
            <input name="pswd" type="password" />
             <script type="text/javascript">
                    function callMe() {
                        return 42;
                    }
            </script>
            <jsp:scriptlet>
                out.println("Your IP address is " + request.getRemoteAddr());
            </jsp:scriptlet>
        </c:if>
        <c:otherwise>
            <p>Boo! Condition is false!</p>
        </c:otherwise>


   </body>
</html>