• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struct beginner Question

 
rahan jain
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic