Comments (3)
안녕하세요. 좋은 지적 감사드립니다.
Repository 관련 오류 관련해서 말씀하신대로 Example Query 관련해서 소스 코드 및 책 내용에 오류가 있었습니다.
소스 리포지토리에는 위에 커밋 표시된 것처럼 이미 반영해뒀으니 참고 부탁드립니다.
search후 redirect 오류 관련해서는 책 페이지나 예제 코드 번호를 함께 알려주시면 살펴보겠습니다.
다시 한 번 감사드리고, 보시다가 또 이상한 점 있으면 언제든 문의주세요.
from spring-boot-reactive.
안녕하세요.
Example Query 새로 반영해주신거로 테스트했더니 제대로 동작되는거 확인했습니다.
search 문의드렸던건 102페이지 리스트 2-30입니다.
Controller 코드에서 /search 처리 후 home.html을 반환하고 있습니다.
home.html에는 장바구니에 담긴 상품목록을 출력하기위해 cart.cartItems()를 통해 출력하고 있는데,
/search 결과에는 cart라는 객체가 담기지 않습니다.
(검색결과는 results에 담고있고, cart는 없습니다.)
따라서 cart가 null인 상태인데 home.html에서 cart.cartItems()로 접근하기때문에 문제가 발생한 것 같습니다.
빠른 회신 감사드리며, 좋은밤 되셔요:)
from spring-boot-reactive.
안녕하세요.
확인해보니 말씀대로 화면 템플릿에서는 items과 cart로 받아오고 있는데,
컨트롤러에서는 검색 결과만 results에 담아서 반환하고, items 와 cart 를 반환해주지 않아서 발생하는 오류네요.
지난 댓글에 언급해 주신 것처럼 검색 결과를 보여주는 아예 다른 화면(search.html)으로 리다이렉트하는 방식으로 해결할 수도 있겠고요,
저는 책 내용과의 일관성 유지를 위해 기존 home.html 에 렌더링 되는 것은 그대로 유지하고,
검색 결과를 items에 담고 cart도 추가로 모델에 담아 반환하는 방식으로 수정해서 올렸으니 참고 부탁드립니다.
좋은 지적 다시 한 번 감사드립니다.
책 재미있게 봐주시고, 이상한 점 있으면 언제든 또 문의주세요.
from spring-boot-reactive.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-boot-reactive.