It must be premised that I did not want the range2 sub-table, because I have the Parlamentari table, with a “periodo_cariche” attribute of type Range < LocalDate > [], but I was told to map Parlamentari it in this way and hibernate generates the range2 table for me with redundant attributes that every time I have to delete by hand and the range attribute is not of the right type, but it generates a uuid for me, and therefore I cannot populate it, The execution starts, but when I insert in the browser url l 'address http: // localhost: 80 …, tells me that the query did not produce results, because, I suppose, range2 is empty, while the Parlamentari table is populated. In the database the “parlamentari” table contains the “periodo_cariche” attribute which is of type daterange[]. I am using the Spring Boot ide,
Update: I have manually modified the range2 table in the database by setting the type daterange [] for the range attribute. I entered the tuple and the error remained the same. Looking closer at the stackstrace, I found this error: STACKTRACE:
at
com.giuggiola.controller.ParlamentareController.
home(ParlamentareController.java:33)
which corresponds to the line of code:
Iterable<Parlamentare> parlamentari = parlamRepo.findAll();
While debugging I couldn’t figure out where the error is, so I think the error is in the jsp page, however I also put the controller class and the repository
OUTPUT BROWSER:
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a
fallback.
Thu May 05 14:39:31 CEST 2022
There was an unexpected error (type=Internal Server Error, status=500).
java.lang.IllegalArgumentException: org.postgresql.util.PSQLException: Nessun risultato
è stato restituito dalla query.; nested exception is org.hibernate.HibernateException:
java.lang.IllegalArgumentException: org.postgresql.util.PSQLException: Nessun risultato
è stato restituito dalla query.
Parlamentare.java
@Component
@Entity//(name = "Parlamentare")
@Table(name = "parlamentari")
@Data
@AllArgsConstructor
//@NoArgsConstructor
//@IdClass(PK.class)
@TypeDef(
typeClass = PostgreSQLRangeType.class,
defaultForType = Range.class
)
@TypeDef(
name = "list-array",
typeClass = ListArrayType.class
)
@TypeDef(
name = "string-array",
typeClass = StringArrayType.class
)
//@IdClass(PK.class)
public class Parlamentare implements Serializable{
static final long serialVersionUID = 1;
@EmbeddedId
private PK pk;
//se tieni @embeddedId devi togliere i tre seguenti campi @id e commentarli
//se metti @idclass, togli embedded
/*
@Id
@Column(name = "nome")
String nome;
@Id
@Column(name = "partito")
String partito;
@Id
@Column(name = "circoscrizione")
String circoscrizione;
*/
@Column(name = "data_nascita")
Date data_nascita;
@Column(name = "luogo")
String luogo;
@Column(name = "titolo_studi")
String titolo_studi;
/*@Type( type = "string-array" )
@Column(
name = "sensor_names",
columnDefinition = "text[]"
)
private String[] sensorNames;*/
@Type( type = "string-array" )
@Column(
name = "mandati",
columnDefinition = "text[]"
)
private String[] mandati;
/*
@Column(name = "mandati")
String[] mandati;
*/
@Type( type = "string-array" )
@Column(
name = "commissioni",
columnDefinition = "text[]"
)
private String[] commissioni;
/*
@Column(name = "commissioni")
String[] commissioni;
*/
// cascade = CascadeType.ALL,
// orphanRemoval = true,
// fetch=FetchType.EAGER)
//fetch=FetchType.EAGER)
//cascade = CascadeType.ALL, orphanRemoval = true)
//targetEntity = Range2.class,fetch=FetchType.EAGER)
/*
@Autowired
@OneToMany(mappedBy="parlamentare", targetEntity = Range2.class)
@ElementCollection
@CollectionTable(name = "parlamentari", joinColumns=@JoinColumn(name="parlamentare"))
@Column(name="periodi_cariche")
*//*
@ManyToMany(mappedBy="range", targetEntity=Range2.class)
@Type(type = "list-array")
@Column(
name = "periodi_cariche",
columnDefinition = "daterange[]"
)
private List<Range<LocalDate>> periodi_cariche = new ArrayList<Range<LocalDate>>();
*/
/*@JoinTable(name="Parlamentare_Range", joinColumns={@JoinColumn(name ="pkId",
referencedColumnName ="pk")},
inverseJoinColumns={@JoinColumn(name ="pk_rid", referencedColumnName ="pk")})*/
//(cascade=CascadeType.ALL, targetEntity=CoachGroup.class)
//-----------------------------------------------------------------------------
// @OneToMany(mappedBy="parlamentare", cascade=CascadeType.ALL, orphanRemoval=true,
// targetEntity=Range2.class)
/* @JoinColumn(name="pk", referencedColumnName ="pk")
@JoinTable(name="Range2", joinColumns={
@JoinColumn(name ="nome", referencedColumnName ="nome"),
@JoinColumn(name ="partito", referencedColumnName ="partito"),
@JoinColumn(name ="circoscrizione", referencedColumnName ="circoscrizione"),
@JoinColumn(name ="range")
}
)*/
//--------------------------------------------------------------------------------------
/* @JoinTable(name="Range2", joinColumns={@JoinColumn(name ="nome",
referencedColumnName ="nome"),
@JoinColumn(name ="partito", referencedColumnName ="partito"),
@JoinColumn(name ="circoscrizione", referencedColumnName ="circoscrizione"),
@JoinColumn(name ="range")
},
inverseJoinColumns={@JoinColumn(name ="range", referencedColumnName ="range")})
*/
/* @JoinTable(name="Parlamentare_Range", joinColumns={@JoinColumn(name ="range",
referencedColumnName ="range")},
inverseJoinColumns={@JoinColumn(name ="periodi_cariche", referencedColumnName
="periodi_cariche")})
*/
// @JoinColumn(name="range")
//@EmbeddedId
// private Range<LocalDate>[] periodi_cariche = new Range<LocalDate>[];
//-------------------------------------------------------------------------------
@OneToMany(mappedBy="parlamentare", cascade=CascadeType.ALL, orphanRemoval=true,
targetEntity=Range2.class)
@Type(type = "list-array")
@Column(
name = "periodi_cariche",
columnDefinition = "daterange[]"
)
private List<Range<LocalDate>> periodi_cariche = new ArrayList<Range<LocalDate>>();
…
Range2.java
@Entity
public class Range2 extends PostgreSQLRangeType
{
static final long serialVersionUID = 1;
@EmbeddedId
@JoinTable(name="parlamentari",
joinColumns={
@JoinColumn(name = "nome", insertable = false, updatable = false),
@JoinColumn(name = "partito", insertable = false, updatable = false),
@JoinColumn(name = "circoscrizione", insertable = false, updatable = false),
})
//@ManyToOne(fetch=FetchType.LAZY, targetEntity=Parlamentare.class)
private PK pk;
// @ManyToOne(cascade=CascadeType.PERSIST,
targetEntity=Parlamentare.class)//cascade=CascadeType.ALL,
@ManyToOne(fetch=FetchType.LAZY, targetEntity=Parlamentare.class)
//@JoinTable(name="parlamentari",joinColumns={@JoinColumn(name="periodi_cariche",
referencedColumnName="parlamentare")})
// private Range<LocalDate> range;
private Parlamentare parlamentare;
private Range<LocalDate> range;
public Range<LocalDate> getRange() {
return range;
}
public void setRange(Range<LocalDate> range) {
this.range = range;
}
public // <T extends LocalDate>
Range2(
//T arg
) {
//super(Range.class);
new PostgreSQLRangeType();
//Range<LocalDate> range ;//= new Range<LocalDate>();
}
…
PK.java
@Component
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode
@Embeddable
@TypeDef(
name = "string-array",
typeClass = StringArrayType.class
)
public class PK implements Serializable {
private static final long serialVersionUID = 1;
@Column(name="nome", nullable=false)
protected String nome;
@Column(name="partito", nullable=false)
protected String partito;
@Type( type = "string-array" )
@Column(
name = "circoscrizione",
columnDefinition = "text[]"
)
private String[] circoscrizione;
...
[![table parlamentari][1]][1][![range2][2]][2][![periodo_cariche][3]][3]
APPLICATION.PROPERTIES
server.port=****
spring.mvc.view.prefix=/src/main/webapp/
spring.mvc.view.suffix=.jsp
spring.sql.init.platform=postgres
spring.datasource.url=jdbc:postgresql://localhost:****/Parlamento
spring.datasource.username=postgres
spring.jpa.properties.hibernate.dialect =
org.hibernate.dialect.PostgreSQL10Dialect
#spring.jpa.hibernate.ddl-auto=none
spring.jpa.hibernate.ddl-auto = update
spring.jpa.hibernate.use-new-id-generator-mappings=true
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
spring.datasource.password=****
spring.jpa.properties.hibernate.format_sql=true
#spring.sql.init.mode=always
#spring.sql.init.schema-locations=classpath:/schema.sql
spring.sql.init.continue-on-error=true
spring.profiles.active=@spring.profiles.active@
logging.level.org.springframework.web: DEBUG
# Keep the connection alive if idle for a long time (needed in
production)
#spring.datasource.testWhileIdle = true
spring.datasource.tomcat.abandon-when-percentage-full=1
#spring.datasource.validationQuery = SELECT 1
spring.datasource.xa.data-source-class-name= SELECT 1
#spring.datasource.url=jdbc:postgresql://HOST:PORT/activitydb
#spring.datasource.username=activityman
#spring.datasource.password=activitymanpasses
spring.jpa.database-
platform=org.hibernate.dialect.PostgreSQL10Dialect
#spring.jpa.generate-ddl=true
spring.main.allow-bean-definition-overriding=true
#spring.datasource.type=org.apache.commons.dbcp.BasicDataSource
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
#server.servlet.context-path=/
#server.error.whitelabel.enabled=false
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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
https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.giuggiola</groupId>
<artifactId>Parlamento</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>bootjpa</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>16</java.version>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/com.zaxxer/HikariCP -->
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>5.0.1</version>
</dependency>
<!--
https://mvnrepository.com/artifact/org.springframework.boot/spring-
boot-starter-data-elasticsearch -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
<!-- <scope>runtime</scope>-->
<version>2.6.3</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>19.0</version>
</dependency>
<!--
https://mvnrepository.com/artifact/org.springframework.boot/spring-
boot-devtools -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<version>2.6.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.vladmihalcea</groupId>
<artifactId>hibernate-types-55</artifactId>
<version>2.14.0</version>
</dependency>
<!--
https://mvnrepository.com/artifact/org.apache.tomcat/tomcat-jasper
-->
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jasper</artifactId>
<version>9.0.52</version>
</dependency>
<!-- Thanks for using https://jar-download.com -->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
<!--
https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.22</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven</artifactId>
<version>1.18.20.0</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>2.6.4</version>
<scope>test</scope>
</dependency>
<!--
https://mvnrepository.com/artifact/org.springframework.boot/spring-
boot-starter-parent -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.4</version>
<type>pom</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</project>
ParlamentareController.java
@Controller
@ComponentScan({"com.giuggiola.controller"})//poi toglilo
public class ParlamentareController //extends
AbstractController<Parlamentare>
{
@Autowired
ParlamentareRepository parlamRepo;
//@RequestMapping("/parlamentari")
@RequestMapping("/")
public ModelAndView home(Parlamentare parlamentare)
{
ModelAndView mv= new ModelAndView();
Iterable<Parlamentare> parlamentari = parlamRepo.findAll();
mv.addObject("parlamentari",parlamentari);
mv.setViewName("parlamentari.jsp");
return mv;//"home.jsp";
}
@RequestMapping("/addParlamentare")
@ResponseBody
public ModelAndView addParlamentare(Parlamentare parlamentare)
{
ModelAndView mv = new ModelAndView();
parlamRepo.save(parlamentare);
mv.addObject("parlamentare",parlamentare);
mv.setViewName("showParlamentare.jsp");
return mv;//"home.jsp";
}
//modifica 7-5-22 : ho messo PK pk al mosto di string nome negli
argomenti di input
@RequestMapping("/getParlamentare")
public ModelAndView getParlamentare(@RequestParam PK pk)
{
ModelAndView mv = new ModelAndView();
Parlamentare parlamentare =
parlamRepo.findByPk(pk);//.orElse(new Parlamentare());
mv.setViewName("showParlamentare.jsp");
mv.addObject(parlamentare);
return mv;
}
@RequestMapping("/getParlamentare3")
public ModelAndView getParlamentare3(@RequestParam String partito)
{
ModelAndView mv = new ModelAndView();
List<Parlamentare> parlamentari =
parlamRepo.findByPartito(partito);
System.out.println(parlamRepo.findByPartito(partito));
mv.addObject(parlamentari);
mv.setViewName("lista_parlamentari.jsp");
return mv;
}
@RequestMapping("/getParlamentare4")
public ModelAndView getParlamentare4(@RequestParam String[]
circoscrizione)
{
ModelAndView mv = new ModelAndView();
List<Parlamentare> parlamentari =
parlamRepo.findByCircoscrizione(circoscrizione);
System.out.println(
parlamRepo.findByCircoscrizione(circoscrizione));
mv.addObject(parlamentari);
mv.setViewName("lista_parlamentari.jsp");
return mv;
}
@RequestMapping("/updateParlamentare")//modificche con pk
public ModelAndView updateParlamentare(@RequestParam PK pk,
Parlamentare nuovoparlamentare)
{
ModelAndView mv = new ModelAndView();
Parlamentare vecchioparlamentare =
parlamRepo.findByPk(pk);//.orElse(null);
parlamRepo.delete(vecchioparlamentare);
if((pk.getNome()==nuovoparlamentare.getNome()) &&
(pk.getPartito()==nuovoparlamentare.getPartito()) &&
(pk.getCircoscrizione()==nuovoparlamentare.getCircoscrizione()))
parlamRepo.save(nuovoparlamentare);
Parlamentare parlamentare = nuovoparlamentare;
mv.addObject(parlamentare);
mv.setViewName("showParlamentare.jsp");
return mv;
}
@RequestMapping("/deleteParlamentare")
public ModelAndView deleteParlamentare(Parlamentare parlamentare)
{
ModelAndView mv = new ModelAndView();
parlamRepo.delete(parlamentare);
Iterable<Parlamentare> parlamentari = parlamRepo.findAll();
mv.addObject("parlamentari",parlamentari);
mv.setViewName("parlamentareDeleted.jsp");
return mv;
}
@RequestMapping("/parlamentari")//modifica /getparlamentari in
/parlamentari
@ResponseBody
public ModelAndView getParlamentari()
{
ModelAndView mv = new ModelAndView();
Iterable<Parlamentare> parlamentari = parlamRepo.findAll();
mv.addObject("parlamentari",parlamentari);
mv.setViewName("lista_parlamentari.jsp");
return mv;
}
@RequestMapping("/parlamentare/{nome}")
@ResponseBody
public Parlamentare getParlamentare5(@PathVariable("nome") String
nome) {
return parlamRepo.findByNome(nome);
}
ParlamentareRepository.java
@Repository
//@Qualifier(value = "parlamRepo")
public interface ParlamentareRepository extends
JpaRepository<Parlamentare, PK>{ //CrudRepository<Parlamentare,PK>
//CrudRepository<Parlamentare,PK>{
/*
@PersistenceContext
public EntityManager entityManager;
*/
@Query(value="select nome from Parlamentari where nome=?1 order by
nome",nativeQuery = true)
public Parlamentare findByNome(String nome);
@Query(value="select pk from Parlamentari where circoscrizione=?1
order by pk",nativeQuery = true)
public Parlamentare findByPk(PK pk);
@Query(value="select nome from Parlamentari where partito=?1 order
by nome",nativeQuery = true)
public List<Parlamentare> findByPartito(String partito);
@Query(value="select nome from Parlamentari where circoscrizione=?1
order by nome",nativeQuery = true)
public List<Parlamentare> findByCircoscrizione(String[]
circoscrizione);//@Query
}
}
[![structure of project][4]][4]
[1]: https://i.stack.imgur.com/m1I4h.png
[2]: https://i.stack.imgur.com/4Z2y7.png
[3]: https://i.stack.imgur.com/fmrH1.png
[4]: https://i.stack.imgur.com/34Zg2.png
parlamentari.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" isELIgnored="false"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-
8859-1">
<!-- <meta charset="ISO-8859-1"> -->
<title>Parlamentari</title>
<%@ page isELIgnored="false"%>
<script src="<c:url value="/resources/js/jquery-1.11.1.min.js" />">
</script>
<script src="<c:url value="/resources/js/bootstrap.min.js" />">
</script>
</head>
<body>
<h2>Aggiungi un parlamentare</h2>
<form action="addParlamentare">
<table>
<tr>
<td>Nome:</td>
<td><input type="text" name="nome"><br></td>
</tr>
<tr>
<td>Partito:</td>
<td><input type="text" name="partito"><br></td>
</tr>
<tr>
<td>Circoscrizione:</td>
<td><input type="text" name="circoscrizione"><br></td>
</tr>
<tr>
<td>Data di nascita:</td>
<td><input type="text" name="data_nascita"><br></td>
</tr>
<tr>
<td>Luogo:</td>
<td><input type="text" name="luogo"><br></td>
</tr>
<tr>
<td>Titolo di studi:</td>
<td><input type="text" name="titolo_studi"><br></td>
</tr>
<tr>
<td>Mandati:</td>
<c:forEach items="${parlamentari.mandati}"
var="parlamentare.mandati">
<table>
<tr>
<td>Mandato:</td>
<!-- <td><c:import value="${parlamentare.mandati}"/></td> -->
<td><input type="text" name="parlamentare.mandati"><br></td>
</tr>
</table>
</c:forEach>
<!-- <input type="text" name="mandati"><br> -->
</tr>
<tr>
<td>Commissioni:</td>
<c:forEach items="${parlamentari.commissioni}"
var="parlamentare.commissioni">
<table>
<tr>
<td>Commissione:</td>
<!-- <td><c:import value="${parlamentare.commissione}"/></td> -->
<td><input type="text" name="parlamentare.commissioni"><br></td>
</tr>
</table>
</c:forEach>
<!--
<td><input type="text" name="commissioni"><br></td>
-->
</tr>
<tr>
<td>Periodi delle cariche:</td>
<c:forEach items="${parlamentari.periodi_cariche}"
var="parlamentare.periodi_cariche">
<table>
<tr>
<td>Periodi cariche:</td>
<!-- <td><c:import value="${parlamentare.periodi_cariche}"/>
</td> -->
<td><input type="text" name="parlamentare.periodo_carica">
<br></td>
</tr>
</table>
</c:forEach>
<!--
<td><input type="text" name="periodi_cariche"><br></td>
-->
</tr>
<tr>
<td> <input type="submit"><br></td>
</tr>
</table>
</form>
<h2>Leggi un parlamentare:</h2>
<form action="getParlamentare">
<table>
<tr>
<td>Nome:</td>
<td><input type="text" name="nome"><br></td>
</tr>
<tr>
<td>Partito:</td>
<td><input type="text" name="partito"><br></td>
</tr>
<tr>
<td>Circoscrizione:</td>
<td><input type="text" name="circoscrizione"><br></td>
</tr>
<tr>
<td><input type="submit"><br></td>
</tr>
</table>
</form>
<h2>Ricerca parlamentare in base al nome:</h2>
<form action="getParlamentare2">
<table>
<tr>
<td>Nome:</td>
<td><input type="text" name="nome"><br></td>
</tr>
<tr>
<td> <input type="submit"><br></td>
</tr>
</table>
</form>
<h2>Ricerca parlamentare in base al partito:</h2>
<form action="getParlamentare3">
<table>
<tr>
<td>Partito:</td>
<td><input type="text" name="partito"><br></td>
</tr>
<tr>
<td><input type="submit"><br></td>
</tr>
</table>
</form>
<h2>Ricerca parlamentare in base alla circoscrizione:</h2>
<form action="getParlamentare4">
<table>
<tr>
<td>Circoscrizione:</td>
<td> <input type="text" name="circoscrizione"><br></td>
</tr>
<tr>
<td><input type="submit"><br></td>
</tr>
</table>
</form>
<h2>Aggiorna un parlamentare:</h2>
<form action="updateParlamentare">
<h3>Inserisci il nome del parlamentare da modificare:</h3>
<table>
<tr>
<td>Nome:</td>
<td>
<input type="text" name="nome"><br>
</td>
</tr>
<tr>
<td>
<input type="submit"><br>
</td>
</tr>
</table>
<h3>Registra i nuovi dati:</h3>
<table>
<tr>
<td>Nome:</td>
<td><input type="text" name="nome"><br></td>
</tr>
<tr>
<td>Partito:</td>
<td><input type="text" name="partito"><br></td>
</tr>
<tr>
<td>Circoscrizione:</td>
<td><input type="text" name="circoscrizione"><br></td>
</tr>
<tr>
<td>Data di nascita:</td>
<td><input type="text" name="data_nascita"><br></td>
</tr>
<tr>
<td>Luogo:</td>
<td><input type="text" name="luogo"><br></td>
</tr>
<tr>
<td>Titolo di studi:</td>
<td><input type="text" name="titolo_studi"><br></td>
</tr>
<tr>
<td>Mandati:</td>
<c:forEach items="${parlamentari.mandati}"
var="parlamentare.mandati">
<table>
<tr>
<td>Mandato:</td>
<!-- <td><c:import value="${parlamentare.mandati}"/></td> -->
<td><input type="text" name="parlamentare.mandati"><br></td>
</tr>
</table>
</c:forEach>
<!--
<td><input type="text" name="mandati"><br></td>
-->
</tr>
<tr>
<td>Commissioni:</td>
<c:forEach items="${parlamentari.commissioni}"
var="parlamentare.commissioni">
<table>
<tr>
<td>Commissioni:</td>
<!-- <td><c:import value="${parlamentare.commissioni}"/></td> -
->
<td><input type="text" name="parlamentare.commissioni"><br>
</td>
</tr>
</table>
</c:forEach>
<!--
<td><input type="text" name="commissioni"><br></td>
-->
</tr>
<tr>
<td>Periodi delle cariche:</td>
<c:forEach items="${parlamentari.periodi_cariche}"
var="parlamentare.periodi_cariche">
<table>
<tr>
<td>Periodi cariche:</td>
<!-- <td><c:import value="${parlamentare.periodo_carica}"/>
</td> -->
<td><input type="text" name="parlamentare.periodi_cariche">
<br></td>
</tr>
</table>
</c:forEach>
<!--
<td><input type="text" name="periodi_cariche"><br></td>
-->
</tr>
<tr>
<td>
<input type="submit"><br>
</td>
</tr>
</table>
</form>
<h2>Elimina un parlamentare</h2>
<form action="deleteParlamentare">
<table>
<tr>
<td>Nome:</td>
<td>
<input type="text" name="nome"><br>
</td>
</tr>
<tr>
<td>
<input type="submit"><br>
</td>
</tr>
</table>
</form>
<h2>Lista dei parlamentari:</h2>
<form action="getParlamentari">
<c:forEach items="${parlamentari}" var="parlamentare">
<table>
<tr>
<td>Nome:</td>
<td><c:out value="${parlamentare.nome}"/></td>
</tr>
<tr>
<td>Partito:</td>
<td><c:out value="${parlamentare.partito}"/></td>
</tr>
<tr>
<td>Circoscrizione:</td>
<td><c:out value="${parlamentare.circoscrizione}"/><br></td>
</tr>
<tr>
<td>Data di nascita:</td>
<td><c:out value="${parlamentare.data_nascita}"/><br></td>
</tr>
<tr>
<td>Luogo:</td>
<td><c:out value="${parlamentare.luogo}"/><br></td>
</tr>
<tr>
<td>Titolo di studi:</td>
<td><c:out value="${parlamentare.titolo_studi}"/><br></td>
</tr>
<tr>
<td>Mandati:</td>
<c:forEach items="${parlamentari.mandati}"
var="parlamentare.mandati">
<table>
<tr>
<td>Mandato:</td>
<td><c:out value="${parlamentare.mandati}"/></td>
</tr>
</table>
</c:forEach>
<!--
<td><c:out value="${parlamentare.mandati}"/><br></td>
-->
</tr>
<tr>
<td>Commissioni:</td>
<c:forEach items="${parlamentari.commissioni}"
var="parlamentare.commissioni">
<table>
<tr>
<td>Commissione:</td>
<td><c:out value="${parlamentare.commissioni}"/></td>
</tr>
</table>
</c:forEach>
<!--
<td><c:out value="${parlamentare.commissioni}"/><br></td>
-->
</tr>
<tr>
<td>Periodi delle cariche:</td>
<c:forEach items="${parlamentari.periodi_cariche}"
var="parlamentare.periodi_cariche">
<table>
<tr>
<td>Periodo carica:</td>
<td><c:out value="${parlamentare.periodi_cariche}"/></td>
</tr>
</table>
</c:forEach>
<!--
<td><c:out value="${parlamentare.periodi_cariche}"/><br></td>
-->
</tr>
</table>
</c:forEach>
</form>
</body>
</html>