That didn't seem to work either.... it seems like it's really bent on getting "command" from the request for some reason.
Just to be sure, in my home controller, I manually set a search string.
And on the tile jsp (where the form is), I printed it out to make sure that part is working. And that worked fine (I commented out the form code).Code:SearchForm s = new SearchForm(); s.setSearchString("searchstring"); WebUtils.setSessionAttribute(httpServletRequest, "command", s);
${sessionScope.command.searchString}
But as soon as i put the form code in there
I start to get "Neither BindingResult nor plain target object for bean name 'command' available as request attribute". Completely ignores the "command" object in the session.Code:<form:form id="searchForm" commandName="command" name="searchForm" method="post" action="search"> <form:input id="searchString" path="searchString"/> <input type="submit" id="search" name="_eventId_search" value="Search" /> </form:form>
What is not making sense to me is that how can we just say "action=search". How would it know what the form backing object is (it will after you submit, but when form is loading up)?
Usually, we have an action, and we link to that action, so it looks in the config file and sees what the form backing object, and calls formbackingobject. But here we are just using it without ever going to the action in the config file first.


Reply With Quote
