2017-10-16 83 views
0

我有一個要求,如果URL包含路徑中的spring,那麼應該排除struts,並且應該處理spring調度程序servlet。Struts2排除模式的正則表達式問題

我曾嘗試下面的模式 常量名= 「struts.action.excludePattern」 值= 「.spring。」/>

URLS的忽略:http://localhost:8080/spring/getAllUsers http://localhost:8080/spring/getUserByName

,但我從struts獲取錯誤,如無動作映射。請建議使用

+0

[Jersey with Struts2]的可能重複(https://stackoverflow.com/questions/17293115/jersey-with-struts2) –

+0

'沒有行爲映射'意味着struts無法處理請求url的動作映射。更多關於這個錯誤[這裏](https://stackoverflow.com/a/40658006/573032)。 –

回答

0

使用.*表示零個或多個字符,如:

<constant name="struts.action.excludePattern" value=".*spring.*" /> 
+0

我現在應該使用什麼... –

+0

@Abirami,嘗試'<常數名稱=「struts.action.excludePattern」value =「。* spring。*」/>' –

+0

@yaser我認爲我嘗試相同的模式,如果是沒有錯 –