2013-02-17 13 views

回答

1

我解決了我的問題在webContent文件夾中創建索引文件,並設置索引並在名稱索引的struts.xml中創建一個操作。

1

您需要添加PreResultListener到你的動作:

public class MyInterceptor extends AbstractInterceptor { 
    private static final long serialVersionUID = 5065298925572763728L; 
    @Override 
    public String intercept(ActionInvocation invocation) throws Exception { 
     // Register a PreResultListener and implement the beforeReslut method 
     invocation.addPreResultListener(new PreResultListener() { 
     @Override 
     public void beforeResult(ActionInvocation invocation, String resultCode) { 
      //dostuff 
     } 
     }); 

     // Invocation Continue 
     return invocation.invoke(); 
    } 
    } 
} 

here服用。

+0

不,這不是我想要的。我的問題是如何在應用程序上調用攔截器或動作,然後根據動作返回的結果初始化視圖顯示。只是我說我的歡迎頁面是通過一個動作來完成的。 – 2013-02-18 16:55:23

相關問題