[精讚] [會員登入]
536

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

你可能感興趣的文章

openssl package update issue caused by cve-2022-2068 centos7 is at maintenance support phase2, only critical impact security issues will be patched

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

[NetBeans]如何從git下載專案改建為自己的專案 修改git專案

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

how to stop wildfly keeping standalone server log how to stop wildfly keeping standalone server log

使用letsEncrypt替換docker容器內的nginx https憑證 using cerbot for nginx on oracle linux 9

我有話要說

>>

限制:留言最高字數1000字。 限制:未登入訪客,每則留言間隔需超過10分鐘,每日最多5則留言。

訪客留言

[無留言]

隨機好文

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

更新程式環境到wildfly18+openjdk11-phase1: upgrade mongodb server 更新程式環境到wildfly18+openjdk11-phase1: upgrade mongodb server to version 3.6

縣市端新增師生關係API程式 在縣市端建立可由教育部主機撈取縣市資料庫師生關係的API 程式

啟動chrome時要求須輸入密碼enter password to unlock login keyring asking for entering password to unlock login kerying on Ubuntu desktop

在ESXI6.7修改系統時間 how to modify esxi system time setting for good