File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes JSP Doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP Doubt" Watch "JSP Doubt" New topic

JSP Doubt

Suresh Yadla

Joined: Mar 26, 2005
Posts: 12
I have a doubt. I have two modules A and B and both of them are in two different packages. Each Module has a JSP page and a Bean and a program has the logic for what to do when a search button is clicked and so on)

Both JSPs search data from database based on the selections and show the data in the results. Both the main page and results are in the same JSP with the help of taglibraries.

Now, When the search button in A is clicked I have to show the search results of B, so how can I do that without duplicating the code in module B?
Will a forward do, with setting the properties in Bean and then forwarding to the JSP in B ?

If anyone know then please let me know.


Suresh Yadla<br />SCJP, SCWCD, SCBCD<br /> <br />----------------------------------
Frederic Filiatrault
Ranch Hand

Joined: Jul 12, 2004
Posts: 69

More details would be needed, I think. Mainly, from the module A, I would fill the bean of the module B and forward to your B-JSP file, as you suggested.

I don't know for what reason you have 2 modules, I presume that it is two differents way to make a search. So, in this case, why are you not creating a 3rd module, for displaying results ? Just a suggestion.

If you could describe a little bit more what A & B is doing, I would able to answer you more in details. thk !


F.<br />SCJP, SCJD, SCWCD, SCBCD<br /> <br />Failure is not an option... It comes with the software bundle.
I agree. Here's the link:
subject: JSP Doubt
jQuery in Action, 3rd edition