Getting WebContext for thymeleaf in Vertx3.0?

441 views
Skip to first unread message

J0t1

unread,
Jul 14, 2015, 3:24:10 PM7/14/15
to ve...@googlegroups.com
Hi All,

We are using thymeleaf with Vertx 3.0 in our project. I am a newbie to both vertx and thymeleaf.

In the thymeleaf template I am specify form action as 
<form id="myform" th:action="@{/product/list}" method="POST">
and I am getting following error in vertx :
org.thymeleaf.exceptions.TemplateProcessingException: Link base "/product/list" cannot be context relative (/) or page relative unless you implement the org.thymeleaf.context.IWebContext interface

On googling for this error ,found that others have also faced same issue while trying to use thymeleaf template outside the scope of servlet request or in frameworks where servlet context is not available.Reference links:

What is the workaround for this in Vertx? Do we have any WebContext in vertx? Please suggest how to make context-relative-urls work in thymeleaf with Vertx.

Note: If i provide a server relative url  i.e. th:action="@{~/product/list}"  then it doesn't complain and my template loads just fine, but i am not sure if that's the right way to go about it!

Any help is much appreciated.

Tim Fox

unread,
Jul 15, 2015, 2:31:16 AM7/15/15
to ve...@googlegroups.com
As yet no-one has posted an issue for this. But if you could, then someone will look into it :)
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/445c56a8-1922-4b18-97fb-4304145319ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

J0t1

unread,
Jul 22, 2015, 6:34:10 AM7/22/15
to vert.x
Thanks for your reply Tim. I have opened a new issue for this here 
Reply all
Reply to author
Forward
0 new messages