yeah.....there r multiple hyperlinked userids,which if clicked should search a database and display the corresponding data.To search the database ,i need the userid in some bean or in some attribute??how to send the corrresponding userid to a bean through clicking a hyperlink. eg: click hyperlinked<AS009> and i get the details of AS009 displayed in a new jsp
Hi, do you know what is MVC structure? Struts is based on it and developed. Your JSP cannot directly call DB to do the search function right? So you will need a "action" class to handle the user request on the server side. So you can put the value u want pass to DB into a attribute with a request in JSP, like this:
Then in your action class, you may need to get the attribute first, like this:
int clientID = Integer.parseInt((String) request.getParameter("clientID"));
from here, your action class can use the clientID and call DB class to do the search function already.
Hope this helps.
michelle Wang <br />SCJP 1.4
Joined: Dec 05, 2005
Thanx for the solution........But if it is desired that there should be no getparameter in the action class and that all the input paramters should be fetched from a Form class then is there any solution?
Joined: Jan 12, 2004
I only make use of the action Form that when the first page is really a "Form", which means the page has text fields, check box, dropdown menu these user input elements and you need to validate them. Nobody say when using struts must follow every thing inside right? I just combining all the knowledge i know and choose the most suitable one to make it works, that's all.