struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph Nenning <Christoph.Nenn...@lex-com.net>
Subject Re: Use global result from another result
Date Thu, 08 Oct 2015 07:34:10 GMT
> From: JOSE L MARTINEZ-AVIAL <jlmagc@gmail.com>
> To: Struts Users Mailing List <user@struts.apache.org>, 
> Date: 07.10.2015 20:25
> Subject: Use global result from another result
> 
> Hello,
>   I have a global result defined as follows:
> <result name="message.handled.as.newtarget"
> type="tiles">common.error.screen.newtarget</result>
> 
> And then I have an action that can return success, and go to a specific 
and
> defined result, but in any other case I want the action to use the 
global
> result already defined. For example"
> 
>         <action name="downloadDocument"
>             class="com.test.DownloadDocument">
>             <result type="stream">
>                 <param name="inputName">documentStream</param>
>                 <param name="bufferSize">1024</param>
>                 <param name="allowCaching">true</param>
>             </result>
>             <result name="*">message.handled.as.newtarget</result>
>         </action>
> 
> So if the result is anything other than success (input, error, none),for
> example due to a invalid parameter, it should use
> message.handled.as.newtarget. Is there anyway to do this?
> 
> Thanks
> 
> JL


You could define the same result with several names:

<result name="input" type="tiles">common.error.screen.newtarget</result>
<result name="error" type="tiles">common.error.screen.newtarget</result>
<result name="none" type="tiles">common.error.screen.newtarget</result>


Regards,
Christoph

This Email was scanned by Sophos Anti Virus

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message