Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to do database progrmanning with Struts2

 
sunil gupta
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, i m starting a new project and was wondering how to do database connectivity and access, i had a sample progrm from struts1+spring+hibernate it works fine. do i need to use spring with struts2 also. how to go ahead.

i migrated to struts 2 my strut1 app and it is not working, when i use

public static ApplicationContext getContext(HttpServletRequest httpRequest) {
return WebApplicationContextUtils.getRequiredWebApplicationContext(
httpRequest.getSession().getServletContext());
}

i m getting null value, something is wrong and i have no clue at all what to do.
 
Chengwei Lee
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do i need to use spring with struts2 also. how to go ahead.

No, you need not use Spring with Struts 2.

i migrated to struts 2 my strut1 app and it is not working

Take a look at the migration guides. If you're talking about a sample application, I would actually suggest you starting fresh with Struts 2 rather than migrating. Of course all the business logics that you'd coded should be re-usable in Struts 2 as well.
 
sunil gupta
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok then please guide me how to do database stuff with out the use of spring. please post some sample code.

Tahnks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic