Switch statement in thymeleaf doesn't workReplacements for switch statement in Python?Multiple cases in switch statementWhy can't variables be declared in a switch statement?Switch statement fallthrough in C#?Why can't I use switch statement on a String?How to write a switch statement in RubyWhat's the proper value for a checked attribute of an HTML checkbox?Switch statement multiple cases in JavaScriptUnescape XML with ThymeleafThymeleaf th:field doesn't bind the value for input text

Drawing Quarter-Circle

Is the schwa sound consistent?

Does the 500 feet falling cap apply per fall, or per turn?

Thesis' "Future Work" section – is it acceptable to omit personal involvement in a mentioned project?

Why was this sacrifice sufficient?

How are one-time password generators like Google Authenticator different from having two passwords?

semanage not changing file context

Control variables and other independent variables

What is the best way for a skeleton to impersonate human without using magic?

How do I tell my supervisor that he is choosing poor replacements for me while I am on maternity leave?

How can this pool heater gas line be disconnected?

How to make a language evolve quickly?

How does Howard Stark know this?

Why does the Earth follow an elliptical trajectory rather than a parabolic one?

Exception propagation: When to catch exceptions?

Why does a C.D.F need to be right-continuous?

On studying Computer Science vs. Software Engineering to become a proficient coder

Pre-1993 comic in which Wolverine's claws were turned to rubber?

How to align underlines in a cases environment

Why can't RGB or bicolour LEDs produce a decent yellow?

Why do Thanos's punches not kill Captain America or at least cause some mortal injuries?

How can a Lich look like a human without magic?

find not returning expected files

LocalDate.plus Incorrect Answer



Switch statement in thymeleaf doesn't work


Replacements for switch statement in Python?Multiple cases in switch statementWhy can't variables be declared in a switch statement?Switch statement fallthrough in C#?Why can't I use switch statement on a String?How to write a switch statement in RubyWhat's the proper value for a checked attribute of an HTML checkbox?Switch statement multiple cases in JavaScriptUnescape XML with ThymeleafThymeleaf th:field doesn't bind the value for input text






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















Im sending one parameter from controller. Parameter role. In html using thymeleaf when I print thath parameter with th:value I got value of that parameter. But when Im using th:switch it doesn't work. Here is code.



<input
th:value="$role"
id="role"
type="text"
>


print value "MANAGER" which I sent from controller



<th:block th:switch="$role">
<ul th:case="MANAGER" class="list-unstyled components">


It doesn't work. Any suggestions ?










share|improve this question

















  • 1





    I think you need single quotes around MANAGER.

    – Andrew
    Mar 23 at 19:07











  • Why dont you use sec:authorize Spring Security features with thymeleaf. Here is an example mkyong.com/spring-boot/…

    – Ahmet
    Mar 26 at 8:15

















0















Im sending one parameter from controller. Parameter role. In html using thymeleaf when I print thath parameter with th:value I got value of that parameter. But when Im using th:switch it doesn't work. Here is code.



<input
th:value="$role"
id="role"
type="text"
>


print value "MANAGER" which I sent from controller



<th:block th:switch="$role">
<ul th:case="MANAGER" class="list-unstyled components">


It doesn't work. Any suggestions ?










share|improve this question

















  • 1





    I think you need single quotes around MANAGER.

    – Andrew
    Mar 23 at 19:07











  • Why dont you use sec:authorize Spring Security features with thymeleaf. Here is an example mkyong.com/spring-boot/…

    – Ahmet
    Mar 26 at 8:15













0












0








0








Im sending one parameter from controller. Parameter role. In html using thymeleaf when I print thath parameter with th:value I got value of that parameter. But when Im using th:switch it doesn't work. Here is code.



<input
th:value="$role"
id="role"
type="text"
>


print value "MANAGER" which I sent from controller



<th:block th:switch="$role">
<ul th:case="MANAGER" class="list-unstyled components">


It doesn't work. Any suggestions ?










share|improve this question














Im sending one parameter from controller. Parameter role. In html using thymeleaf when I print thath parameter with th:value I got value of that parameter. But when Im using th:switch it doesn't work. Here is code.



<input
th:value="$role"
id="role"
type="text"
>


print value "MANAGER" which I sent from controller



<th:block th:switch="$role">
<ul th:case="MANAGER" class="list-unstyled components">


It doesn't work. Any suggestions ?







html switch-statement thymeleaf






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 23 at 11:06









DinoDino

112




112







  • 1





    I think you need single quotes around MANAGER.

    – Andrew
    Mar 23 at 19:07











  • Why dont you use sec:authorize Spring Security features with thymeleaf. Here is an example mkyong.com/spring-boot/…

    – Ahmet
    Mar 26 at 8:15












  • 1





    I think you need single quotes around MANAGER.

    – Andrew
    Mar 23 at 19:07











  • Why dont you use sec:authorize Spring Security features with thymeleaf. Here is an example mkyong.com/spring-boot/…

    – Ahmet
    Mar 26 at 8:15







1




1





I think you need single quotes around MANAGER.

– Andrew
Mar 23 at 19:07





I think you need single quotes around MANAGER.

– Andrew
Mar 23 at 19:07













Why dont you use sec:authorize Spring Security features with thymeleaf. Here is an example mkyong.com/spring-boot/…

– Ahmet
Mar 26 at 8:15





Why dont you use sec:authorize Spring Security features with thymeleaf. Here is an example mkyong.com/spring-boot/…

– Ahmet
Mar 26 at 8:15












0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55313049%2fswitch-statement-in-thymeleaf-doesnt-work%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55313049%2fswitch-statement-in-thymeleaf-doesnt-work%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현