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

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript