File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Struct beginner Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struct beginner Question" Watch "Struct beginner Question" New topic

Struct beginner Question

rahan jain

Joined: Aug 28, 2006
Posts: 5
Hi ,

I am doing my application in structs but i am having a error
please excuse if it is a very silly question .

When i start my web logic server i get the error
failed to preload on startup in web application jaxax.sevlet.ServletException: org/apache/struts/legacy/GenericDataSource

apart from this while gettin connection i am using code
ServletContext context = servlet.getServletContext();
DataSource dataSource = (DataSource)context.getAttribute(Action.DATA_SOURCE_KEY);

In the second line i am getting warning the field Action.DATA_SOURCE_KEY is deprecated.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
My recommendation would be that you not use the Struts DataSource at all. The best practice for DataSources is to define them in your Application Server, and then use a JNDI (Java Naming and Directory Interface) lookup in your application classes to get reference to one of them.

Consultant, Sima Solutions
I agree. Here's the link:
subject: Struct beginner Question
It's not a secret anymore!