• Aucun résultat trouvé

Final JEE

N/A
N/A
Protected

Academic year: 2022

Partager "Final JEE"

Copied!
4
0
0

Texte intégral

(1)

2010/2011 1er Semestre

Nom, Prénom :

Final JEE

Documents autorisés : Aucun Durée : 1h30.

1 - Quelle est la fonction de la servlet ActionServlet de Struts par rapport au modèle MVC 2 ?

Regarding the MVC 2 Model, what is the role of the Struts ActionServlet servlet?

(1 point / 5 minutes) 2 - A quoi sert la classe ActionForm de Struts ?

What is the Struts ActionForm class for?

(1 point / 5 minutes) 3 - Que permet la balise <html:optionsCollection> ?

What's the aim of the <html:optionsCollection> tag?

(0,5 point / 5 minutes)

4 - Expliquez le contenu de ce fichier de configuration Struts.

Explain the following struts configuration file.

<struts-config>

<global-forwards>

<forward name="failure" path="/error.jsp"/>

</global-forwards>

<form-beans>

<form-bean name="loginForm" type="com.exemple.Login- Form"/>

</form-beans>

<action-mappings>

<action path="/login" type="com.exemple.LoginAction"

scope="session"

name="loginForm">

<forward name="success" path="/welcome.jsp" />

</action>

</action-mappings>

</struts-config>

(1,5 points / 10 minutes)

5 - Que doit au minimum contenir une table pour pouvoir être exploitée par Hibernate ? What should at least contain a database table to be compliant to an Hibernate

management?

(2)

(0,5 point / 2 minutes) 6 - Faut-il indiquer à Hibernate le type de base de données utilisé ? Si oui, comment ?

Should we indicate to Hibernate the underlying database type? In this case, how should we proceed?

(0,5 point / 2 minutes) 7 - A quoi sert la propriété hbm2ddl.auto ? Quelles peuvent être les valeurs de cette propriété ? Donnez leur signification.

What’s aim of the hbm2ddl.auto configuration property? What are the possible values. Explain the difference between each of them.

(1 points / 5 minutes)

8 - Quel est le rôle de la balise <generator> d’un fichier de mapping Hibernate ? Within a Hibernate mapping file, what’s the role of the <generator> tag ?

(0,5 points / 2 minutes) 9 - Par quoi se manifeste dans le code source Java des entités métier la différence entre une relation unidirectionnelle et une relation bidirectionnelle ?

Within the Java code of 2 business model entities, how can we notice the difference between an unidirectional and a bidirectional relationship?

(1 point / 2 minutes) 10 - Expliquez le fichier de configuration Hibernate suivant :

Explain the content of the following Hibernate configuration file:

<hibernate-mapping>

<class name="fr.example.entity.Trajet" table="TRAJET">

<id name="idTrajet" type="java.lang.Integer" column="ID_TRAJET"/>

<generator class="sequence">

<param name="sequence">SEQ_ID_TRAJET</param>

</generator>

</id>

<many-to-one class="fr.example.entity.Gare" name="gareDest"

column="ID_GARE_DEST"/>

</many-to-one>

<many-to-one class="fr.example.entity.Gare" name="gareOrig"

column="ID_GARE_ORIG"/>

</many-to-one>

<property name="typeTrajet" type="java.lang.Integer"

column="TYPE_TRAJET"/>

<property name="nomTrajet"/>

</class>

<class name="fr.example.entity.Gare" table="GARE">

<id name="idGare" type="java.lang.Integer" column="ID_GARE"/>

<generator class="sequence">

<param name="sequence">SEQ_ID_GARE</param>

</generator>

</id>

<property name="codeGare" type="java.lang.Integer"/>

</class>

</hibernate-mapping>

(2 points / 10 minutes) 11 – En quoi consiste le principe d’injection de dépendance ?

What is the principle of the dependency injection?

(2 points / 5 minutes)

(3)

12 – Expliquez le principe de fonctionnement de l’autowiring « byType » ? How is the autowiring “byType” working?

(0,5 points / 5 minute) 13 – Quelle est la différence entre un bean en portée (scope) singleton et un bean en portée prototype ?

What is the difference between a singleton scoped bean and a prototype scoped?

(1 points / 5 minute) 14 – Quelles corrections faudrait-il apporter à la classe MediaCenter qui suit afin qu’elle soit prise en charge de manière satisfaisante par Spring et conforme aux principes de l’inversion de contrôle ?

What should you correct within the MediaCenter class Java code in order to be correctly managed by Spring and compliant to the Inversion of Control principles?

public class MediumVHSVideoRecorder implements VideoRecorderInterface{

public int getMovieDuration(){

return 45;

} … }

@Component

public class VHSMediaCenter implements MediaCenterInterface {

private MediumVHSVideoRecorder videoRecorder public void play(){

System.out.println("Playing video "+videoRecorder.getMovieDuration() +" left...");

} … }

(2 points / 10 minutes) 15 – Que signifie l’annotation @Repository ?

What does the @Repository annotation mean?

(1 points / 2 minutes)

16 – Expliquez la configuration Spring suivante :

Explain the following Spring configuration file content:

<?xml version="1.0" encoding="UTF-8"?>

<beans ...

...">

<context:component-scan base-package="com.jnesis"/>

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">

<property name="locations" value="classpath:com/jnesis/props.properties"/>

</bean>

<bean id="messageSource"

class="org.springframework.context.support.ResourceBundleMessageSource">

(4)

<property name="basenames">

<list>

<value>accueil</value>

</list>

</property>

</bean>

<bean id="advertAttachedFilesDAO" class="com.jnesis.SpringItemAttachedFilesDAO"

autowire="byName" scope="prototype">

<constructor-arg value="12" type="java.lang.String"></constructor-arg>

</bean>

<bean id="advertAttachedFilesService"

class="com.jnesis.SpringItemAttachedFilesService">

<property name="autoCreateOptions" ref="optionContainer" />

<property name="dao">

<ref value=" advertAttachedFilesDAO" />

</property>

</bean>

<bean id="optionContainer" factory-bean="optfactory" factory-method="getContainer">

<property name="selectedOption">

<null/>

</property>

</bean>

<bean id="optfactory" class="com.jnesis.OptionContainerfactory">

<property name="options">

<list>

<bean class="com.jnesis.KitchenType">

<property name="typeName" value="${types.fitted}"/>

</bean>

</list>

</property>

</bean>

<bean class="com.jnesis.Avertiser" p:dao-ref="advertAttachedFilesDAO" p:val="showroom">

</bean>

</beans>

(4 points / 15 minutes)

Références

Documents relatifs

[r]

J’aurai, tu auras, il ou elle aura, nous aurons, vous aurez, ils ou elles auront.. Conjugue les verbes

[r]

On suppose dans cette partie que Ω est un domaine polyh´ edrique convexe de IR d , et on admettra que tous les r´ esultats obtenus dans la premi` ere partie du probl` eme

7) Déplacez de la fonction objectif à l’intérieur de la zone de solution réalisable pour atteindre un extremum. Comparez avec le résultat précédent. Le but de cette commande

public void save(House house) throws DAOException;. public void update(House house)

l'EntityManager doit-on utiliser pour effectuer une mise à jour d'un enregistrement en base de données avec

[r]