Thymeleaf cannot parse URL query parameters
P粉619896145
P粉619896145 2023-08-14 15:57:04
0
1
375

I'm using Thymeleaf version 2.1.4 and I want to print a string when sending query parameters to the URL. But it prints a string object, like this [Ljava.lang.String;@767a8ed5. I try to print it like this in HTML:

The URL is like this:

http://localhost:8000/about?message=This is about page.

Appreciate the error in my code and hope for help.

P粉619896145
P粉619896145

reply all (1)
P粉762730205

The Param object returns an array of strings for each parameter, even if the parameter has only one value, which is why you see the object reference[Ljava.lang.String;@767a8ed5. You can access the first element of the array using indexing like this:

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!