Home > front end >  The background is Chinese garbled in the JSP page
The background is Chinese garbled in the JSP page

Time:09-20

To realize the download function, English background can take to the value, but Chinese is to get the code




The serial number & lt;/th>
The head of the household & lt;/td>
File name & lt;/td>
Archives classification & lt;/td>
Storage period & lt;/td>
A storage medium & lt;/td>
File & lt;/td>
Upload time & lt;/td>
Operation & lt;/th>




The ${files. Sort} & lt;/td>
The ${files. Family. The host} & lt;/td>
The ${files. The file} & lt;/td>
${files. Type} & lt;/td>
The ${files. The term} & lt;/td>
The ${files. The carrier} & lt;/td>

Download & lt;/a>

The ${files. Uploadtime} & lt;/td>

Modify & lt;/a>
Delete & lt;/a>








Image file name column that ${files. The file} has been in the page to Chinese value, according to the "script" now I'm going to click on the download transfer the ${files. The file} name to the background, can receive normal English, the Chinese is only the code

@ Controller
Public class DownLoadController {

@ RequestMapping (value="https://bbs.csdn.net/download")
Public String download (it request, HttpServletResponse response) throws IOException, ServletException {
Request. SetCharacterEncoding (" utf-8 ");//this line not
FilePath String filePath=request. The getParameter (" ");
System. The out. Println (filePath);//gibberish in Chinese, English is normal
  • Related