File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes regarding structure of code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "regarding structure of code" Watch "regarding structure of code" New topic
Author

regarding structure of code

Poonam Dhatavkar
Greenhorn

Joined: Jan 11, 2013
Posts: 19
Hello, i am a struts2 beginner.. i have code for 'searching' in that user is allowed to search data by a column name.
user enters a data in jsp and calls action and display in another jsp.



and a jsp page

i am using a separate java code for connection with database, in the same way i want to separate the a part of code containing database query. But then how to pass the parameters like tblName, searchparametername1 and searchvalue1 ???

Can anyone suggest me a logic ??
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8707
    
    6

Poonam Dhatavkar wrote:
But then how to pass the parameters like tblName, searchparametername1 and searchvalue1 ???


Pass them as parameters to the database method. The pattern you are thinking about is called a Data Access Object.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: regarding structure of code
 
Similar Threads
Distinct names for multiple buttons
Help in using bean inside JSP
when i retrive data from access it showing empty page in tomcat
how to know which servlet/jsp calling a particular servlet
How to Export web page(jsp page) to excel using jsp or servlets