NET Framework versione 4 include miglioramenti per ASP.NET 4 in aree mirate. Anche Visual Studio 2010 include miglioramenti e nuove funzionalità per ottimizzare lo sviluppo di risorse Web. In questa sessione verrà fornita una panoramica di numerose delle nuove funzionalità incluse nella nuova versione. Vedremo anche le novità per gli sviluppatori introdotte da Internet Explorer 9
Managing configuration in Drupal 8 - SIDCamp 2015Kelyon Srl
Il sistema di configuration management è una delle grandi novità di Drupal 8, gli use-cases di riferimento per l'utilizzo del sistema di configuration management in Drupal 8 sono differenti da quelli del sistema Drupal 7 + Features sia dal punto di vista di un site-builder che dal punto di vista dello sviluppo.
Il modulo Features in Drupal 8 ritornerà ad essere impiegato per il suo scopo originario.
Introduzione a Drupal e componenti del core - SIDCamp 2015Kelyon Srl
Vengono illustrate le parti principali del CMS Drupal con particolare attenzione alle componenti del core quali nodi, utenti, permessi, field, tassonomia. Viene mostrato anche l'approccio logico alla definizione delle strutture di dati in Drupal, al fine di fornire strumenti adeguati all'approccio alla costruzione di un sito in Drupal.
NET Framework versione 4 include miglioramenti per ASP.NET 4 in aree mirate. Anche Visual Studio 2010 include miglioramenti e nuove funzionalità per ottimizzare lo sviluppo di risorse Web. In questa sessione verrà fornita una panoramica di numerose delle nuove funzionalità incluse nella nuova versione. Vedremo anche le novità per gli sviluppatori introdotte da Internet Explorer 9
Managing configuration in Drupal 8 - SIDCamp 2015Kelyon Srl
Il sistema di configuration management è una delle grandi novità di Drupal 8, gli use-cases di riferimento per l'utilizzo del sistema di configuration management in Drupal 8 sono differenti da quelli del sistema Drupal 7 + Features sia dal punto di vista di un site-builder che dal punto di vista dello sviluppo.
Il modulo Features in Drupal 8 ritornerà ad essere impiegato per il suo scopo originario.
Introduzione a Drupal e componenti del core - SIDCamp 2015Kelyon Srl
Vengono illustrate le parti principali del CMS Drupal con particolare attenzione alle componenti del core quali nodi, utenti, permessi, field, tassonomia. Viene mostrato anche l'approccio logico alla definizione delle strutture di dati in Drupal, al fine di fornire strumenti adeguati all'approccio alla costruzione di un sito in Drupal.
Sempre più aziende guardano con interesse a registri distribuiti e tecnologie Blockchain per non dover dipendere da entità centralizzate di controllo e verifica. Tuttavia, il settore è ancora in continua evoluzione e l’adozione di questo tipo di approccio potrebbe essere eccessivo per molti sistemi che sono ancora per loro natura centralizzati, e la cui riscrittura risulterebbe in investimenti importanti. In questa sessione vedremo una tecnologia antimanomissione dei dati introdotta recentemente in Azure SQL Database.
Una introduzione a Laravel, un framework open source di tipo MVC scritto in PHP per lo sviluppo di applicazioni web. La versione di riferimento per questa presentazione è la 5.x
Importazione e sincronizzazione di contenuti con Feed Import - SIDCamp 2015Kelyon Srl
Passare da un'altra piattaforma a Drupal non è mai stato così semplice grazie alla potenza del modulo Feed Import.
Viene affrontato praticamente il problema della migrazione e della sincronizzazione di contenuti da una base dati mysql (o equivalente) a Drupal 7. Viene mostrato come configurare il modulo Feed Import, come scrivere una query per il recupero dei dati, l’associazione dei field di nodi Drupal ai campi del database remoto, il controllo, l’analisi e il filtraggio dei risultati.
Componenti dello stack LAMP - PHP, il linguaggio, l'installazione - MySQL, in...Fulvio Corno
Master: Amministratore Linux - Livello Avanzato
Nel contesto della formazione professionale rivolta ad aziende ed enti pubblici, sono stati preparati ed erogati dei corsi di Amministratore di sistemi Linux, al livello base ed al livello avanzato.
Il contenuto del corso è allineato con alcuni moduli della certificazione LPIC (Linux Professional Institute Certification), a cavallo tra i livelli 1 e 2. Tutto il materiale didattico è disponibile liberamente con licenza Creative Commons BY-NC-SA.
I docenti del corso sono i proff. Giovanni Squillero, Bartolomeo Montrucchio e Fulvio Corno.
Maggiori informazioni: http://elite.polito.it/index.php/teaching/current-courses/255-master-linux-admin
Many technical communities are vigorously pursuing
research topics that contribute to the Internet of Things (IoT).
Nowadays, as sensing, actuation, communication, and control become
even more sophisticated and ubiquitous, there is a significant
overlap in these communities, sometimes from slightly different
perspectives. More cooperation between communities is encouraged.
To provide a basis for discussing open research problems in
IoT, a vision for how IoT could change the world in the
distant future is first presented. Then, eight key research topics
are enumerated and research problems within these topics are
discussed.
Sempre più aziende guardano con interesse a registri distribuiti e tecnologie Blockchain per non dover dipendere da entità centralizzate di controllo e verifica. Tuttavia, il settore è ancora in continua evoluzione e l’adozione di questo tipo di approccio potrebbe essere eccessivo per molti sistemi che sono ancora per loro natura centralizzati, e la cui riscrittura risulterebbe in investimenti importanti. In questa sessione vedremo una tecnologia antimanomissione dei dati introdotta recentemente in Azure SQL Database.
Una introduzione a Laravel, un framework open source di tipo MVC scritto in PHP per lo sviluppo di applicazioni web. La versione di riferimento per questa presentazione è la 5.x
Importazione e sincronizzazione di contenuti con Feed Import - SIDCamp 2015Kelyon Srl
Passare da un'altra piattaforma a Drupal non è mai stato così semplice grazie alla potenza del modulo Feed Import.
Viene affrontato praticamente il problema della migrazione e della sincronizzazione di contenuti da una base dati mysql (o equivalente) a Drupal 7. Viene mostrato come configurare il modulo Feed Import, come scrivere una query per il recupero dei dati, l’associazione dei field di nodi Drupal ai campi del database remoto, il controllo, l’analisi e il filtraggio dei risultati.
Componenti dello stack LAMP - PHP, il linguaggio, l'installazione - MySQL, in...Fulvio Corno
Master: Amministratore Linux - Livello Avanzato
Nel contesto della formazione professionale rivolta ad aziende ed enti pubblici, sono stati preparati ed erogati dei corsi di Amministratore di sistemi Linux, al livello base ed al livello avanzato.
Il contenuto del corso è allineato con alcuni moduli della certificazione LPIC (Linux Professional Institute Certification), a cavallo tra i livelli 1 e 2. Tutto il materiale didattico è disponibile liberamente con licenza Creative Commons BY-NC-SA.
I docenti del corso sono i proff. Giovanni Squillero, Bartolomeo Montrucchio e Fulvio Corno.
Maggiori informazioni: http://elite.polito.it/index.php/teaching/current-courses/255-master-linux-admin
Many technical communities are vigorously pursuing
research topics that contribute to the Internet of Things (IoT).
Nowadays, as sensing, actuation, communication, and control become
even more sophisticated and ubiquitous, there is a significant
overlap in these communities, sometimes from slightly different
perspectives. More cooperation between communities is encouraged.
To provide a basis for discussing open research problems in
IoT, a vision for how IoT could change the world in the
distant future is first presented. Then, eight key research topics
are enumerated and research problems within these topics are
discussed.
Artificial intelligence (AI) is everywhere, promising self-driving cars, medical breakthroughs, and new ways of working. But how do you separate hype from reality? How can your company apply AI to solve real business problems?
Here’s what AI learnings your business should keep in mind for 2017.
SlideShare now has a player specifically designed for infographics. Upload your infographics now and see them take off! Need advice on creating infographics? This presentation includes tips for producing stand-out infographics. Read more about the new SlideShare infographics player here: http://wp.me/p24NNG-2ay
This infographic was designed by Column Five: http://columnfivemedia.com/
No need to wonder how the best on SlideShare do it. The Masters of SlideShare provides storytelling, design, customization and promotion tips from 13 experts of the form. Learn what it takes to master this type of content marketing yourself.
10 Ways to Win at SlideShare SEO & Presentation OptimizationOneupweb
Thank you, SlideShare, for teaching us that PowerPoint presentations don't have to be a total bore. But in order to tap SlideShare's 60 million global users, you must optimize. Here are 10 quick tips to make your next presentation highly engaging, shareable and well worth the effort.
For more content marketing tips: http://www.oneupweb.com/blog/
Are you new to SlideShare? Are you looking to fine tune your channel plan? Are you using SlideShare but are looking for ways to enhance what you're doing? How can you use SlideShare for content marketing tactics such as lead generation, calls-to-action to other pieces of your content, or thought leadership? Read more from the CMI team in their latest SlideShare presentation on SlideShare.
How to Make Awesome SlideShares: Tips & TricksSlideShare
Turbocharge your online presence with SlideShare. We provide the best tips and tricks for succeeding on SlideShare. Get ideas for what to upload, tips for designing your deck and more.
In questa serata cercheremo di capire perchè Blazor ha riscosso così tanto successo, e lo faremo analizzando casi presi da applicazioni reali dove questa tecnologia è stata introdotta, così da capirne meglio le potenzialità (ma anche le eventuali criticità).
Come di consuetudine, faremo poi un confronto, così da condividere i vari punti di vista.
An overview of technologies and best practices for the development of a full-stack web application using JavaScript. How to realize an entire Application Server with a single programming language, the use of event-driven logic and the potential of Node.js.
Similar to Installing Apache tomcat with Netbeans (20)
In this thesis, we propose a novel Feature Selection framework, called Sparse-Modeling Based Approach for Class Specific Feature Selection (SMBA-CSFS), that simultaneously exploits the idea of Sparse Modeling and Class-Specific Feature Selection. Feature selection plays a key role in several fields (e.g., computational biology), making it possible to treat models with fewer variables which, in turn, are easier to explain, by providing valuable insights on the importance of their role, and might speed the experimental validation up. Unfortunately, also corroborated by the no free lunch theorems, none of the approaches in literature is the most apt to detect the optimal feature subset for building a final model, thus it still represents a challenge. The proposed feature selection procedure conceives a two steps approach: (a) a sparse modeling-based learning technique is first used to find the best subset of features, for each class of a training set; (b) the discovered feature subsets are then fed to a class-specific feature selection scheme, in order to assess the effectiveness of the selected features in classification tasks. To this end, an ensemble of classifiers is built, where each classifier is trained on its own feature subset discovered in the previous phase, and a proper decision rule is adopted to compute the ensemble responses. In order to evaluate the performance of the proposed method, extensive experiments have been performed on publicly available datasets, in particular belonging to the computational biology field where feature selection is indispensable: the acute lymphoblastic leukemia and acute myeloid leukemia, the human carcinomas, the human lung carcinomas, the diffuse large B-cell lymphoma, and the malignant glioma. SMBA-CSFS is able to identify/retrieve the most representative features that maximize the classification accuracy. With top 20 and 80 features, SMBA-CSFS exhibits a promising performance when compared to its competitors from literature, on all considered datasets, especially those with a higher number of features. Experiments show that the proposed approach might outperform the state-of-the-art methods when the number of features is high. For this reason, the introduced approach proposes itself for selection and classification of data with a large number of features and classes.
Quantum computers are incredibly powerful machines that take a new approach to processing information. Built on the principles of quantum mechanics, they exploit complex and fascinating laws of nature that are always there, but usually remain hidden from view. By harnessing such natural behavior, quantum computing can run new types of algorithms to process information more holistically. They may one day lead to revolutionary breakthroughs in materials and drug discovery, the optimization of complex manmade systems, and artificial intelligence. We expect them to open doors that we once thought would remain locked indefinitely. Acquaint yourself with the strange and exciting world of quantum computing.
A Sparse-Coding Based Approach for Class-Specific Feature SelectionDavide Nardone
Feature selection (FS) plays a key role in several fields and in particular computational biology, making it possible to treat models with fewer variables, which in turn are easier to explain and might speed the experimental validation up, by providing valuable insight into the importance and their role. Here, we propose a novel procedure for FS conceiving a two-steps approach. Firstly, a sparse coding based learning technique is used to find the best subset of features for each class of the training data. In doing so, it is assumed that a class is represented by using a subset of features, called representatives, such that each sample, in a specific class, can be described as a linear combination of them. Secondly, the discovered feature subsets are fed to a class-specific feature selection scheme, to assess the effectiveness of the selected features in classification task. To this end, an ensemble of classifiers is built by training a classifier, one for each class on its own feature subset, i.e., the one discovered in the previous step and a proper decision rule is adopted to compute the ensemble responses.
To assess the effectiveness of the proposed FS approach, a number of experiments have been performed on benchmark microarray data sets, in order to compare the performance to several FS techniques from literature. In all cases, the proposed FS methodology exhibits convincing results, often overcoming its competitors.
Online Tweet Sentiment Analysis with Apache SparkDavide Nardone
Sentiment Analysis (SA) relates to the use of: Natural Language Processing (NLP), analysis and computational linguistics text to extract and identify subjective information in the source material. A fundamental task of SA is to "classify" the polarity of a given document text, phrases or levels of functionality/appearance - whether the opinion expressed in a document or in a sentence is positive, negative or neutral. Usually, this analysis is performed "offline" using Machine Learning (ML) techniques. In this project two online tweet classification methods have been proposed, which exploits the well known framework "Apache Spark" for processing the data and the tool "Apache Zeppelin" for data visualization.
Blind Source Separation using Dictionary LearningDavide Nardone
The sparse decomposition of images and signals found great use in the field of: Compression, Noise removal and also in the Sources separation. This implies the decomposition of signals in the form of linear combinations with some elements of a redundant dictionary. The dictionary may be either a fixed dictionary (Fourier, Wavelet, etc) or may be learned from a set of samples. The algorithms based on learning the dictionary can be applied to a broad class of signals and have a better compression performance than methods based on fixed dictionary. Here we present a Compressed Sensing (CS) approach with an adaptive dictionary for solving a Determined Blind Source Separation (DBSS). The proposed method has been developed by reformulating a DBSS as Sparse Coding (SC) problem. The algorithm consist of few steps: Mixing matrix estimation, Sparse source separation and Source reconstruction. A sparse mixture of the original source signals has been used for the estimating the mixing matrix which have been used for the reconstruction of the of the source signals. A 'block signal representation' is used for representing the mixture in order to greatly improve the computation efficiency of the 'mixing matrix estimation' and the 'signal recovery' processes without particularly lose separation accuracy. Some experimental results are provided to compare the computation and separation performance of the method by varying the type of the dictionary used, be it fixed or an adaptive one. Finally a real case of study in the field of the Wireless Sensor Network (WSN) is illustrated in which a set of sensor nodes relay data to a multi-receiver node. Since more nodes transmits messages simultaneously it's necessary to separate the mixture of information at the receiver, thus solving a BSS problem.
Accelerating Dynamic Time Warping Subsequence Search with GPUDavide Nardone
Many time series data mining problems require
subsequence similarity search as a subroutine. While this can
be performed with any distance measure, and dozens of
distance measures have been proposed in the last decade, there
is increasing evidence that Dynamic Time Warping (DTW) is
the best measure across a wide range of domains. Given
DTW’s usefulness and ubiquity, there has been a large
community-wide effort to mitigate its relative lethargy.
Proposed speedup techniques include early abandoning
strategies, lower-bound based pruning, indexing and
embedding. In this work we argue that we are now close to
exhausting all possible speedup from software, and that we
must turn to hardware-based solutions if we are to tackle the
many problems that are currently untenable even with stateof-
the-art algorithms running on high-end desktops. With this
motivation, we investigate both GPU (Graphics Processing
Unit) and FPGA (Field Programmable Gate Array) based
acceleration of subsequence similarity search under the DTW
measure. As we shall show, our novel algorithms allow GPUs,
which are typically bundled with standard desktops, to achieve
two orders of magnitude speedup. For problem domains which
require even greater scale up, we show that FPGAs costing just
a few thousand dollars can be used to produce four orders of
magnitude speedup. We conduct detailed case studies on the
classification of astronomical observations and similarity
search in commercial agriculture, and demonstrate that our
ideas allow us to tackle problems that would be simply
untenable otherwise.
Lempel–Ziv–Welch (LZW) is a universal lossless data compression algorithm created by Abraham Lempel, Jacob Ziv, and Terry Welch. It was published by Welch in 1984 as an improved implementation of the LZ78 algorithm published by Lempel and Ziv in 1978. The algorithm is simple to implement, and has the potential for very high throughput in hardware implementations.
It is the algorithm of the widely used Unix file compression utility compress, and is used in the GIF image format.
2. • ApacheTomcat
• Componenti di ApacheTomcat
• Web Application
• Componenti di unWeb Application
• Configurazione ambiente con Netbeans 8.x
• Server Apache
• Database
• Esempio di Registrazione e Login
• Tomcat Web Application Manager
Sommario
3. • Scaricare Java SDK
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-
2133151.html
• Scaricare Netbeans
https://netbeans.org/downloads/
• Scaricare la versione “MySQL Server” (32-64 bit)
https://dev.mysql.com/downloads/mysql/
Prima di iniziare...
4. Scaricare e installare Java SDK
• Scaricare Java SDK dal seguente link:
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
7. ModelView Controller (MVC)
MVC e’ un utile pattern architetturale per la separazione dei compiti di un
software.
• Model: Plain OldJavaScript Object (POJO) che trasporta i dati.
• View: livello nel quale i dati sono rappresentanti in formato visuale.
• Controller: componente responsabile per la comunicazione tra model e
view.
8. • ApacheTomcat e’ un Application Server basato su Java Servlet
• Tomcat implementa diverse specifiche:
• Java Servlet
• JavaServer Pages (JSP)
• ect
Cos’e’ ApacheTomcat ?
(Client)
Browser
(Controller)
Servlet
(View)
JSP
(Model)
Java
Beans
Enterprise
Servers/
Data
sources
Architettura MVC
9. 1. Catalina
• Contenitore di Servlet Java diTomcat
• Fornisce l’effettiva implementazione diTomcat, delle specifiche della
Servlet.
2. Coyote
• Componente “connettore HTTP” diTomcat
• Supporta il protocollo HTTP per il Web Server
• Ascolta le connessioni in entrata su una specifica portaTCP, inoltra la
richiesta al motoreTomcat e processa la richiesta e manda indietro la
risposta al client.
3. Jasper
• Analizza e converte le porzioni di codice all’interno delle pagine JSP in
Servlet e le passa a Catalina per processarle
• Quando lanciato, cerca eventuali cambiamenti avvenuti ai file JSP e, se
necessario li ricompila.
Componenti diTomcat
10. • Un Web component e’ un oggetto che estende le funzionalita’ di
unWeb Server aggiugendone di nuove:
• Servlet
• Java Server Pages (JSP)
• ecc
• I Web component sono in grado di accedere ai servizi offerti da un
Web container come:
• Smistamento delle richieste
• Sicurezza
• Concorrenza
• Gestione della memoria
Componenti di un Web Application (WA)
11. • E’ una classe scritta in linguaggio Java che estende le capacità di un
server.
• Le funzionalità principali di una Servlet sono:
• Elaborazione o memorizzazione di dati provenienti da form HTML;
• Generazione di contenuti dinamici (pagine Web) a seconda dei parametri
della richiesta inviata;
• Gestione delle informazioni di stato che non esistono nel protocollo HTTP
stateless.
• Comunicano attraverso un qualsiasi protocollo Client-Server, ma sono
principalmente utilizzate con il protocollo HTTP.
Java Servlet (Controller)
12. • JSP e’ una tecnologia di programmazione Web in Java per lo
sviluppo diWA.
• Forniscono contenuti dinamici in formato HTML o XML.
• Si basa su un insieme di tag speciali con cui possono essere
invocate funzioni predefinite o codice Java (e.g., <% %>).
• Puo’ essere vista come una rappresentazione ad alto livello di
una Servlet.
Java Server Page (View)
13. • Classe che incapsula molti oggetti in un singolo oggetto (bean).
• Classe Java appositamente costruita e programmata in accordo alle
specifiche delle API di JavaBeans.
• Oggetti serializzabili che permettono l’accesso a diverse proprieta’
attraverso i cosiddetti metodi getter e setter.
• Il modello rappresenta un oggetto POJO per il trasporto dei dati.
JavaBeans (Model)
Vantaggi Svantaggi
Controllo delle proprieta’, eventi e metodi dei
beans esposti ad altre applicazioni.
E’ soggetto ad essere instanziato con un stato
invalido avendo un costruttore nullo.
Registra eventi da altri oggetti e puo’ generare
eventi da poter inviare ad altri oggetti.
Sono oggetti intrinsecamente mutabili mancando
cosi del vantaggio offerto dagli oggetti
immutabili.
Impostazioni di configurazione di un bean
possono essere memorizzati in modo persistente.
Il possedere molti metodi getter e setter puo’
portare una quantita’ immensa di boilerplate code.
14. • Una volta lanciato Netbeans...
• Creare un nuovo progetto: JavaWeb-> Web Application
Configurazione dell’ambiente
15. • Se non presente di default, aggiungere il Server ApacheTomcat 8.x
• e modificare le credenziali utente diTomcat
Configurazione dell’ambiente
16. • Selezionare la voce Services -> Cliccare su Properties
Configurare il Server ApacheTomcat
17. • Selezionare la voce Services -> Cliccare su Start
Lanciare il Server ApacheTomcat
• Permettere l’accesso in rete di Java e Netbeans.
18. Configurare i ruoli d’accesso aTomcat
• Aprire il file tomcat-users.xml al path precedentemente copiato
• Inserire la seguente riga in basso al file:
• <user username=“...” password=“...” roles=“manager-script,admin-gui,manager-gui” />
19. Accedere alla GUI di ApacheTomcat
• Aprire un browser e accedere al server locale diTomcat all’indirizzo:
localhost:<server port> (e.g., localhost:9090)
• Server Status: GUI per il
monitoraggio delle risorse
occupate dalla/e WA.
• Manager App: GUI per la
visualizzazione dei dettagli
di una sessione e/o per la
rimozione di
attributi/variabili di
sessione.
20. Installare MySQL Server
1. Lanciare l’installer;
2. Scegliere come tipologia di installazione qualle ‘custom’;
3. Scegliere come prodotti:
1. MySQL Server 5.x
2. Connector/J 5.x
4. Impostare la password per l’utente ‘root’;
5. Aggiungere (eventualmente) un nuovo utente con relativa
password;
6. Applicare/eseguire le configurazioni impostate.
Nota: In alternativa allo stesso modo di MySQL Server e’ possibile
utilizzare la versione di JavaDB pre-installata in Netbeans.
21. Configurazione Database Netbeans
• Una volta scaricato e installato MySQL Server, effettuare i
seguenti steps:
1. Services -> Register MySQL Server;
2. Inserire il nome dell’utente e password amministratore
impostati nella fase d’installazione;
3. Cliccare Admin Properties ed inserire il path dell’eseguibile di
MySQL (mysqld.exe) alla voce Path to start command;
4. Connettersi al database, creare un database di test e
concedere all’utente tutti i permessi al db appena creato.
5. Infine connettersi al database.
22. Configurazione Database Netbeans (cont.)
• Creare una nuova tabella con gli attributi sotto riportati
Attributi
Name <VARCHAR>
Surname <VARCHAR>
City <VARCHAR>
University <VARCHAR>
Phone <VARCHAR>
Mail <VARCHAR>
Password <VARCHAR>
23. Configurazione Database Netbeans (cont.)
• Aggiungere i driver JDBC all progetto
• I driver JDBC Mysql sono al path:
C:Program FilesNetBeans 8.2idemodulesextmysql-connector-java-5.1.23-bin.jar
24. Esempio di Registrazione e Login
• In questo semplice esempio vedremo come gestire:
1. Registrazione utente
2. Login utente
3. Visualizzazione utenti
• Sara’ creata:
• Una classe Database per effettuare semplici operazioni di
connessione al db, inserimento e reperimento dati da esso.
• Diverse pagine JSP per la gestione dell’interfaccia grafica
dellaWA.
• Infine alcune Servlet per l’elaborazione dei dati ricevuti dal
front-end.
25. Singleton Class Database (1)
package classes;
import java.sql.*;
import java.util.logging.*;
public class Database {
//static reference to itself
private static Database dbIsntance;
public static final String URL = "jdbc:mysql://localhost/test”;
public static final String USER = ”<tuo_utente>";
public static final String PASSWORD = ”<tua_password>";
public static final String DRIVER_CLASS = "com.mysql.jdbc.Driver";
private static Connection con ;
private static Statement stmt;
private Database() { /* private constructor*/ }
1. Creare un proprio package (e.g., classes) nella cartella Source
Packages
2. Creare la Classe Database nel package appena creato
26. Singleton Class Database (2)
public static Database getInstance(){
if(dbIsntance == null) {
dbIsntance = new Database();
}
return dbIsntance;
}
public Connection getConnection(){
if(con==null) {
try {
Class.forName(DRIVER_CLASS);
con = DriverManager.getConnection(URL, USER, PASSWORD);
} catch (SQLException | ClassNotFoundException ex) {
Logger.getLogger(Database.class.getName()).log(Level.SEVERE, null, ex);
}
}
return con;
}
}
33. Esercizio
• Implementare un classe Servlet per la gestione del LogOut di un
utente
• Rimozione della sessione
• Redirezione alla pagina di login
34. WEB-INF: file di configurazione
web.xml: descrittore di distribuzione della WA.
• Descrive le servlets e gli altri componenti che compongono laWA.
• Utilizzato per l’impostazione dei parametri d’inizializzazione e per i vincoli
di sicurezza che si vuole fare rispettare allaWA.
Note: nel caso in cui tale file non sia disponibile nella cartellaWEB-INF al path: web/WEB-INF
del progetto, e’ possibile reperirlo dal materiale messo a disposizione sulla piattaforma
modificandolo appropriatemente.
classes: cartella contenente i file delle classi Java richieste dallaWA, che
include entrambe le classi Servlet e non-Servlet.
lib: cartella dei file JAR, contenenti i file delle classi JAVA richieste per laWA.
• Librerie di classi di terze parti e/o driver JDBC.