jsp navigation from different application

In one of my application ,i need to send request from one jsp to other jsp in different application.

Both the applications are gateweighed through plumtree portal and using MVC1(almost all serverside and client side code in jsp pages)

I.e

redirect from one jsp to other jsp in different application if there is no data in collection in first jsp.

===============================

[4/26/07 18:27:36:247 EDT] 16d9ac88 SystemOutO test.jsp - Error

=java.lang.IllegalStateException

[4/26/07 18:27:36:247 EDT] 16d9ac88 SystemOutO java.lang.IllegalStateException

[4/26/07 18:27:36:247 EDT] 16d9ac88 SystemOutO at

com.ibm.ws.webcontainer.srt.SRTServletResponseContext.sendRedirectWithStatusCode(SRTServletR

esponseContext.java:118)

================================

<table>

<tr><td>

<%

if(arrEngFindingRequests!=null && arrEngFindingRequests.size()>0){

.........

-

}else{

System.out.println("test.jsp - refereshing....test.jsp...");

response.sendRedirect(response.encodeURL("test_application2.jsp?no="+strNo+"&from=search"));

}

%>

<td>

<tr>

</table>

[1256 byte] By [raghuveer_vellankia] at [2007-11-27 2:34:01]
# 1

if the response is already committed, then you cannot issue a forward or redirect command.

The response commits when you

- commit it manually

- the response buffer is flushed (normally when it is full)

The most common solution is to do any forwards/redirects as close to the top of the JSP as possible.

Possibly you could increase the buffer size to help it <%@ page buffer="16kb" %>

Also, after issuing a sendRedirect() you should return; from the method to stop the rest of the code in the jsp executing.

evnafetsa at 2007-7-12 2:51:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Thanks for alternative solution.

One more clarification on below statement.

response.sendRedirect(response.encodeURL("test.jsp?no="+strNo+"&from=search"));

first time when page loads ELSE block in below code is executing ,after that if i referesh page is loading with data executing IF block.So it is the reason i added above statement in ELSE block.so that in case if the page doesn't load data by IF condition,it would execute ELSE block and referesh the page.

This this advisiable and correct way of doing?

raghuveer_vellankia at 2007-7-12 2:51:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...