mercredi 8 avril 2015

Page Template is missing rather Only jsp page is comming without Template in Magnolia-bossom

I am doing an Spring application using Magnolia CMS.


This is my controller :



@Controller
@Template(title = "Unlock Form", id = "newPositionModule:components/unlockAccount")
public class UnlockAccountComponent {

@Autowired
private LoginServiceImpl loginServiceImpl;

@Autowired
private JavaMailSender mailSender;


@RequestMapping(value = "/unlockAccount", method = RequestMethod.GET)
public String render(@ModelAttribute("resetForm")ResetForm resetForm) {

return "components/unlockAccountForm.jsp";
}
@RequestMapping(value = "/unlockAccount", method = RequestMethod.POST)
public String reset(@ModelAttribute("resetForm")ResetForm resetForm,HttpServletRequest request,BindingResult result) {
ResetFormValidator validReset = new ResetFormValidator();
validReset.validate(resetForm, result);
if (result.hasErrors()) {
return "components/unlockAccountForm.jsp";
}
.....
.....
}
}


This page/ component is configuring within a template called e.g main .


the page content as follows :



----------------------------------------------
<some header>
----------------------------------------------

<form:form id="unlockAccForm" action="?" commandName="resetForm" method="POST">
<blossom:pecid-input />
<div class="form-group">
<form:input path="resetMail" placeholder="Email address or mobile no." id="" class="form-control"/>
<form:errors path="resetMail" cssClass="errorMessage" />
</div>
<div class="form-group">
<button class="lgn_btn" type="submit">Unlock Account</button>
</div>
</form:form>
----------------------------------------------------------
<some footer>
----------------------------------------------------------


When I am submitting the form, error message is coming as it is validating with the validator you can see in controller.


But only jsp is coming but template is missing like header and footer is missing.


To get the error message we should not redirect the page as error message won't come due to new request object formation.


can any one suggest me how to resolve this issue.


What i am missing or did anything wrong with the code.


if any one need more query or more details that i did not provide, please can ask me.


Do reply ASAP.


Aucun commentaire:

Enregistrer un commentaire