티스토리 뷰
doGet, doPost 함수를 이용해서 html input 필드에 있는 값들을 가져오는 방법이다.
* html 파일
* servlet 파일
위와 같이 html이 servlet에 요청을 보내면 doGet이나 doPost 함수의 파라미터 request를 이용해 해당 필드의 값을 얻어올 수 있다.
또한 Get, Post함수에서 한글을 가져오려면 아래와 같은 처리를 해야한다.
* Get 함수
Tomcat 서버에서 Connector에 URIEncoding="EUC_KR"를 넣어준다.
* Post 함수
doPost 함수 내에서 request.setCharacterEncoding("EUC-KR"); 써야함.
'프로그래밍 > Web' 카테고리의 다른 글
IntelliJ로 Spring 프로젝트 생성 (0) | 2018.01.21 |
---|---|
Spring 특징 (0) | 2018.01.21 |
HTTP (0) | 2018.01.21 |
Get, Post로 값 가져오기 (0) | 2017.11.13 |
MVC 패턴 (0) | 2017.11.13 |
Get, Post 차이 (0) | 2017.11.13 |
댓글
공지사항
- Total
- 226,141
- Today
- 96
- Yesterday
- 102
링크
TAG
- spring batch
- Bean
- mybatis
- MySQL
- unity
- Bin
- Tasklet
- thymeleaf 변수 인식
- 클로저
- Check point within polygon
- Closure
- npm
- Express
- Barycentric coordinates
- thymeleaf cannot resolve
- JavaScript
- @Autowired
- Linux
- nodejs
- chunk
- @Bean
- spring
- @Component
- @Qualifier