If you're going to use the Struts framework, you might as well do things in the Struts way.
The "Struts way" is to associate an Action and ActionForm with a JSP, and have Struts call the Action class when the form is submitted.
When I'm writing a search page, I typically do what you're doing: Use the same JSP for both entering search criteria and displaying results. I just put <logic:notEmpty></logic:notEmpty> tags around the result table so that it's only visible if there are results to display.
I'm not clear on whether it's even possible to call a java class from javascript)?
Before AJAX, I would have given an unqualified "No" to this question. The answer is still technically no, but now there are ways that make it seem as though you're calling server-side java from client-side JavaScript.
I'd recommend you look into the
DWR if you want more information on how this is possible.
The problem is, though, that even if you get the results in JavaScript, you then have the tedious task of modifying the page using the Document Object Model (DOM) and JavaScript. It's much easier just to submit the form and redisplay the page with the results. In a situation like this, the difference in response time between this and the AJAX solution would be negligible.
[ July 20, 2006: Message edited by: Merrill Higginson ]