토요일이다.
하지만 저번에 선생님이 건강검진을 받으셔야 했던 이유로 공강을 했던 적이 있기 때문에
오늘도 보강을 하며 프로젝트를 진행중이다.
게시물 상세보기는 참 구현하기 힘들다.
requestScope를 찾아보고 있다.
https://programmingsummaries.tistory.com/833
여기서 알게된 사실은
get이나 post방식으로 넘어온 값들을 ${param.이름}형식으로 가져와야 하고,
request.setAttribute("이름", "값");으로 저장한 값들은 ${request.이름}형식으로 가져온다는 사실을 기억하자.
였다.
index.jsp를 수정하고
org.springframework.web.bind.annotation
Annotation Type RequestParam
-
@Target(value=PARAMETER) @Retention(value=RUNTIME) @Documented public @interface RequestParamAnnotation which indicates that a method parameter should be bound to a web request parameter.
Supported for annotated handler methods in Spring MVC and Spring WebFlux as follows:
- In Spring MVC, "request parameters" map to query parameters, form data, and parts in multipart requests. This is because the Servlet API combines query parameters and form data into a single map called "parameters", and that includes automatic parsing of the request body.
- In Spring WebFlux, "request parameters" map to query parameters only. To work with all 3, query, form data, and multipart data, you can use data binding to a command object annotated with ModelAttribute.
If the method parameter type is Map and a request parameter name is specified, then the request parameter value is converted to a Map assuming an appropriate conversion strategy is available.
If the method parameter is Map<String, String> or MultiValueMap<String, String> and a parameter name is not specified, then the map parameter is populated with all request parameter names and values.
Since:2.5Author:Arjen Poutsma, Juergen Hoeller, Sam BrannenSee Also:RequestMapping, RequestHeader, CookieValue
-
- Optional Element SummaryOptional ElementsModifier and TypeOptional Element and Description
java.lang.String defaultValue The default value to use as a fallback when the request parameter is not provided or has an empty value.
java.lang.String name The name of the request parameter to bind to.
boolean required Whether the parameter is required.
java.lang.String value Alias for name().
- Optional Element SummaryOptional ElementsModifier and TypeOptional Element and Description
'내가 쓰는 글 > 일상' 카테고리의 다른 글
웹 프로젝트 6일차 - 피곤해도 계속 간다 (0) | 2019.04.02 |
---|---|
웹 프로젝트 5일차 - 다시 시작 (0) | 2019.04.01 |
웹 프로젝트 3일차 - 협상 (0) | 2019.03.29 |
웹프로젝트 2일차 - 오늘은 나아진걸까? (0) | 2019.03.28 |
웹프로젝트 1일차 - 좌절의 날 (0) | 2019.03.27 |
댓글