File: test.jsp

package info (click to toggle)
web-mode 17.3.20-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,164 kB
  • sloc: lisp: 13,359; javascript: 506; jsp: 113; sh: 10; php: 9; makefile: 8; xml: 2
file content (121 lines) | stat: -rw-r--r-- 3,366 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

<%!
public int sum(int a, int b)
{
  return a + b;
}

private void doNothing(HttpServletResponse response) {}

%>

<%
doNothing(response);
%>

<html>
  <c:if>
    <p></p>
  </c:if>
</html>

<div>
  <% if (x) { %>
    <span><%= x %></span>
  <% } else { %>
    <span><%= x %></span>
  <% } %>
</div>

<c:set var="ageTotal" value="${0}" />
<c:forEach var="person"
           items="${personList}">
  <c:set var="ageTotal" value="${ageTotal + person.age}" />
  <tr><td>${person.name}</td><td>${person.age}</td></tr>
</c:forEach>
${ageTotal}

<%@ taglib prefix="f" uri="/your-tld-uri"%>
...
<c:out value="${f:sum(personList)}"/>

<%@ taglib uri="/you-taglib-uri" prefix="p" %>
and use the tag:

<c:forEach var="person" items="${personList}">
  <tr><td>${person.name}</td><td>${person.age}</td></tr>
</c:forEach>
<p:personSum personList="${personList}"/>

<%= toto %>

<p>test</p>

<span>
  <%
  if ( haveError ) {
    request.setAttribute( "error
xss",
      //todo : erreur d'indentation
      errors.toString());
    pageContext.forward( "GetName.jsp" );
  } else {
    pageContext.forward( "GetName.jsp" );
    pageContext.forward( "NextPage.jspx" );
  }
  %>
</span>

<div>
  <%@ page import="business.*, data.*" /*comment*/
           test="*indent attr*" %>
</div>

<div>cdc</div>

<%
// This is a scriptlet.  Notice that the "date"
// variable we declare here is available in the
// embedded expression later on.
int i = 0
System.out.println( "Evaluating date now" );
java.util.Date date = new java.util.Date();
%>

<span>
  <%!
  // declare here
  public void add(User user, String filename) throws IOException, ServletException {
    PrintWriter out = new PrintWriter(new FileWriter(filename, true));
    out.println("toto" + "titi" +
      "titi" +
      user.getLastName());
    out.close();
  }

  %>
</span>

<template:addResources>
  <script>
   angular.module('jahiaProperties', []).constant('JAHIA_PROPERTIES', {
     urlWsRecherche: "${currentNode.properties['webserviceRechercheOffre'].string}",
     urlWsDetail: "${currentNode.properties['webserviceDetailOffre'].string}",
     urlWsPanier: "${currentNode.properties['webservicePanierOffre'].string}",
     nbResultatsParPage: ${currentNode.properties['nbResultatsParPage'].string},
     nbRecherchesSauvegardees: ${currentNode.properties['nbRecherchesSauvegardees'].string},
     referencePageRechercheAvancee: "<c:url value='${url.base}${currentNode.properties.referencePageRechercheAvancee.node.path}.html'/>",
     referencePageListeOffres: "<c:url value='${url.base}${currentNode.properties.referencePageListeOffres.node.path}.html'/>",
     referencePageDetailOffre: "<c:url value='${url.base}${currentNode.properties.referencePageDetailOffre.node.path}.html'/>",
     referencePageGeolocalisation: "<c:url value='${url.base}${currentNode.properties.referencePageGeolocalisation.node.path}.html'/>",
     referencePageGeolocalisationDetail: "<c:url value='${url.base}${currentNode.properties.referencePageGeolocalisationDetail.node.path}.html'/>",
     referencePagePanierOffres: "<c:url value='${url.base}${currentNode.properties.referencePagePanierOffres.node.path}.html'/>",
     siteName: "${fn:toLowerCase(renderContext.site.name)}",
     rechercheCodes: ${rechercheCodes},
     rechercheAvanceeCodes: ${rechercheAvanceeCodes}
   });
  </script>
</template:addResources>


<%-- cdcd --%>