“th:if” problems while sending url-coded informationCan't start Eclipse - Java was started but returned exit code=13Which spring view resolver plays nice with angularjs?Why is executing Java code in comments with certain Unicode characters allowed?Thymeleaf with nested (recursive) evaluation and th:replaceThymeleaf having problems using hash in the urlThymeleaf and JSP resolvers in one Spring MVC appSpringBoot with Thymeleaf showing error but workingProblem with sending an object to the ControllerThymeleaf PDF template parsing error when using fragmentSend image in thymeleaf

Smart people send dumb people to a new planet on a space craft that crashes into a body of water

Could IPv6 make NAT / port numbers redundant?

When a current flow in an inductor is interrupted, what limits the voltage rise?

How can I include a header file that contains `>` in its name?

Fastest way to perform complex search on pandas dataframe

Can a helicopter mask itself from Radar?

How to properly maintain eye contact with people that have distinctive facial features?

How can I grammatically understand "Wir über uns"?

Can you move on your turn, and then use the Ready Action to move again on another creature's turn?

Possible nonclassical ion from a bicyclic system

Modern approach to radio buttons

Can a non-EU citizen travel within the Schengen area without identity documents?

What is the 中 in ダウンロード中?

Term for checking piece whose opponent daren't capture it

Uncommanded roll at high speed

Is it possible to change original filename of an exe?

What is the indigenous Russian word for a wild boar?

What are the slash markings on Gatwick's 08R/26L?

Looking after a wayward brother in mother's will

Comment dit-on « I’ll tell you what » ?

Can I install a row of bricks on a slab to support a shed?

How did early x86 BIOS programmers manage to program full blown TUIs given very few bytes of ROM/EPROM?

Are UK pensions taxed twice?

What is/are this/these giant NASA box(es)?



“th:if” problems while sending url-coded information


Can't start Eclipse - Java was started but returned exit code=13Which spring view resolver plays nice with angularjs?Why is executing Java code in comments with certain Unicode characters allowed?Thymeleaf with nested (recursive) evaluation and th:replaceThymeleaf having problems using hash in the urlThymeleaf and JSP resolvers in one Spring MVC appSpringBoot with Thymeleaf showing error but workingProblem with sending an object to the ControllerThymeleaf PDF template parsing error when using fragmentSend image in thymeleaf






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








0















I'm starting coding with thymeleaf and also i'm not very advanced on HTML.
I'm setting up a webApp which manages a db. This has to add and modify three different entities.



The thing is that I want to make only one template for those three different forms. I think is not necessary to triplicate files since I can use some th:if tags. (I have to say that I'm an student and the notes the teacher gave us about thymeleaf are quite poor)



I have an index.html in which there is only 3 links redirecting to "../nuevo/P" ; "../nuevo/M" ; "../nuevo/E" .



Going into the controller, i have something like this:



@RequestMapping("/nuevo/dependencia")
public String enlace(@PathVariable(value="dependencia") char dependencia , Model model)

return "nuevoRegistro";



This goes into "nuevoRegistro" template...



<p th:text="'Nuevo '+ $dependencia" />
<div th:if="$dependencia == 'E'">
<form action="/nuevo/E" method="post">
<p>
<b>Modelo:</b> <input type='text' name='modelo' />
</p>

<p>
<b>Ano:</b> <input type='text' name='ano' />
</p>
/* some more fields
.
.
. */

<input type='submit' value='Enviar' />
</form>
</div>
<div th:if="$depencencia == 'M'">
<p>M</p>
</div>
<div th:if="$depencencia.equals('P')"> //I was only trying new things here
<p>P</p>
</div>


As far as I know, th:if does generate code if expression results true but im actually really confused with this $, @ ... tags and dont know very well how to use them as you can see.



I'm getting this error once i click any of the index links:




An error happened during template parsing (template: "class path
resource [templates/nuevoRegistro.html]")
org.thymeleaf.exceptions.TemplateInputException: An error happened
during template parsing (template: "class path resource
[templates/nuevoRegistro.html]")




and I suppose that the problem should be in the "th:if" statement.
What is wrong?
If I change the th:if statements maybe sometimes i get the "Nuevo + $dependencia" but im never getting the div I need.



Hope you can help me and thanks in advance!










share|improve this question
























  • whoops i forgot to write the error im getting

    – Diego F.
    Mar 24 at 10:37











  • The thymeleaf docs and examples are actually pretty good. Just take a look.

    – Martin Frey
    Mar 24 at 10:41











  • Edited. Thanks for the advice!

    – Diego F.
    Mar 24 at 10:45

















0















I'm starting coding with thymeleaf and also i'm not very advanced on HTML.
I'm setting up a webApp which manages a db. This has to add and modify three different entities.



The thing is that I want to make only one template for those three different forms. I think is not necessary to triplicate files since I can use some th:if tags. (I have to say that I'm an student and the notes the teacher gave us about thymeleaf are quite poor)



I have an index.html in which there is only 3 links redirecting to "../nuevo/P" ; "../nuevo/M" ; "../nuevo/E" .



Going into the controller, i have something like this:



@RequestMapping("/nuevo/dependencia")
public String enlace(@PathVariable(value="dependencia") char dependencia , Model model)

return "nuevoRegistro";



This goes into "nuevoRegistro" template...



<p th:text="'Nuevo '+ $dependencia" />
<div th:if="$dependencia == 'E'">
<form action="/nuevo/E" method="post">
<p>
<b>Modelo:</b> <input type='text' name='modelo' />
</p>

<p>
<b>Ano:</b> <input type='text' name='ano' />
</p>
/* some more fields
.
.
. */

<input type='submit' value='Enviar' />
</form>
</div>
<div th:if="$depencencia == 'M'">
<p>M</p>
</div>
<div th:if="$depencencia.equals('P')"> //I was only trying new things here
<p>P</p>
</div>


As far as I know, th:if does generate code if expression results true but im actually really confused with this $, @ ... tags and dont know very well how to use them as you can see.



I'm getting this error once i click any of the index links:




An error happened during template parsing (template: "class path
resource [templates/nuevoRegistro.html]")
org.thymeleaf.exceptions.TemplateInputException: An error happened
during template parsing (template: "class path resource
[templates/nuevoRegistro.html]")




and I suppose that the problem should be in the "th:if" statement.
What is wrong?
If I change the th:if statements maybe sometimes i get the "Nuevo + $dependencia" but im never getting the div I need.



Hope you can help me and thanks in advance!










share|improve this question
























  • whoops i forgot to write the error im getting

    – Diego F.
    Mar 24 at 10:37











  • The thymeleaf docs and examples are actually pretty good. Just take a look.

    – Martin Frey
    Mar 24 at 10:41











  • Edited. Thanks for the advice!

    – Diego F.
    Mar 24 at 10:45













0












0








0








I'm starting coding with thymeleaf and also i'm not very advanced on HTML.
I'm setting up a webApp which manages a db. This has to add and modify three different entities.



The thing is that I want to make only one template for those three different forms. I think is not necessary to triplicate files since I can use some th:if tags. (I have to say that I'm an student and the notes the teacher gave us about thymeleaf are quite poor)



I have an index.html in which there is only 3 links redirecting to "../nuevo/P" ; "../nuevo/M" ; "../nuevo/E" .



Going into the controller, i have something like this:



@RequestMapping("/nuevo/dependencia")
public String enlace(@PathVariable(value="dependencia") char dependencia , Model model)

return "nuevoRegistro";



This goes into "nuevoRegistro" template...



<p th:text="'Nuevo '+ $dependencia" />
<div th:if="$dependencia == 'E'">
<form action="/nuevo/E" method="post">
<p>
<b>Modelo:</b> <input type='text' name='modelo' />
</p>

<p>
<b>Ano:</b> <input type='text' name='ano' />
</p>
/* some more fields
.
.
. */

<input type='submit' value='Enviar' />
</form>
</div>
<div th:if="$depencencia == 'M'">
<p>M</p>
</div>
<div th:if="$depencencia.equals('P')"> //I was only trying new things here
<p>P</p>
</div>


As far as I know, th:if does generate code if expression results true but im actually really confused with this $, @ ... tags and dont know very well how to use them as you can see.



I'm getting this error once i click any of the index links:




An error happened during template parsing (template: "class path
resource [templates/nuevoRegistro.html]")
org.thymeleaf.exceptions.TemplateInputException: An error happened
during template parsing (template: "class path resource
[templates/nuevoRegistro.html]")




and I suppose that the problem should be in the "th:if" statement.
What is wrong?
If I change the th:if statements maybe sometimes i get the "Nuevo + $dependencia" but im never getting the div I need.



Hope you can help me and thanks in advance!










share|improve this question
















I'm starting coding with thymeleaf and also i'm not very advanced on HTML.
I'm setting up a webApp which manages a db. This has to add and modify three different entities.



The thing is that I want to make only one template for those three different forms. I think is not necessary to triplicate files since I can use some th:if tags. (I have to say that I'm an student and the notes the teacher gave us about thymeleaf are quite poor)



I have an index.html in which there is only 3 links redirecting to "../nuevo/P" ; "../nuevo/M" ; "../nuevo/E" .



Going into the controller, i have something like this:



@RequestMapping("/nuevo/dependencia")
public String enlace(@PathVariable(value="dependencia") char dependencia , Model model)

return "nuevoRegistro";



This goes into "nuevoRegistro" template...



<p th:text="'Nuevo '+ $dependencia" />
<div th:if="$dependencia == 'E'">
<form action="/nuevo/E" method="post">
<p>
<b>Modelo:</b> <input type='text' name='modelo' />
</p>

<p>
<b>Ano:</b> <input type='text' name='ano' />
</p>
/* some more fields
.
.
. */

<input type='submit' value='Enviar' />
</form>
</div>
<div th:if="$depencencia == 'M'">
<p>M</p>
</div>
<div th:if="$depencencia.equals('P')"> //I was only trying new things here
<p>P</p>
</div>


As far as I know, th:if does generate code if expression results true but im actually really confused with this $, @ ... tags and dont know very well how to use them as you can see.



I'm getting this error once i click any of the index links:




An error happened during template parsing (template: "class path
resource [templates/nuevoRegistro.html]")
org.thymeleaf.exceptions.TemplateInputException: An error happened
during template parsing (template: "class path resource
[templates/nuevoRegistro.html]")




and I suppose that the problem should be in the "th:if" statement.
What is wrong?
If I change the th:if statements maybe sometimes i get the "Nuevo + $dependencia" but im never getting the div I need.



Hope you can help me and thanks in advance!







java spring thymeleaf






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 24 at 10:44







Diego F.

















asked Mar 24 at 10:03









Diego F.Diego F.

94




94












  • whoops i forgot to write the error im getting

    – Diego F.
    Mar 24 at 10:37











  • The thymeleaf docs and examples are actually pretty good. Just take a look.

    – Martin Frey
    Mar 24 at 10:41











  • Edited. Thanks for the advice!

    – Diego F.
    Mar 24 at 10:45

















  • whoops i forgot to write the error im getting

    – Diego F.
    Mar 24 at 10:37











  • The thymeleaf docs and examples are actually pretty good. Just take a look.

    – Martin Frey
    Mar 24 at 10:41











  • Edited. Thanks for the advice!

    – Diego F.
    Mar 24 at 10:45
















whoops i forgot to write the error im getting

– Diego F.
Mar 24 at 10:37





whoops i forgot to write the error im getting

– Diego F.
Mar 24 at 10:37













The thymeleaf docs and examples are actually pretty good. Just take a look.

– Martin Frey
Mar 24 at 10:41





The thymeleaf docs and examples are actually pretty good. Just take a look.

– Martin Frey
Mar 24 at 10:41













Edited. Thanks for the advice!

– Diego F.
Mar 24 at 10:45





Edited. Thanks for the advice!

– Diego F.
Mar 24 at 10:45












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%2f55322615%2fthif-problems-while-sending-url-coded-information%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%2f55322615%2fthif-problems-while-sending-url-coded-information%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