• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Probably a very simple Spring problem?

Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using Spring 2

I have 2 JSP pages both have SimpleFormControllers behind them -

public class LoginController extends SimpleFormController{

public class ListReturnsController extends SimpleFormController{

what I want to do is when the Login button is pressed on login.jsp control passes to listreturns.jsp and methods like ListReturnsController's referenceData() get called to prepopulate it etc... BEFORE the actual listreturns.jsp is displayed?

I thought this would very simple but as a newbie it's not to be!

So basically my login.jsp looks like this -

<form:form method="POST" action="login.htm" commandName="login">
<input type="submit" name="_login" value="Login" />

In LoginController - onSubmit() I'm doing this -

protected ModelAndView onSubmit(HttpServletRequest request, ..........) throws Exception
if (WebUtils.hasSubmitParameter(request, "_cancel"))
return new ModelAndView("listreturns");

but listreturns.jsp is opened WITHOUT referenceData() being called!

Can anyone help? - I know it's bound to be sonething stupid I'm doing/not doing but just can't see it at the moment?

my config file looks like this -

<bean id="loginController"
<property name="formView" value="login" />
<property name="successView" value="listreturns" />

<bean id="listReturnsController"
<property name="formView" value="listreturns" />
<property name="successView" value="changepassword" />

<bean id="changePasswordController"
<property name="formView" value="changepassword" />
<property name="successView" value="listreturns" />

<bean id="urlMapping"
<property name="mappings">
<prop key="/login.htm">loginController</prop>
<prop key="/listreturns.htm">listReturnsController</prop>
<prop key="/changepasssword.htm">changePasswordController</prop>

<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass">
<property name="prefix">
<property name="suffix">

thanks in advance & hope I've explained this properly!

A Harry
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in fact just noticed in the logging output I get this -

<Rendering view with name 'listreturns' with model null and static attributes {}>

surely the model should be an object not null?
Your mother was a hamster and your father was a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!