This week's book giveaway is in the
Agile and other Processes
forum.
We're giving away four copies of
The Mikado Method
and have Ola Ellnestam and Daniel Brolund on-line!
See
this thread
for details.
A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Java
»
JSF
Author
JSF, strange form action generated
Jochen Szostek
Ranch Hand
Joined: Mar 23, 2008
Posts: 42
I like...
posted
Dec 30, 2008 19:33:00
0
Hello all,
I'm having a problem with the
JSF
form action.
My spring controller is mapped to /users/form.html GET and POST requests:
@Controller @RequestMapping("/users/form.html") public class UserFormController { @RequestMapping(method = RequestMethod.GET) public void form(Model model) { model.addAttribute(MA_USER, new User()); } @RequestMapping(method = RequestMethod.POST) public String form(@ModelAttribute(MA_USER) User user, BindingResult result) { return "users/confirm"; }
But JSF generates an action to "/www.appletree.be/WEB-INF/views/en_GB/users/form.html":
<form target="/users/form.html" onsubmit="return validateMyForm(this)" enctype="application/x-www-form-urlencoded" [B]action="/www.appletree.be/WEB-INF/views/en_GB/users/form.html"[/B] method="post" name="userForm" id="userForm">
So my controller doesn't pick up the action of the form.
If I use firebug to change the action (in firefox) to /users/form.html the action does get picked up as it should by my controller.
I'm using Spring Web Flow btw to my flow handling but I guess this hasn't got anything to do with my issue.
All tips more than welcome since I'm a bit lost here!
Thanks in advance and have a nice day!
Bauke Scholtz
Ranch Hand
Joined: Oct 08, 2006
Posts: 2458
posted
Jan 05, 2009 06:22:37
0
I would suspect Spring rather than JSF. It is Spring who specified the form action and passed it to the JSF. Try a Spring forum.
Code depot of a Java EE / JSF developer
|
JSF / Eclipse / Tomcat kickoff tutorial
|
DAO kickoff tutorial
|
I ♥ Unicode
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: JSF, strange form action generated
Similar Threads
@Controller annotation query
Within the infrastruture - How to and Where - to intercept HTTP request and to send HTTP response?
Spring MVC: Getting resource not available for one Request Mapping while its working for the others.
controller with Spring annotation ?
spring MVC 3 binding help
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter