| Author |
Spring MVC JDBC
|
karl czukoski
Greenhorn
Joined: Dec 30, 2010
Posts: 18
|
|
Hello Everybody, I am trying to figure out how to get the following query to work. In a jsp file, so named page1.jsp, contains
a href with a property listing name that a user selects such as "Phillies" ( ${teamsNLEast.name} ). This property name is then
passed into a variable called teamName to then be subsequently directed to the where clause in the following query.
Here is the class that contains the query and uses the getJdbcTemplate and query methods to process the sql statement, with the
where clause set to teamName, and assigns it to a List of players.
This is where the returned sql result from above will call the mapRow() method to match the value player_name in the database
and set it to the player object.
This class implements a getPlayers method that returns a playerlisting to a player data access object from the provided
teamName argument.
And finally my question arises at the Controller where the getPlayers method ought to be passed the teamName string. Though,
when I try to do that I'm receiving a compilation error. Does anyone have an idea on what I'm doing wrong? Your help is
greatly appreciated.
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 23635
|
|
|
MLBControllerPage2 doesn't have a player manager injected or passed as a parameter. Therefore it can't compile because a dependency is missing.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Certs: SCEA Part 1, Part 2 & 3 & Core Spring 3, OCAJP
|
 |
karl czukoski
Greenhorn
Joined: Dec 30, 2010
Posts: 18
|
|
Jeanne Boyarsky wrote:MLBControllerPage2 doesn't have a player manager injected or passed as a parameter. Therefore it can't compile because a dependency is missing.
Thanks Jeanne, could you provide some more detail or an example on how this particular injection is performed?
|
 |
 |
|
|
subject: Spring MVC JDBC
|
|
|