File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes how to do database progrmanning with Struts2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to do database progrmanning with Struts2" Watch "how to do database progrmanning with Struts2" New topic
Author

how to do database progrmanning with Struts2

sunil gupta
Greenhorn

Joined: May 07, 2008
Posts: 21
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

Joined: Apr 02, 2004
Posts: 884
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.


SCJP 1.4 * SCWCD 1.4 * SCBCD 1.3 * SCJA 1.0 * TOGAF 8
sunil gupta
Greenhorn

Joined: May 07, 2008
Posts: 21
ok then please guide me how to do database stuff with out the use of spring. please post some sample code.

Tahnks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to do database progrmanning with Struts2