Home > Default > Netui:error tag uses deprecated ActionError

Netui:error tag uses deprecated ActionError

November 30Hits:0
Advertisement
Can anyone tell me if there's a good reason why netui:error tag refers to the deprecated ActionError as opposed to ActionMessage?
It means I cannot do this as I get a ClassCastException:
<pre>
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
errors.add("test", new ActionMessage("someError"));
return errors;
</pre>
Instead I am forced to use a deprecated class. As ActionError inherits from ActionMessage, I can't really see why it is referenced.
Regards
James

Answers

I also encountered the same issue when I was working with this issue. I could not figure out how to do it so I came with a work around maybe this will help you.
In my JSP I use the following code:
<%
// this part gets the i18n messages which netui:errors tags are not capable of
ActionErrors actionerrors = (ActionErrors)request.getAttribute("org.apache.struts.action.ERROR");
if(actionerrors != null)
%>
<i18n:getMessage messageName="errors.header" />
<%
Iterator it = actionerrors.get();
while(it.hasNext())
ActionError e = (ActionError) it.next();
%>
<i18n:getMessage messageName="errors.prefix" />
<i18n:getMessage messageName="<%=e.getKey()%>" />
<i18n:getMessage messageName="errors.suffix" />
<%
%>
<i18n:getMessage messageName="errors.footer" />
<%
%>

Read other 7 answers

Tags:

Related Articles

  • Netui:error tag uses deprecated ActionErrorNovember 30

    Can anyone tell me if there's a good reason why netui:error tag refers to the deprecated ActionError as opposed to ActionMessage? It means I cannot do this as I get a ClassCastException: <pre> public ActionErrors validate(ActionMapping mapping, Http

  • netui:errors Tag issueOctober 11

    hi i have the following code in one of my JSP <b><% String localeAttrName = I18NConstants.LOCALE; Locale locale = (Locale) session.getAttribute(localeAttrName); %></b> And i call below tag <b><netui:errors locale="<%=loc

  • Netui:fileUpload tag ???November 30

    Does anyone know how to use the netui:fileUpload tag. When I try to use it I get the error: NETUI ERROR: Unable to update expression "{actionForm.theFile}" with the value [CHANGES.txt]. The typical cause is that the object represented by the exp

  • Disappearing netui-data tags (workshop applications)November 30

    hoping there are a couple WLS workshops users on this forum.... This is a rather WLS Workshop problem that I have posted on the BEA forums but haven't got a response there. Basically, my netui-data tags aren't displaying pageFlow data (underlying row

  • Netui:repeater tags with ranges (aka prev/next)November 30

    Is there some way to implement ranges using the <netui:data-repeater> tags? By ranges, I mean where you have 123 items in a list and you only display numbers 1-50. Clicking NEXT would give you items 51-100. When you're there, clicking PREV would tak

  • NetUI Error MessageNovember 30

    I get the following message for every field (with a netui tag) on my form. Although the operation succeeds and the information is saved in the formbean, I still get this message every time. Does anyone know what it means? NETUI ERROR: Unable to updat

  • Error - tag.getAsString : attribute 'title' not found in context ---- HelpOctober 11

    hi, I have included a jsp page in tiles definition xml. if i try to access an attribute defined in the tiles definition using tiles:getAsString method it is throwing the following exception Error - tag.getAsString : attribute 'title' not found in con

  • JSP : Tiles Error �tag.getAsString� : component context is not definedOctober 11

    JSP : Tiles Error �tag.getAsString� : component context is not defined I�m working with Struts 1.1 and Tiles, under Tomcat 5.0.16 My application works fine using Struts 1.1 alone, however, when attempting to run the application in a �Tiles� environme

  • Netui: anchor tag with target attribute.October 11

    I am using the netui:anchor tag inside an iframe to post to an action. But the resulting page is displayed within the iframe. Will the target attribute of the netui:anchor tag help solve the problem. What is a valid value of the target attribute. tha

  • Set selected in netui:select tagNovember 30

    Hi, all I wonder how to set the selected item after come back from server. I have --- jsp <netui:select dataSource="{actionForm.personStr}" optionsDataSource="{actionForm.personOptionsHashMap}" defaultValue="-- select one --&qu

Copyright (C) 2019 wisumpire.com, All Rights Reserved. webmaster#wisumpire.com 14 q. 0.637 s.