Hi All, I am developing an application of Spring with hibernate. The problem is my data is getting saved in the database, but the success page is not being rendered.
RegisterController.java
springhibernate-servlet.xml
registrationform
One thing to notice is that the registrationform is rendered correctly, but the successView isn't. I also to use
in the RegisterController but its also not working.
Please Help as I am not able to resolve this issue. If any further clarifications are needed then please do tell me.
Vilmantas Baranauskas
Ranch Hand
Joined: Dec 20, 2006
Posts: 89
posted
0
I don't know Struts MVC well, but could it be that you are trying to redirect browser to ".../success".
I have 2 suggestions: - Install Firefox with LiveHTTPHeaders extension. Then you can see what redirect is sent to browser. - Try to use "new RedirectView("success.jsp",true)" and see if this works.
Author of <a href="http://www.newsinjector.com" target="_blank" rel="nofollow">NewsInjector</a>
Ok, sorry for posting garbage. I think that if you want to redirect to success.jsp, without using a controller, you'll have to give the path to the JSP, which means that it cannot be a path under WEB-INF. For example, in your context file :
Your controller. The whole point behind the "redirect:" prefix is to hide from the controller the fact that we are redirecting:
Under your root, you make a "jsps" directory and put success.jsp in it.
If you want to keep success.jsp under WEB-INF/jsps, I think that you'll have to make a controller in order to forward the request to the view, and make your successview look like :
If you don't go through a second controller, I don't see why you are redirecting anyway. You should be forwarding to the success page normally :
and
The big question is, why are you redirecting ?
T Ponraj
Greenhorn
Joined: Nov 07, 2007
Posts: 21
posted
0
Dear Sidharth,
I m learning Spring and Hiberate, Your sample code looks like very easy to understand, can you please post send me your src to understand SpringMVC and Hibernate
Christy Vasanth
Greenhorn
Joined: Feb 28, 2010
Posts: 1
posted
0
Hi,
Is it possible to display the same page in both
<property name="formView">
<property name="successView">..
for eg. createemployee page shld be displayed in success view (with emp details in it)after employee details are saved in DB...
This message was edited 1 time. Last update was at by Christy Vasanth