Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

how to do database progrmanning with Struts2

 
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.
 
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
 
I carry this gun in case a vending machine doesn't give me my fritos. This gun and this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic