I think the struts user list doens't allow attachments?? So i send the code in plain 
text here-under

--begin-of-file--

/*
 * Created on 2-dec-2003
 * @author jvb
 * @version $Revision
 *
 * 
 */
package be.post.ars.common.taglib;

import javax.servlet.jsp.JspException;

import org.apache.struts.taglib.bean.MessageTag;
import org.apache.struts.util.RequestUtils;
import org.apache.struts.util.ResponseUtils;

/**
 * @author jvb
 *
 * To change the template for this generated type comment go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
public class PropMessageTag extends MessageTag {

        
        /* (non-Javadoc)
         * @see javax.servlet.jsp.tagext.Tag#doStartTag()
         */
        public int doStartTag() throws JspException {
                String key = this.key;
                if (key == null) {
                        // Look up the requested property value
                        Object value =
                                RequestUtils.lookup(pageContext, name, property, 
scope);
                        if (value != null && !(value instanceof String)) {
                                JspException e = new JspException
                                        (messages.getMessage("message.property", key));
                                RequestUtils.saveException(pageContext, e);
                                throw e;
                        }
                        key = (String)value;
                } else {
                        if (name != null || property != null) {
                                Object value =
                                        RequestUtils.lookup(pageContext, name, 
property, scope);
                                if (value != null && !(value instanceof String)) {
                                        JspException e = new JspException
                                                
(messages.getMessage("message.property", key));
                                        RequestUtils.saveException(pageContext, e);
                                        throw e;
                                }
                                key=key+"."+(String)value;
                        }
                }

        // Construct the optional arguments array we will be using
        Object args[] = new Object[5];
        args[0] = arg0;
        args[1] = arg1;
        args[2] = arg2;
        args[3] = arg3;
        args[4] = arg4;

        // Retrieve the message string we are looking for
        String message = RequestUtils.message(pageContext, this.bundle,
                                                                                       
   this.localeKey, key, args);
        if (message == null) {
                JspException e = new JspException
                (messages.getMessage("message.message", "\"" + key + "\""));
                        RequestUtils.saveException(pageContext, e);
                        throw e;
                }

        // Print the retrieved message to our output writer
                ResponseUtils.write(pageContext, message);

        // Continue processing this page
        return (SKIP_BODY);

        }

}


--end-of-file--

-----Original Message-----
From: VAN BROECK Jimmy [mailto:[EMAIL PROTECTED]
Sent: maandag 19 januari 2004 13:55
To: Struts Users Mailing List
Subject: RE: <bean:message> WITH <bean:write> ?!?


I've already send the source file to the user list.

Enjoy!


-----Original Message-----
From: Oliver Thiel [mailto:[EMAIL PROTECTED]
Sent: maandag 19 januari 2004 13:37
To: 'Struts Users Mailing List'
Subject: AW: <bean:message> WITH <bean:write> ?!?


Hi Jimmy,


Of course I'm interested in seeing your extension of the bean:message
tag!

Thanks
Oliver

-----Ursprüngliche Nachricht-----
Von: Mark Nichols [mailto:[EMAIL PROTECTED] 
Gesendet: Montag, 19. Januar 2004 13:03
An: Struts Users Mailing List
Betreff: Re: <bean:message> WITH <bean:write> ?!?

Jimmy,

I would be interested in seeing your extension of the bean:message tag.

Thanks,

Mark

--
"Science is what we understand well enough to explain to a computer. 
Art is everything else."
-- Donald Knuth
On Jan 19, 2004, at 2:34 AM, VAN BROECK Jimmy wrote:

> Hi,
>
> for the moment there isn't a solution for that in Struts.
>
> You can two things with bean:message. That is provide a static key or 
> define a dynmic key. but you cannot combine the two.
>
> What i have done is to extend the bean:message tag to implement this 
> kind of functionality.
>
> Let me know if you are interested in the code. Its just a quick hack 
> of the struts code.
>
> Greetings
> Jimmy
>
>
> -----Original Message-----
> From: Oliver Thiel [mailto:[EMAIL PROTECTED]
> Sent: maandag 19 januari 2004 9:14
> To: [EMAIL PROTECTED]
> Subject: <bean:message> WITH <bean:write> ?!?
>
>
> Hi all,
>
>
> In my HashMap (which defines the form) I save something like that:
> setField("username", "oliver"); Know I want to the output of the 
> message
> to be dynamic.
>
> For a static version this works fine:
> <bean:message key="form.username"/>
>
> For a dynamic version I think I need some thing like that: 
> <bean:message
> key="form.<bean:write name="field" property="key" />"/>
>
> But the code above does not work! Has anyone an idea?
>
>
> THX
> Oliver
>
>
>
> STRICTLY PERSONAL AND CONFIDENTIAL
> This message may contain confidential and proprietary material for the

> sole use of the intended recipient. Any review or distribution by 
> others is strictly prohibited. If you are not the intended recipient 
> please contact the sender and delete all copies.
>
> Ce Message est uniquement destiné aux destinataires indiqués et peut 
> contenir des informations confidentielles. Si vous n'êtes pas le 
> destinataire, vous ne devez pas révéler le contenu de ce message ou en

> prendre copie. Si vous avez reçu ce message par erreur, veuillez en 
> informer l'expéditeur, ou La Poste immédiatement, avant de le 
> supprimer.
>
> Dit bericht is enkel bestemd voor de aangeduide ontvangers en kan 
> vertrouwelijke informatie bevatten. Als u niet de ontvanger bent, dan 
> mag u de inhoud van dit bericht niet bekendmaken noch kopiëren. Als u 
> dit bericht per vergissing heeft ontvangen, gelieve er de afzender of 
> De Post onmiddellijk van op de hoogte te brengen en het bericht 
> vervolgens te verwijderen.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



STRICTLY PERSONAL AND CONFIDENTIAL
This message may contain confidential and proprietary material for the sole use of the 
intended recipient. Any review or distribution by others is strictly prohibited. If 
you are not the intended recipient please contact the sender and delete all copies.

Ce Message est uniquement destiné aux destinataires indiqués et peut contenir des 
informations confidentielles. Si vous n'êtes pas le destinataire, vous ne devez pas 
révéler le contenu de ce message ou en prendre copie. Si vous avez reçu ce message par 
erreur, veuillez en informer l'expéditeur, ou La Poste immédiatement, avant de le 
supprimer.

Dit bericht is enkel bestemd voor de aangeduide ontvangers en kan vertrouwelijke 
informatie bevatten. Als u niet de ontvanger bent, dan mag u de inhoud van dit bericht 
niet bekendmaken noch kopiëren. Als u dit bericht per vergissing heeft ontvangen, 
gelieve er de afzender of De Post onmiddellijk van op de hoogte te brengen en het 
bericht vervolgens te verwijderen.


STRICTLY PERSONAL AND CONFIDENTIAL
This message may contain confidential and proprietary material for the sole use of the 
intended recipient. Any review or distribution by others is strictly prohibited. If 
you are not the intended recipient please contact the sender and delete all copies.

Ce Message est uniquement destiné aux destinataires indiqués et peut contenir des 
informations confidentielles. Si vous n'êtes pas le destinataire, vous ne devez pas 
révéler le contenu de ce message ou en prendre copie. Si vous avez reçu ce message par 
erreur, veuillez en informer l'expéditeur, ou La Poste immédiatement, avant de le 
supprimer.

Dit bericht is enkel bestemd voor de aangeduide ontvangers en kan vertrouwelijke 
informatie bevatten. Als u niet de ontvanger bent, dan mag u de inhoud van dit bericht 
niet bekendmaken noch kopiëren. Als u dit bericht per vergissing heeft ontvangen, 
gelieve er de afzender of De Post onmiddellijk van op de hoogte te brengen en het 
bericht vervolgens te verwijderen.

Reply via email to