Hi, i've recently approached Magnolia and i'm trying to create a custom
controller (in a blossom module) that is supposed to be invoked when a
particular form gest submitted.
You can find the code below:
[quote]
@Controller
@Template(title="Form", id="form:components/form")
public class FormController {
@RequestMapping(value = "/myHome/Listini/Allegati", method =
RequestMethod.GET)
public String viewForm(@ModelAttribute Allegati contactForm,
BindingResult result, Node content) throws RepositoryException {
return "form:pages/form";
}
@RequestMapping(value = "/myHome/Listini/Allegati", method =
RequestMethod.POST)
public String handleSubmit(@ModelAttribute Allegati contactForm,
BindingResult result, Node content) throws RepositoryException {
return "website:" +
content.getProperty("successPage").getString();
}
}
[/quote]
It should be clear that the current implementation is not doing anything beside
receiving the requests and passing them on... however, I cannot get this
controller to work. I initally thought that the handleSubmit method would have
been enough, since I actually don't need to render the view in any particular
way, but that doesn't seem to be the case.
So I added the viewForm method, but I have no clow what it should return. I've
seen some examples where a reference to a .ftl file is passed, but, using the
standard form template, I have no such .flt to use.
Can anybody tell me what would be the correct way to do this?
I apologize if the code doesn't make any sense to you, but I really have no
clue what i'm doing...
--
Context is everything:
http://forum.magnolia-cms.com/forum/thread.html?threadId=4064ba49-653e-40a0-b01b-c30cb984015c
----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------