Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
URL のコンポーネントをプルしています。を使用request.getRequestURL()しましたが、URL が間違っているようです。たとえば、ID がありません。
request.getRequestURL()
私はこれを取得しています::
..//apka/grails/AAA/edit.dispatch"
しかし、私はこれが必要です:
..//apka/grails/AAA/edit/34"
解決策はありますか?
から必要な情報を取得できますrequest.forwardURI。これは、通常の HttpServletRequest への Grails 固有の追加です。得られるrequest.requestURL結果は、URL マッピング メカニズムの結果であり、常に/grails/controller/action.dispatch. これforwardURIは、URL マッピング メカニズムに入ったもの、つまりユーザーが最初に要求した URI です。
request.forwardURI
request.requestURL
/grails/controller/action.dispatch
forwardURI