Yes, AJAX would be the way to go. We do this heavily in our custom portlets.
In first.jsp you could put something like this...
We have a huge investment into jQuery, so even though we have moved to LR6 we still are using jQuery for our custom portlets.
1<div id="content">
2 <button onclick="goToPage2()">Go to page 2</button>
3</div>
4
5<script type="text/javascript">
6 var xyz_urls = new Object;
7 xyz_urls.render = '<portlet:renderURL windowState="exclusive" />';
8 xyz_urls.actionFoo = '<portlet:actionURL windowState="exclusive" name="foo" />';
9 //... and so on as needed
10
11function goToPage2() {
12 jQuery.ajax({
13 url:xyz_urls.render,
14 data:{'page':'next.jsp',
15 type:'post',
16 success:function(res){jQuery('#content').html(res)}
17 });
18 }
19</script>
On the server side in the doView of the Dispatcher you will have to look at the "page" request variable and call the JSP you desire there.
I'm sure there are many way to do it (possibly better), but this is a simple example. It's not exactly how we are handling it, but it gives you an idea of the kind of logic you would want.
Please sign in to flag this as inappropriate.