从FieldError中得到信息

<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --> public   synchronized   static  String getInfoFromStruts(
            HttpServletRequest request) {
        String info 
=   "" ;
        
if  (request.getAttribute(Constant.VALUE_STACK_NAME)  !=   null ) {
            ValueStack vs 
=  (ValueStack) request
                    .getAttribute(Constant.VALUE_STACK_NAME);
            HashMap hp 
=  (HashMap) vs.findValue( " fieldErrors " );
            
for  (Iterator < String >  it  =  hp.keySet().iterator(); it.hasNext();) {
                String key 
=  it.next();
                List value 
=  (ArrayList) hp.get(key);
                info 
+=  value.get( 0 +   " <br /> " ;
            }
        }
        
return  info;
    }

你可能感兴趣的:(HP)