This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Compiler error in Action class - configuring data source in struts-config.xml. Please help! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Compiler error in Action class - configuring data source in struts-config.xml. Please help!" Watch "Compiler error in Action class - configuring data source in struts-config.xml. Please help!" New topic
Author

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

Anuradha Prasanna
Ranch Hand

Joined: Mar 09, 2006
Posts: 115
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?


SCJP 6.0 90%
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Did you look at the Javadocs for Struts 1.3 actions? I'd recommend that you do.
Anuradha Prasanna
Ranch Hand

Joined: Mar 09, 2006
Posts: 115
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
Rancher

Joined: Sep 29, 2008
Posts: 12617

Outside of Struts. People generally use JNDI, Spring, Hibernate, etc.

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

http://www.coderanch.com/t/58897/Struts/Application-Frameworks/Struts-Data-Source
http://www.coderanch.com/t/55621/Struts/Application-Frameworks/struts-with-datasource
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Compiler error in Action class - configuring data source in struts-config.xml. Please help!
 
Similar Threads
servlet action is not availbe
Problem in Struts Application while connecting to database
Spring Struts implementation for Database conncetion problem in Login module
Struts 1.1 problem with form validation
logic:iterate pls any body help me