これは可能ですか?index.jspに行くと、ファイルを書き換えたい...
ありがとう!
index.jsp は、ユーザーがhttp://example.com/context/homeなどの特定の URL を要求した後に表示されるビューですか?
その場合、 /home のコントローラー要求マッピングで、そこで必要なことを実行できます。
おそらく、これを行う Spring のような方法は、インターセプターを定義してから、指定された URL 用に構成することです。
インターセプター クラスは次のようになります。
public class RewriteInterceptor extends HandlerInterceptorAdapter {
// implementation
}
構成は次のようになります。
<mvc:interceptors>
<mvc:interceptor>
<mapping path="/index.jsp"/>
<bean class="your.path.RewriteInteceptor" />
</mvc:interceptor> </mvc:interceptors>
index.jsp のリクエストが来るたびに呼び出されるフィルタを作成できます。このフィルタは、index.jsp ページをロードする前に呼び出されます。フィルタに関するチュートリアルへのリンクは次のとおりです。
http://viralpatel.net/blogs/tutorial-java-servlet-filter-example-using-eclipse-apache-tomcat/