JAT - Java Technology

Materials and information for subject Java Technology. Subject is focused on extension of students knoledges and skills in JavaSE and JavaEE platform.

During the semester can be information modified.

Students have to develop graded task on each computer lab. Students have to colect at least half of total sum of points to be able obtain credits.

Example Project

Example project based on codes from labs.

Přednášky

 JAT přednášky (JAT přednášky PDF)

  • Úvodní informace k předmětu, Něco o Javě, komponenty, model Event-Listener, JavaBean
  • Java GUI a Event Listener model
  • XML a zpracování XML v jazyce Java (SAX, DOM, JAXB)
  • JNDI (LDAP)
  • HTTP, JavaEE - Architektura, Servelty
  • Servlety, Filtry
  • JSF
  • CDI
  • JPA
  • PrimeFaces
  • Odevzdání projektu
  • Zápočtová písemka

Conditions for obtaining a classified credit

  • Passing the final test.
  • Accumulate the minimum number of points per exercise.
  • The project will be rated at a maximum of 40, at least 20.
  • Exercises in weeks 2 through 12 will be divided into 36 points, with a maximum of 30 points and a minimum of 15 points
  • The final test will be evaluated at a maximum of 30 minimum to be obtained 15.
  • The total sum of points for the workout, the project and the final test must be at least 51 points.

Assignment of the semester project

Students will submit their projects at the latest on the week before the week and will be uploaded to Edison.

Web Information System meeting the following conditions:

     Web layer using JSF
     Access DB using JPA
     Session beans can be in the JavaEE server's container web
     Database tables will represent mapping of at least 4 classes. There will be at least one 1-N bond between the entity classes and there will be a childhood that will be mapped to the DB tables.
     The system will include a public and non-public part (available after login to the system)
     The system uses css styles to protect the application
     The GUI application will include components like ComboBox (SelectOne or SelectMany)
     Converters for object conversion (javax.faces.convert.Converter)
     Links between objects will be set in the GUI using components and objects, not by entering an object ID into a text box.

Final exam

A final test for day-time students will take place during the week-end exercises. This will be a computer programming test, where students will solve short programmer tasks. Each student has only one attempt to complete this test.

Nastavení TomEE pro lepší logování

Zkopírovat a případně upravit logging.properties z [tomee-home]/conf/ do Eclipsu nastavení serveru.

Do spouštěcí/debugovací konvigurace v Eclipse přidat argumenty uvedené níže:.

 

Hibernate Bytecode Enhancement using maven plugin

<build>
...
<plugins>
...
<plugin>
<!--
https://mvnrepository.com/artifact/org.hibernate.orm.tooling/hibernate-enhance-maven-plugin -->
<groupId>org.hibernate.orm.tooling</groupId>
<artifactId>hibernate-enhance-maven-plugin</artifactId>
<version>6.2.6.Final</version>
<executions>
<execution>
<configuration>
<enableDirtyTracking>true</enableDirtyTracking>
<enableLazyInitialization>true</enableLazyInitialization>
</configuration>
<goals>
<goal>enhance</goal>
</goals>
</execution>
</executions>
</plugin>
...
</plugins>
...
</build>
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file="${workspace_loc}/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/conf/logging.properties"

server.xml

<Resource auth="Container" description="jat2017" 
driverClassName="org.apache.derby.jdbc.ClientDriver"
name="datasources/jat2017" password="app" username="app"
type="javax.sql.DataSource"
url="jdbc:derby://localhost/jat2017cv10v2;create=true"/>

context.xml

	<ResourceLink name="datasources/jat2017" 
global="datasources/jat2017"
type="javax.sql.DataSource" />

Get Password using jOptionPane

	public static String getPassword(String login) {
JPasswordField passwordField = new JPasswordField();
passwordField.setEchoChar('*');
Object[] obj = { "Please enter the password for login " + login + ":\n\n", passwordField };
Object stringArray[] = { "OK", "Cancel" };
if (JOptionPane.showOptionDialog(null, obj, "Need password", JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE, null, stringArray, obj) == JOptionPane.YES_OPTION) {
return new String(passwordField.getPassword());
}
return "";
}

Create table SQL (derby DB)

CREATE TABLE students(
id INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
name VARCHAR(25), points DECIMAL(10,2),
PRIMARY KEY(id))

JPA properties

<properties>
<property
name="javax.persistence.schema-generation.database.action"
value="create" />
<property name="hibernate.enable_lazy_load_no_trans"
value="true" />
</properties>