Page 1 of 1

Creating new html page in broadleaf demo

Posted: Wed Mar 20, 2013 2:21 am
by alluchandrasekhar
Hi all,


actually I am trying to do new form in html , when i click a new link in home page. My code is like below.

1) In the \site\src\main\webapp\WEB-INF\templates\layout\partials\header.html file

<a class="account" th:href="@{/chanduform}">New form...</a>

2) In the \site\src\main\java\com\heatclinic\controller\account\LoginController.java file

@RequestMapping("/chanduform")
public ModelAndView chanduForm(){
//String message = "Hello World, Spring 3.0!!!";
System.out.println("Chandu new form ....");
String message = "Hello World, Spring 3.0!!!";
return new ModelAndView("chanduform", "message", message);
}


3) and i had created new file site\src\main\webapp\WEB-INF\templates\authentication\chanduform.html

Code: Select all

  <div id="account">

   <div id="register">
      <h3>Register for an Account</h3>
      <p>Don't have an account yet? Sign up for one now to gain access to all our member tools.</p>      

   </div>   
        </div>
.



when i am clicking on the link I am getting this error... what happens exactly did not getting ...

HTTP ERROR 500

Problem accessing /chanduform. Reason:

Error resolving template "chanduform", template might not exist or might not be accessible by any of the configured Template Resolvers (layout/partials/head:8)

Caused by:

org.thymeleaf.exceptions.TemplateInputException: Error resolving template "chanduform", template might not exist or might not be accessible by any of the configured Template Resolvers (layout/partials/head:8)
at org.thymeleaf.TemplateRepository.getTemplate(TemplateRepository.java:247)
at org.thymeleaf.fragment.FragmentAndTarget.extractFragment(FragmentAndTarget.java:147)
at org.thymeleaf.processor.attr.AbstractFragmentHandlingAttrProcessor.processAttribute(AbstractFragmentHandlingAttrProcessor.java:70)
at org.thymeleaf.processor.attr.AbstractAttrProcessor.doProcess(AbstractAttrProcessor.java:74)
at org.thymeleaf.processor.AbstractProcessor.process(AbstractProcessor.java:212)
at org.thymeleaf.dom.Node.applyNextProcessor(Node.java:896)
at org.thymeleaf.dom.Node.processNode(Node.java:858)
at org.thymeleaf.dom.NestableNode.computeNextChild(NestableNode.java:639)
at org.thymeleaf.dom.NestableNode.doAdditionalProcess(NestableNode.java:621)
at org.thymeleaf.dom.Node.processNode(Node.java:876)
at org.thymeleaf.dom.NestableNode.computeNextChild(NestableNode.java:639)
at org.thymeleaf.dom.NestableNode.doAdditionalProcess(NestableNode.java:621)



.......................

Please help me .. i tried in internet to solve this problem .. but i unable to solve this ...

Thanks in advanced

chandu

Re: Creating new html page in broadleaf demo

Posted: Mon Mar 25, 2013 7:28 am
by alluchandrasekhar
this problem is cause of create new html file placement prolem only...

I solved that :D

Re: Creating new html page in broadleaf demo

Posted: Fri Jun 20, 2014 9:23 pm
by fax
hi
Could you please let me know the location ofthe file that worked for you. I am having same problem.

Re: Creating new html page in broadleaf demo

Posted: Mon Jun 23, 2014 11:21 am
by phillipuniverse
It depends on where you are actually putting the file. In the original post's case, he put it in WEB-INF/templates/authentication/chanduform.html. In order to return this view from the controller, you then have to return the string "authentication/chanduform".

The template resolver will automatically prepend the WEB-INF/templates and append .html onto the end.

Re: Creating new html page in broadleaf demo

Posted: Wed Jun 25, 2014 12:59 am
by fax
Thank you for the tip. It worked. I added "authentiacation" to the path.