I don't think there is a way of passing frame info directly to the HttpServletResponse. You do have to use a bit of Javascript. I wrote a support method for loading into a frame from servlet code. It's used something like
reloadFrame(response, "/myapp/Target.jsp");
In my code, the frame MUST have been given the same name as the jsp file without extension. For the above example, the frame could have been declared something like
<IFRAME name="Target" SRC="/myapp/Target.jsp"
scrolling=no></IFRAME>
The method itself:
protected void reloadFrame(HttpServletResponse response,
String frameURL)
throws IOException {
ServletOutputStream out = response.getOutputStream();
String frameName = (new File(frameURL)).getName();
StringTokenizer stok = new StringTokenizer(frameName, ".");
frameName = stok.nextToken();
out.println("<HTML><BODY>");
out.println("<SCRIPT LANGUAGE=\"JavaScript\">");
out.println("<!--");
out.println("frs = top.frames");
out.println("for (i = 0;i < frs.length;i++) {");
out.println(" if (frs[i].name == \"" + frameName + "\") {");
out.println(" top.frames[i].location.href=\"" + frameURL + "\"");
out.println(" break");
out.println(" }");
out.println("}");
out.println("// -->");
out.println("</SCRIPT>");
outputNoScript(out);
out.println("</BODY></HTML>");
}