[Seasar-user:11970] =?GB2312?B?UmU6IFtTZWFzYXItdXNlcjoxMTk=?= =?GB2312?B?NjldIFJlOiBUZWVkYaWopempYKXhpcOlu6lgpbg=?=

=?GB2312?B?wO7A1g==?= [E-MAIL ADDRESS DELETED]
2007年 12月 7日 (金) 15:58:51 JST


これはもう俐屎しましたか。しかし


ServletFacesContextImpl context = (ServletFacesContextImpl) FacesContext
                .getCurrentInstance();
        Field f;
        try {
            if (context != null) {
                f = context.getClass ().*getDeclaredField*("messages");
                if (f != null) {
                    f.setAccessible(true);
                    *List messages = (List) f.get(context);
                    if (messages != null) {
                        messages.clear();
                    }
*                }
            }
        } catch (SecurityException e) {
            e.printStackTrace();
        } catch (NoSuchFieldException e) {
            e.printStackTrace();
        } catch (IllegalArgumentException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
    }

*java.lang.IllegalStateException*
 at
org.seasar.teeda.core.context.servlet.ServletFacesContextImpl.getMessages(
ServletFacesContextImpl.java:106)
 at javax.faces.internal.FacesMessageUtil.hasMessagesByClientId (
FacesMessageUtil.java:337)
 at
org.seasar.teeda.extension.render.html.THtmlInputTextRenderer.colorErrorComponent
(THtmlInputTextRenderer.java:63)
 at
org.seasar.teeda.extension.render.html.THtmlInputTextRenderer.renderStyleClass(
THtmlInputTextRenderer.java:53)
 at
org.seasar.teeda.core.render.html.HtmlInputTextRenderer.encodeHtmlInputTextEnd
(HtmlInputTextRenderer.java:76)
 at org.seasar.teeda.core.render.html.HtmlInputTextRenderer.encodeEnd (
HtmlInputTextRenderer.java:57)
 at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java
:348)
 at org.seasar.teeda.core.util.RendererUtil.renderChild(RendererUtil.java
:327)
 at org.seasar.teeda.core.util.RendererUtil.renderChildren (
RendererUtil.java:337)
 at org.seasar.teeda.core.util.RendererUtil.renderChild(RendererUtil.java
:325)


¤É¤³¤¬égß`¤¤¤Þ¤¹¤«£¿


2007/12/7, Toshihiro Nakamura <[E-MAIL ADDRESS DELETED]>:
>
> 嶄翫(taedium)です。
>
> > しかし、context.getClass().getField("messages")
> java.lang.NoSuchFieldException:
> > messages
>
> すみません。
>
> context.getClass().getField("messages")
>
> ではなく
>
> context.getClass().getDeclaredField("messages")
>
> としないといけないですね。
> --
> Nakamura Toshihiro <[E-MAIL ADDRESS DELETED]>
>
> _______________________________________________
> Seasar-user mailing list
> [E-MAIL ADDRESS DELETED]
> https://ml.seasar.org/mailman/listinfo/seasar-user
>
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
URL: http://ml.seasar.org/archives/seasar-user/attachments/20071207/b85c627b/attachment-0001.html 


Seasar-user メーリングリストの案内