티스토리 뷰
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
- 221,436
- Today
- 137
- Yesterday
- 53
링크
TAG
- thymeleaf cannot resolve
- nodejs
- Barycentric coordinates
- 클로저
- @Component
- @Autowired
- mybatis
- @Qualifier
- spring batch
- Closure
- Check point within polygon
- Bin
- npm
- thymeleaf 변수 인식
- unity
- @Bean
- MySQL
- Tasklet
- chunk
- JavaScript
- Linux
- Express
- spring
- Bean