Al Coson

Greenhorn
+ Follow
since Nov 18, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Al Coson

Im using this for my cache provider: "org.hibernate.cache.NoCacheProvider". Why? I have not clue. Does it work? It sure does.
14 years ago
Are you sure you have supplyed the right cache provider? It seems as you have provided org.hibernate.hql.ast.ASTQueryTranslatorFactory Which by the look of the name doesn't have much to do with cache.

I dont know much about this, probably less than you, but id try replace that with something else. Like: org.hibernate.cache.EhCacheProvider

This is probably the solution to the other thread you alos posted.

Do tell how it goes.
14 years ago
It seems I was looking for the formbackingObject method.. I didnt know it did what it did, but it does what I need to do, that is, populate my form.
14 years ago
Note: Im using Spring for the view and buisiness layer, and Hibernate. But hibernate isn't important here. Im also really new to Spring.

I have created a form for adding items to my database, and it works. For that Im using a controller class that extends SimpleFormController.

I now want to reuse this controller and .jsp page for editing the verry same object as an editing page. In my mind the form would look almost exactly the same. So I changed the handleRequest method. And got the form successfully populated. But now I cant handle the submit part. My guess is that because I override the handleRequest method, the onsubmit method stops working i.e. aint being called. I havn't learned how to handle Log4j properly yet, so I dont know if onSubmit is being called or not, besides from the fact, knowing that nothing is being entered/changed into the DB.

This is what my Controller class looks like:





When this part gets called from my "index.jsp" view, it successfully populates the form with the information. But then I cannot submit it. Instead the same page is loaded as if the handleRequest is being called instead of onSubmit.
I know the onSubmit method works as Ive tested it before, when handleRequest wassnt implemented.


Can I please get suggestions on how to solve this? So that I can use this controller and .jsp page for both adding and editing an object.
Suggestions on how to solve this problem with another approach is also welcome.
Should I add any other information?
14 years ago