struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henning Jensen" <h...@online.no>
Subject RE: dynamic value for ActionForwards ?
Date Tue, 25 Mar 2003 17:18:37 GMT
Yes, that's one way, but why don't use struts' ActionMessage ?
example:

in action:
ActionMessages messages = new ActionMessages();
messages.add("",new ActionMessage("my.key.when.sucess"));
this.saveMessages(request, messages);
mapping.findForward("result");

in jsp:
<html:messages id="message" message="true">
    <bean:write name="message"/>
</html:messages>

it displays the key you specified in the action, of course this is only
useful when mapping to the same jsp/servlet when success or failure

Mvh Henning Jensen

> -----Original Message-----
> From: David Graham [mailto:dgraham1980@hotmail.com]
> Sent: Tuesday, March 25, 2003 6:10 PM
> To: struts-user@jakarta.apache.org
> Subject: Re: dynamic value for ActionForwards ?
>
>
> You can put the key name into the request and using struts-el do:
> <bean:message key="${mykey}"/>
>
> David
>
>
> >From: Matthias Wessendorf <mailings@matthias-wessendorf.de>
> >Reply-To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
> >To: Struts Users Mailing List <struts-user@jakarta.apache.org>
> >Subject: dynamic value for ActionForwards ?
> >Date: 25 Mar 2003 18:10:58 +0100
> >
> >Hello,
> >
> >if have got some action-classes, all doing handel a request
> >and in case off success, they forward an actionForward.
> >like this:
> >
> >perform() {
> >
> >boolean tmp = doSomeThing();
> >
> >if(tmp) {
> >	actionForward = mapping.findForward("done");
> >}
> >else {
> >	actionForward = mapping.findForward("bad");
> >
> >}
> >
> >the jsp for "done" and "bad" are they same...
> >but in one point they are different.
> >
> >one has this Tag
> ><struts-bean:message key="done"/>
> >
> >and the other one has got a tag like this
> ><struts-bean:message key="bad"/>
> >
> >
> >Now there is my question, is the an "elegant" way to manage this problem
> >because the count of my jsp-files grows and grows and grows... ;-)
> >
> >Thank you very much...
> >
> >Greetings
> >
> >Matthias
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
>
>
> _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>


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


Mime
View raw message