我怎麼能動態輪廓號碼映射到一個servlet例如如何將動態配置文件編號映射到servlet?
http://stackoverflow.com/questions/2585407
我想這個2585407映射到一個servlet這可能嗎?
感謝
我怎麼能動態輪廓號碼映射到一個servlet例如如何將動態配置文件編號映射到servlet?
http://stackoverflow.com/questions/2585407
我想這個2585407映射到一個servlet這可能嗎?
感謝
是的,可以有多種選擇:
questions?id=2585407
,然後閱讀請求參數/questions/*
(在web.xml中),然後解析getRequestURI()
(通過剝離前綴和request.getContextPath()
)如果你的<url-mapping>
設置爲 /questions/*
,那麼你會
使用以下的URL映射模式
/questions/*
通過使用request.getPathInfo()
(請求是HttpServletRequest
)獲得您的問題ID。
相關:http://stackoverflow.com/questions/2913351/jsp-servlets-simple-question/2913396#2913396 – BalusC 2011-04-21 14:13:06