I have a simple form on jsp file :
<form:form method="POST" class="my-form" id="dummyExtDelSubmitForm" name="dummyExtDELSubmitForm" action="/my-web/landingPage/showPage">
<input type="text" name="viewName" value="userRegistrationPage" >
<input type="submit" name="submitDummYForm" value="Submit" ></input>
</form:form>
on Spring MVC Controller I have the below method :
@RequestMapping(value = "/showPage", method = RequestMethod.POST)
public ModelAndView redirectToPage(@ModelAttribute("baseUserVO") BaseUserVO baseUserVO, HttpServletRequest request,Model model) throws BrownApplicationException {
HttpSession session = request.getSession();
if (baseUserVO != null && baseUserVO.getViewName()!=null) {
return new ModelAndView("redirect:" + viewName, CommonConstants.MODEL, model);
else{
return new ModelAndView("redirect:/landingPage/home.brd", CommonConstants.MODEL, model);
}
}
Problem is when I submit the form , the BaseUserVO object is populated sometimes and most of the time it is not. it works fine on Firefox without fail. I tried to see the request in fiddler , in the form submit request to showPage , i don't see the parameters going , as per the logic if the viewName is not present, then redierect to landingPage/home , in the later redirection I do see the viewName parameter.
Code for BaseUserVO which is just a POJO :
public class BaseUserVO {
private Integer userMasterId;
private String firstname;
private String lastname;
private Integer relationshipCode;
private String relationshipName;
private String userName;
private String userDisplayName;
private String viewName;
private String wpoId;
private String userType;
public Integer getUserMasterId() {
return userMasterId;
}
... getter seetter for other attributes.
Not sure whether it's a problem from Server side or client, Please reply if any clue.
Thanks, Lalit
Found the issue , its and IE with automatic authentication issue (see below Link), although no concrete solution so far but there are some workarounds.
http://blogs.msdn.com/b/ieinternals/archive/2010/11/22/internet-explorer-post-bodies-are-zero-bytes-in-length-when-authentication-challenges-are-expected.aspx?CommentPosted=true#commentmessage