struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Viggio, Alex" <>
Subject Hijacking ActionErrors to display in frames
Date Tue, 14 Jan 2003 18:05:10 GMT
I'm having a problem due to the frame-based layout of one of our pages.
Because the framing page (w/ the frameset/frames definition) gets the
request first, the ActionErrors in the request don't make it down to the
sub-frame pages. Is it possible to "hijack" the action errors via a scriplet
in the framing page that forwards the ActionErrors (as ActionErrors) along
to one or more framed JSPs.

I found the following posting, but I'd prefer to forward the actual
ActionErrors instead of just an HTML string representation.

Anyone have experience with this? What is the identifying name for the
ActionErrors object in the request?

- Alex


Solved: ActionErrors within frames manually forwarded


From: holger.wiechert 
Subject: Solved: ActionErrors within frames manually forwarded 
Date: Tue, 05 Feb 2002 10:42:10 -0800 


Well, after an eternity, the problem found was
that the ApplicationResources property "errors.header" 
had a value with double quotes in it (like <font color="red">).
That spoiled the src string in the frame page.

Have fun,

-----Urspr√ľngliche Nachricht-----
Von: []
Gesendet am:    Dienstag, 5. Februar 2002 12:37
Betreff:        ActionErrors within frames manually forwarded


I've spent some time checking the list for this issue,
but I could only find related topics, that didn't really help. 
In case that this has been answered before, please ignore it
and send me a link.

I think that there must be something I've missed
when using the Struts validation feature within frames.
In short: I'm trying to manually retrieve and "forward" the ActionErrors
within a frame definition page (which is the "input" page
for a mapping). But those manually set request parameters
are gone when I access them.

The situation is as follows:

The page myframe.jsp consists of two frames: 
mynavigation.jsp and myContent.jsp. 
myContent.jsp is the JSP that is validated. 
In case that a validation error (ActionError) occurs,
the follwoing (relevant) events occur (correct me if I'm wrong)
- Struts puts the ActionErrors I created within validate into the request
- a forward to the "input" page is done as defined in the struts-config (in
  my case the "action" entry is:
    <action  path="/myContentActionPath"
      <forward name="back" path="/somePrev.jsp"/>
      <forward name="next" path="/someNext.jsp"/>

  so it leads to the frame page.
- within the myframe.jsp, two new requests are created: one for each frame

But I think I should still be able to access the request with the
within the frame definition page. So in myframe.jsp I could do something

<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
        <meta http-equiv="Content-Type" content="text/html;
<frameset cols="150,*" frameborder="no" border="0" framespacing=0> 
  <frame src="myNavigation.jsp" NAME="Menue">
  <frame src="myContent.jsp?manuallySetParam=<html:errors 
property="myErrorProperty"/>" NAME="content">

in order to retrieve the ActionError String for property "myErrorProperty"
within the content page:



<P> <%= request.getParameter("manuallySetParam") %> </P>


This - I agree - doesn't look elegant, but at least it should work.

If I have the input page defined as a pure jsp (no frames),
the html:errors are retrieved as expected.

Are there any ideas, why the parameter "manuallySetParam" does not
contain the error message of key "myErrorProperty" ?

Help and/or design suggestions greatly appreciated!

Thanks in advance,

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message