TP11

Modérateurs : graffiop, jmdouin, agoncal, mlebihan

velitc_v
Messages : 64
Inscription : 04 oct. 2019 14:53

TP11

Message par velitc_v » 14 janv. 2020 23:48

Bonjour,
J’ai un soucis sur /addToCart : Required String parameter 'itemId' is not present
je ne comprends pas trop car c’est donné ! je ne pense pas avoir touché qlqch… Auriez vous une piste ?
merci

Code : Tout sélectionner

Hibernate: select category0_.id as id1_0_0_, category0_.description as descript2_0_0_, category0_.name as name3_0_0_ from T_CATEGORY category0_ where category0_.id=?

Hibernate: select product0_.id as id1_5_, product0_.category_fk as category4_5_, product0_.description as descript2_5_, product0_.name as name3_5_ from T_PRODUCT product0_ where product0_.category_fk=?

Hibernate: select product0_.id as id1_5_0_, product0_.category_fk as category4_5_0_, product0_.description as descript2_5_0_, product0_.name as name3_5_0_, category1_.id as id1_0_1_, category1_.description as descript2_0_1_, category1_.name as name3_0_1_ from T_PRODUCT product0_ left outer join T_CATEGORY category1_ on product0_.category_fk=category1_.id where product0_.id=?

Hibernate: select item0_.id as id1_2_, item0_.IMAGE_PATH as IMAGE_PA2_2_, item0_.name as name3_2_, item0_.product_fk as product_5_2_, item0_.UNIT_COST as UNIT_COS4_2_ from T_ITEM item0_ where item0_.product_fk=?

Hibernate: select product0_.id as id1_5_0_, product0_.category_fk as category4_5_0_, product0_.description as descript2_5_0_, product0_.name as name3_5_0_, category1_.id as id1_0_1_, category1_.description as descript2_0_1_, category1_.name as name3_0_1_ from T_PRODUCT product0_ left outer join T_CATEGORY category1_ on product0_.category_fk=category1_.id where product0_.id=?

2020-01-14 22:26:29.023 ERROR 9219 --- [nio-8080-exec-6] c.y.p.e.api.CustomExceptionHandler       : Request: http://localhost:8080/petstore/addToCart raised org.springframework.web.bind.MissingServletRequestParameterException: Required String parameter 'itemId' is not present
2020-01-14 22:26:29.023 ERROR 9219 --- [nio-8080-exec-6] c.y.p.e.api.CustomExceptionHandler       : Required String parameter 'itemId' is not present

harrak_z
Messages : 66
Inscription : 19 oct. 2019 20:15

Re: TP11

Message par harrak_z » 15 janv. 2020 1:16

Dans la page html item.html vérifie la syntaxe de ton href doit être comme celà <a th:href="@{'/addToCart?itemId='+${itemDTO.id}}"....> </a>

velitc_v
Messages : 64
Inscription : 04 oct. 2019 14:53

Re: TP11

Message par velitc_v » 15 janv. 2020 20:35

effectivement c'est un get... merci :)

Répondre