This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## ---------------------------------------------------------------------- | |
## Telosys Template : Velocity Cheat Sheet | |
## ---------------------------------------------------------------------- | |
#* | |
Multi-lines comment | |
*# | |
#[[ | |
Unparsed block (all this block will be rendered as is) | |
$undefined | |
#set($i = 50) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- Getting an object value with a default value if not defined | |
#assertFalse($fn.isDefined("FOO2"), "F002 is not supposed to be defined!") | |
Getting "FOO2" : $fn.get("FOO2", "my default value") | |
--- Defining a variable if not already exists | |
Exemple 1 : | |
'NAMESPACE' has not been defined in the project variables | |
then it will be initialized with a default value | |
#set ( $NAMESPACE = $fn.get("NAMESPACE", "default-name" ) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- Playing with defined/undefined variables | |
#set ( $FOO1 = "FooValue1" ) | |
'FOO1' variable has been set, value = "$FOO1" | |
#if ( $fn.isDefined("FOO1") ) ## Check by variable name (string, not object reference) | |
YES 'FOO1' is defined | |
#else | |
NO 'FOO1' is not defined | |
#end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Created on 2017-04-26 ( Date ISO 2017-04-26 - Time 21:50:59 ) | |
* Generated by Telosys ( http://www.telosys.org/ ) version 3.0.0 | |
*/ | |
package org.demo.persistence.impl.redis.commons.json; | |
import static org.junit.Assert.assertEquals; | |
import static org.junit.Assert.assertNotNull; | |
import java.text.SimpleDateFormat; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.demo.tmp; | |
import java.util.logging.Level; | |
import java.util.logging.Logger; | |
import org.junit.Test; | |
public class LoggerTest { | |
@Test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns="http://java.sun.com/xml/ns/javaee" | |
xmlns:web="http://java.sun.com/xml/ns/javaee" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" | |
id="portail-jaxrs" version="2.5"> | |
<display-name>portail-jaxrs</display-name> | |
<servlet> | |
<servlet-name>Jersey REST Service</servlet-name> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>cours</groupId> | |
<artifactId>jax-rs</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<packaging>war</packaging> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import java.net.MalformedURLException; | |
import java.net.URI; | |
import java.net.URL; | |
import java.net.URLClassLoader; | |
import java.sql.Connection; | |
import java.sql.Driver; | |
import java.sql.DriverManager; | |
import java.sql.SQLException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//--- For each entity | |
for ( Map.Entry<String, EntityInContext> entry : _entities.entrySet() ) | |
{ | |
//String name = entry.getKey() ; | |
EntityInContext entity = entry.getValue() ; | |
allEntities.add(entity); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SuppressWarnings("unchecked") | |
protected void logSessionContent(HttpSession session) { | |
Enumeration<String> enumNames = session.getAttributeNames(); | |
List<String> names = Collections.list(enumNames); | |
logger.info("Session content (size = " + names.size() + ") : "); | |
for ( String name : names ) { | |
logger.info(" . '" + name + "' : " + session.getAttribute(name) ); | |
} | |
} |
NewerOlder