You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Joseph Barefoot <jo...@hereuare.com> on 2002/03/12 00:05:12 UTC

simple frames problem, no help in archives

Hi all,

This problem is a bit annoying, because I have a fairly straight-forward
solution that inexplicably doesn't work.  As a preface, I have checked out
everything I could find related to frames in the archive, and nobody seems
to have encountered this particluar problem.

I have two simple frames, one a navigation bar dynamically generated from
form data, the other a view frame to show dynamically generated results when
the user clicks on a link in the nav-bar.  This MUST be implemented as two
frames, since the nav-bar is a tree-view of database table data (looks like
a file browser's nav-bar) and shouldn't be refreshed (esp. since we want to
retain opened nodes, etc.) when the view is changed.

So, this little application has:  3 JSP pages (frameset page, nav-bar frame,
view frame), 1 Action class, and 1 ActionForm, with a single global forward
for the Action and local forwards for the frameset and view pages (the
Action has session scope, b.t.w.).

The initial request (i.e., you can type this URL into a browser) is to the
Action class, with URL request parameters, and looks something like this:
http://localhost/txql.do?action=processTemplate&userID=someUser

This "txql" Action does some fancy processing, caches the results in the
ActionForm, and then forwards to the frameset page (all of this works fine,
yeaaa Struts!).  In this frameset page, the nav-bar frame "src" attribute
points back to the same Action class, which merely uses the value of the URL
param "action" to forward the browser to the correct JSP.  The only problem
with this is that it DOESN'T WORK (IE 5.0, Netscape 4.08, same behavior).
The Action class never receives the second request (to load the nav-bar
frame) at all, which I have tested exhaustively by printing the value of the
"action" parameter upon every execution of the "perfom" method inside the
Action.  I've examined the source received by both browsers for the frameset
page, and it has the correct request URL in each.

Here's the weird part:  When I test the same URL with the Konqueror web
browser packaged with KDE (Red-Hat Linux), the second request IS received by
the Action and processed correctly.  What gives?  I've tried using the
<html:base/> tag as well, with no effect.

Any ideas, anyone?  This is driving me nuts, quite frankly.  :)
Thanks in advance to anyone who can help clear this up...has to be a
mistaken assumption on my part or something....



The frameset page:


<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ page contentType="text/html"%>

<html>
<head>
<title>TXQL</title>
</head>
<body bgcolor="maroon">

<frameset frameborder="0" framespacing="0" border="0" cols="30%,*">
    <frame marginheight="0" marginwidth="0" name="navigator"
src="<html:rewrite page="/txql.do?action=TXQLNavigator"/>" target="view">
    <frame marginheight="0" marginwidth="0" name="view">

</frameset>

</body>
</html>





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


calling processActionForward from processesPreprocess in struts 1.0.2 & timeout checking

Posted by Brad Rhoads <br...@zethcon.com>.
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg15542.html

suggests calling processActionForward from unauthenticatedUser, which is
called from processesPreprocess, to handle timout checking. But in the
stable release processActionForward needs an ActionMapping parm. So I change
the example code to this:

private void unauthenticatedUser(
    HttpServletResponse iResponse,
    HttpServletRequest iRequest,
    String iRequestedPage)
    throws IOException, ServletException {

     HttpSession session = iRequest.getSession();

     ActionErrors errors = new ActionErrors();

    // redirect to the login servlet (passing parameter)

   String path = processPath(iRequest);

    this.log(" User is not logged on in session "
                            + session.getId());
    /*errors.add(ActionErrors.GLOBAL_ERROR,
                    new ActionError("error.notloggedin"));
    saveErrors(iRequest, errors);*/

    ActionForward logonForward = findForward("logon");
    ActionForward forward = new ActionForward(logonForward.getPath(), true);
    //forward.setPath(forward.getPath() + "?page=" + iRequestedPage);

    processForward(processMapping(path,iRequest), iRequest, iResponse);

}

This function is being called when a timout occurs, but the forward to my
logon page never happens. I just get a plain white screen. (The address bar
shows me the name of last screen I was on.)


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>