You can set values in a form when you come to a page in Struts.
On 5/26/06, starki78 <[EMAIL PROTECTED]> wrote:
Thanks a lot Adam for your help! My solution that I currently have is to add a paramter withwait to a action, that should be coupled with a waiting-page. It works but do be honest I've to ask another person in the team on monday why it works and the request-parameters will now be forwarded! Are you interested in this solution? How to you know the real target action in the waiting.jsp? Thanks for your help I think after a short time I'll understand! <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib uri="struts-bean.tld" prefix="bean" %> <%@ taglib uri="struts-html.tld" prefix="html" %> <%@ taglib uri="struts-logic.tld" prefix="logic" %> <html:html> <head> <META http-equiv="CACHE-CONTROL" content="NO-CACHE"> <!-- For HTTP 1.1 --> <META http-equiv="PRAGMA" content="NO-CACHE"> <!-- For HTTP 1.0 --> <META http-equiv="refresh" content="0; URL=<bean:write name="action_path_key" property="actionPath"/>"> <title><bean:message key="pleasewait.text" bundle="PSS"/></title> <%@ include file="css.jspf"%> </head> <body onload="javascript:window.focus();"> <DIV id="pleasewait" style="position:absolute; visibility:visible; z-index:99; width:100%; height:99%; background-color:#ffffff"> <table border=0 width=100% height=100%> <tr> <td align=center class="hl1"> <bean:message key="pleasewait.text" bundle="PSS"/><br> <img src="<html:rewrite page="/images/arrow.gif"/>"> </td> </tr> </table> </DIV> </body> </html:html> > Starki, > > I assume you have a form or a link on a page that the user submits. Here > is a sample of a simple link with parameters: > > <jsp:useBean id="params" class="java.util.HashMap"/> > <c:set target="${params}" property="param1" value="value1"/> > <c:set target="${params}" property="param2" value="value2"/> > <html:link action="/someLongRunningAction" name="params">Do > Something</html:link> > > I'm making use of the set tag from the JSTL core tag library to set the > parameters into a HashMap, then linking the the action. > > The Action subclass I'm using is just a ForwardAction, which forwards to > "wait.jsp" > From struts-config.xml: > <action path="/someLongRunningAction" forward="/pages/wait.jsp" /> > > Then, in the wait.jsp page, I pull the request parameters from the > request instance (I'm using the runtime expression value version of the > set tag here) and store them in a page scope variable called > "parameters". Then I just set the url in the content attribute of the > meta http-equiv tag to the value rendered by the html rewrite tag, > passing the parameters map. > > <html:html> > <head> > <c_rt:set var="parameters" value="<%= request.getParameterMap() %>" > scope="page"/> > <meta http-equiv="refresh" content="0;url=<html:rewrite > action="/theRealTargetAction" name="parameters"/>"> > <title>Untitled Document</title> > </head> > > <body/> > </html:html> > > Hope that helps! > > > starki78 wrote: > > Hi Adam, an example > > would be great! > > > > This is really a great problem to us! > > Especially then the post method is called! > > > > Thanks a lot in advance > > Starky > > > > > > ---------- Initial Header ----------- > > > > >From : "Adam Samere" [EMAIL PROTECTED] > > To : "user" user@struts.apache.org > > Cc : > > Date : Tue, 23 May 2006 22:16:44 -0400 > > Subject : Re: How to pass request parameters through a waiting page? > > > > > > > > > > > > > > > > > >> Hi Starki! > >> > >> You should easily be able to grab the request parameters on your waiting page, then use them in the generated target URL. I'm assuming your waiting page > >> then redirects the user to the target page using meta tags or javascript, right? I'll be happy to provide an example if you'd like. > >> > >> Adam > >> > >> Hi! > >> > >> I set request-paramteres within an jsp > >> but introduced a waiting page to the next action. > >> Now the request parameter cannot be found anymore! > >> How can I achieve that the waiting jsp, recopies the > >> request-attributes? Is this possible in any way? > >> I don't want to write it to the session! > >> > >> Thanks a lot! > >> Starki > >> > >> > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > >> > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- "You can lead a horse to water but you cannot make it float on its back." ~Dakota Jack~ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]