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 21:32:08 UTC

RE: simple frames problem, no help in archives -- fixed, thanks Robert

Okay, give me the "I'm the biggest moron on the planet" hat to wear for the
rest of the day.  The prescence of the body tags  in the frameset page were
definitely confusing the browser.  Sorry to waste everyone's time on this
(odd that IE and Netscape make no complaint though, huh?).  I'm not sure if
browsers are "forgiving" or just plain stupid sometimes.

Once again, I am a victim of cut-n'-paste...Robert, thanks so much for
noticing those errant tags, they might as well have been invisible from my
perspective.  Forest for the trees and all that, you know.  :)



-----Original Message-----
From: Robert Nocera [mailto:rnocera@neosllc.com]
Sent: Tuesday, March 12, 2002 11:31 AM
To: 'Struts Users Mailing List'; josephb@hereuare.com
Subject: RE: simple frames problem, no help in archives


Try it without the <body> tags.

Robert Nocera
New England Open Solutions
www.neosllc.com
"You supply the vision, we'll do the rest."


-----Original Message-----
From: Joseph Barefoot [mailto:josephb@hereuare.com]
Sent: Tuesday, March 12, 2002 2:14 PM
To: Struts Users Mailing List
Subject: RE: simple frames problem, no help in archives

Steve,

	Thanks for the insight on how you're managing the workflow with
forms and
frames...it will come in handy later.  Right now, however, I can't even
get
the damn frame source to load, period, from my frameset page, even on
the
initial request.  Do you use the same  "action forward to frameset page,
then action forward for frame source(s)" flow to get the frames
source(s) to
load properly using an Action class?  Or do you load the frame sources
through some other means?

If I could get the frame source to load properly, I'd be fine, as I have
NO
forms on either page, just generated URLs with attached URL query
parameters
in the left-frame nav-bar page.  When a user clicks on one of these, the
correct generated data is displayed in the right-frame view page.

Out of sheer curiosity, if you're having to refresh both frames with
every
request anyway, why not use dynamic includes for the search and results
jsps
in your main.jsp instead?  That's currently how I'm getting my system to
work:  a two-column, single row table with one jsp included on the left
cell, the other on the right cell.  Works fine, but I'm super-annoyed
with
the left side being refreshed with every navigation request (click) the
user
makes, which is why I want the frames version to work BADLY.

Thanks for the help,

Joe

-----Original Message-----
From: Steve Earl [mailto:stevee@Infogain.co.uk]
Sent: Tuesday, March 12, 2002 2:28 AM
To: 'Struts Users Mailing List'
Subject: RE: simple frames problem, no help in archives


Joseph,

I'm currently developing a multi-framed web-app using struts and have
had no
end of fun. I agree there isn't a great deal in the archive.

My situation sounds somewhat similar to yours in that I have a
two-framed
page. The upper page has a search form whilst the lower should, when the
search is submitted show either the results of the search or errors if
the
form is filled out incorrectly.

The way we're running things at the moment is to have a main.jsp
containing
a frameset with the two (search and results) jsps within the frameset.
Within the <form> tag on the search frame I have target="_top". In the
struts-config file, the action mapping for the search page has an action
forward back to the main page.

So, the flow is that when a user submits the form, the form is
validated,
results are read from the database into a results object and we then get
forwarded back to the main.jsp, leading to the redrawing of the two
frames.
To enable this to work we've had to define the search form bean and
results
object in session scope. I also had to write a new <html:errors> tag to
read
errors from the session rather than from the request and store form
validation errors within the session rather than the normal struts way
of
sticking them in the request. Then, logic within the results.jsp when
rendering the page first checks if there are any errors on the session
and
renders them to the screen if there are. If there are no errors it looks
for
a results object on the session and draws that. If there are neither of
those (as would be expected on the first entry into the page) then the
user
just sees a blank screen.

This method is working at present but it is leading to a great deal of
redrawing. We're using Mozilla as the browser. It's worth noting that if
you're using Netscape then you can set the target frame within your code
in
the Action class, avoiding forwarding back to the main.jsp page and
redrawing everything. This doesn't work with either IE or Mozilla
though.

Hope this helps - if anyone has a cleaner way of doing what I've
described
then let me know!!

regards,

__________________________________
Steve Earl


-----Original Message-----
From: Joseph Barefoot [mailto:josephb@hereuare.com]
Sent: Monday, March 11, 2002 11:05 PM
To: Struts Users Mailing List
Subject: 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>

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


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


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


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