๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
FOR SW ENGINEER๐Ÿ‘ฉ‍๐Ÿ’ป/JSP

JSP - ๊ฒฝ๋กœ ์ถœ๋ ฅ

by ์”จ๋‹ˆ 2021. 10. 31.
728x90

<๊ธฐ๋ณธ html๋ฐฉ์‹์œผ๋กœ ๊ฒฝ๋กœ ๋งคํ•‘>

๋”๋ณด๊ธฐ

<a href="http://www.google.com"> google </a>

 

<Request.get์œผ๋กœ ๊ฒฝ๋กœ ๋งคํ•‘>

-request.getContextPath() -> ๊ฐ€์žฅ์ฒ˜์Œ(?) root๊ฒฝ๋กœ ์ถœ๋ ฅํ•จ.

ex) jspํŒŒ์ผ>pathํŒŒ์ผ>requestํŒŒ์ผ์ด ์žˆ์œผ๋ฉด jspํŒŒ์ผ ๊ฒฝ๋กœ ๋ถˆ๋Ÿฌ์˜ด.

 

๊ฒฝ๋กœ

- ์ ˆ๋Œ€๊ฒฝ๋กœ : '/'๋กœ ์‹œ์ž‘ํ•˜๋Š” ๊ฒฝ๋กœ ์ž‘์„ฑํ•˜๋ฉฐ, ์›น ์ฝ˜ํ…์ธ  ๊ธฐ์ค€์œผ๋กœ ํ‘œํ˜„ํ•œ๋‹ค.

- ์ƒ๋Œ€๊ฒฝ๋กœ : '/'๋กœ ์‹œ์ž‘ํ•˜์ง€ ์•Š๋Š” ๊ฒฝ๋กœ๋ฅผ ์ž‘์„ฑํ•˜๋ฉฐ, ํ˜„์žฌ ํŒŒ์ผ์œ„์น˜ ๊ธฐ์ค€์œผ๋กœ ํ‘œํ˜„.

 

โ–ถ ์ ˆ๋Œ€๊ฒฝ๋กœ ํ‘œํ˜„๋ฐฉ๋ฒ• 2๊ฐ€์ง€

์ ˆ๋Œ€๊ฒฝ๋กœ ํ‘œํ˜„๋ฒ• 2๊ฐ€์ง€.

 

728x90