This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Spring and the fly likes Passing parameter to query from JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Spring
Reply Bookmark "Passing parameter to query from JSP" Watch "Passing parameter to query from JSP" New topic
Author

Passing parameter to query from JSP

Caleb Jhay
Greenhorn

Joined: Apr 13, 2011
Posts: 18

Hi peeps sorry kinda newwith this thing. I’m currently developing my application I was able to save and list records in and from the database.

I was just wondering if how can I pass a paramaeter on my query from my JSP. I have this code on my controller




My problem is I jave a JSP with text box. Once I put a string on the text box I’m gonna use it as my parameter on my list. Lets say I entered “Caleb” on the text box how can I pass this to my controller and use “Caleb” to search the record with this name.


Thank you and Best Regards,
Caleb
Prasad Krishnegowda
Ranch Hand

Joined: Apr 25, 2010
Posts: 503

You can use request.getParameter.


Regards, Prasad
SCJP 5 (93%)
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Passing parameter to query from JSP
 
Similar Threads
Getting 404 even when the path looks ok
How to select column names using JP QL or however possible
How to display Database query in JSP?
Access variable value from Java file to Jsp file.
java.lang.NumberFormatException: For input string: