[精讚] [會員登入]
767

how to make wicket web application runs under docker enviorment with correct encoding

在docker環境下,wicket web application 編碼錯誤的問題

分享此文連結 //n.sfs.tw/15896

分享連結 how to make wicket web application runs under docker enviorment with correct encoding@外行中的外行
(文章歡迎轉載,務必尊重版權註明連結來源)
2022-07-11 13:16:30 最後編修
2022-07-11 13:16:12 By jung
 

由於專案建置的程式使用wicket framework產生前後端頁面,

在正式環境的LINUX系統沒有問題

但放到docker測試時就出現wicket 建立的 web component 無法正確識別UTF-8編碼

導致前端頁面呈現中文時會出現亂碼

解法其實很簡單,但網路上卻沒太多中文的提示

以下做個紀錄

在wicket 專案中繼承WebApplication的程式中

找到初始化的地方

@Override
    public void init() {
        super.init();

下面加上這一行

getMarkupSettings().setDefaultMarkupEncoding("UTF-8");

 

就完成了

END

你可能感興趣的文章

testing gitlab and jenkins CI/CD on docker-1 在docker架設gitlab, jenkins 測試CI/CD pipeline第一章

如何用git log功能產生有固定格式的commit紀錄 how to create a git commit history log file with custom format

using google Appscript to send messages through LINE NOTIFY 使用google app script傳送LINE NOTIFY

安裝netbeans9遇到的小狀況 how to show netbeans9 program onto ubuntu desktop

specific instructions to create a maven archetype from local existing project. Generate an archetype from the project

how to make wicket web application runs under docker enviorment with correct encoding 在docker環境下,wicket web application 編碼錯誤的問題

隨機好文

[網管心得]qnap+proxmox 韌體更新及nfs掛載或變更

回應 修正pom.xml,

setup jira using ssl on apache reverse proxy 設定jira使用https連線

在windows環境下強制刪除無法以檔案總管刪除的檔案或目錄 how to remove directories or files that cannot be deleted by default file manager

更新程式環境到wildfly18+openjdk11-phase2: update IDEA to jdk11 更新IDEA 編譯環境