You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Kishore Senji <ki...@gmail.com> on 2005/10/01 00:27:38 UTC

Re: logic:redirect w/ query string

You could specify paramId, paramName, paramProperty attributes in the exact
similar way to <html:link/>.

Please take a look at
http://struts.apache.org/userGuide/struts-logic.html#redirect

On 9/30/05, Doug Thomas <do...@softechnics.com> wrote:
>
> How do I create a logic:redirect element with a query string>
>
> I have:
>
> <logic:redirect forward="ERRORNOTIFY" />
>
> Where ERRORNOTIFY is defined in <global-forwards> of the struts-config.xml
> file and forwards to notifyError.jsp.
>
> I need to generate the following URL:
>
> notifyError.jsp?errMsg=some+error+message
>
> How to append the query string to the URL is the question.
>
> Doug
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

RE: logic:redirect w/ query string

Posted by Doug Thomas <do...@softechnics.com>.
Kishore,

I'm now trying to pass multiple request parameters. My code:

<bean:define id="msg" toScope="request">
	<bean:message key="app.notifyMsg.serverdisconnect"/>
</bean:define>
<bean:define id="forward" toScope="request">
"CONTINUE"
</bean:define>

<bean:define id="params" toScope="request">
<% Hashtable ht = new Hashtable();
ht.put("notifyMsg",msg);
ht.put("errCode",errCode);
%>
</bean:define>
<logic:redirect forward="ERRORNOTIFY" name="ht" />
(Also tried: logic:redirect forward="ERRORNOTIFY" name="params" />

Error message:

"Define tag can contain only one of name attribute, value attribute, or body
content"

Any suggestions?

Thanks,
Doug

-----Original Message-----
From: Kishore Senji [mailto:kishoresenji@gmail.com] 
Sent: Monday, October 03, 2005 2:29 PM
To: Doug Thomas
Cc: Struts Users Mailing List
Subject: Re: logic:redirect w/ query string

> <logic:redirect forward="ERRORNOTIFY" paramId="notifyMsg" paramName="msg"
> />
>
> Is this possible?


Yes, If you use <bean:define/> and <bean:message/> tags as in

<bean:define id="msg" toScope="request"><bean:message key="
app.err.serverdown"/></bean:define>
<logic:redirect forward="ERRORNOTIFY" paramId="notifyMsg" paramName="msg" />



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: logic:redirect w/ query string

Posted by Kishore Senji <ki...@gmail.com>.
> <logic:redirect forward="ERRORNOTIFY" paramId="notifyMsg" paramName="msg"
> />
>
> Is this possible?


Yes, If you use <bean:define/> and <bean:message/> tags as in

<bean:define id="msg" toScope="request"><bean:message key="
app.err.serverdown"/></bean:define>
<logic:redirect forward="ERRORNOTIFY" paramId="notifyMsg" paramName="msg" />

RE: logic:redirect w/ query string

Posted by Doug Thomas <do...@softechnics.com>.
Please bear with me - I'm new to struts.

I've been to the link provided by Kishore, but this implies I have to obtain
my parameters from a Java bean. I want to create the message in my JSP, with
i18n, similar to the following:

<logic:redirect forward="ERRORNOTIFY" paramId="notifyMsg"
	paramName=<bean:message key="app.err.serverdown" />
</logic:notPresent>

And without the use of scriplets, as in:

<%
String myMsg = "Server disconnect -<br/><br/>Your work to this point has
been saved.<br/><br/>Please re-login.";
request.setAttribute("msg",myMsg);
%>
<logic:redirect forward="ERRORNOTIFY" paramId="notifyMsg" paramName="msg" />

Is this possible?


-----Original Message-----
From: Kishore Senji [mailto:kishoresenji@gmail.com] 
Sent: Friday, September 30, 2005 6:28 PM
To: Struts Users Mailing List
Subject: Re: logic:redirect w/ query string

You could specify paramId, paramName, paramProperty attributes in the exact
similar way to <html:link/>.

Please take a look at
http://struts.apache.org/userGuide/struts-logic.html#redirect




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org