This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming 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
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Compiler error in Action class - configuring data source in struts-config.xml. Please help!

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is my Action class, "LoginAction.java"



Compiler error in line 1 in the above class, "The method getDataSource(HttpServletRequest) is undefined for the type LoginAction"

here is my struts-config.xml
----------------------------------



I added the jars, "commons-dbcp-1.4.jar" and "commons-pool-1.4.jar" the the eclipse build path, and /WEB-INF/lib
also to the tomcat(6.0.26)'s /WEB-INF/lib

Can anyone tell me why iam getting this compiler error in line 1 and also how to rectify the same?
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you look at the Javadocs for Struts 1.3 actions? I'd recommend that you do.
 
Anuradha Prasanna
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you please be more specific.
I would appreciate if somebody can explain with a simple example, how to configure datasources in struts 1.3.8.(as iam new to struts)
Iam using tomcat 6.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Outside of Struts. People generally use JNDI, Spring, Hibernate, etc.

A simple search, even just here on JavaRanch, would turn things like this up:

https://coderanch.com/t/58897/Struts/Application-Frameworks/Struts-Data-Source
https://coderanch.com/t/55621/Struts/Application-Frameworks/struts-with-datasource
 
it's a teeny, tiny, wafer thin ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!