直接写不好写,可以加个函数,代码:

<table>
      <tr th:each="file:${fileList}">
      	<td>打开文件 
		 <a href="#" th:onclick="'javascript:openPageOffice(\''+${file}+'\')'" th:text="${file}"></a>
		</td>
		<td>下载<a th:href="@{/fileDownload(fileName=${file})}"  th:text="${file }"></a></td>
      </tr>
    </table>
<script th:inline="javascript">
	function openPageOffice(file){
		POBrowser.openWindowModeless('/customWord?fileName='+file+'','width=1200px;height=800px;');
	}
</script>

更多推荐

thymeleaf th:href里面写javascript