Return-Path: X-Original-To: apmail-myfaces-users-archive@www.apache.org Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 99B1A17A76 for ; Wed, 29 Apr 2015 16:02:24 +0000 (UTC) Received: (qmail 61592 invoked by uid 500); 29 Apr 2015 16:02:24 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 61540 invoked by uid 500); 29 Apr 2015 16:02:24 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 61528 invoked by uid 99); 29 Apr 2015 16:02:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Apr 2015 16:02:23 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: message received from 54.191.145.13 which is an MX secondary for users@myfaces.apache.org) Received: from [54.191.145.13] (HELO mx1-us-west.apache.org) (54.191.145.13) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Apr 2015 16:02:17 +0000 Received: from mail-la0-f43.google.com (mail-la0-f43.google.com [209.85.215.43]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 6B3A42837A for ; Wed, 29 Apr 2015 16:01:57 +0000 (UTC) Received: by laat2 with SMTP id t2so23691323laa.1 for ; Wed, 29 Apr 2015 09:01:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=jcYFdFyMTFmSCnjG9mO5jH0OZSTKd+0O7YSjfpEyugA=; b=OlkNWumy+Hwm7Nvq8h9U+q7HnY/uMPVfb6MJpaNEhkyLeT9Gw46RT/MMGKVrpIDNQ7 6GH04Yuh/n1fICFSfycfeQyS9LgbhPGCc7feMtlFPPu27HohQzTckYBF6zX+fBy24Ff9 MtTADsBmPHjkv8H8f70g+iMFcmJNhyP92pjwY6k4VfcGQv9J643Q30RHDlGxcgs4Qkx9 zzcCCaOBczLJh8o8Z6Drjc2hVzBPCo1p8rJvXDMGybZ75RwtG55aCkVvDgj5nJEIJFEn 5Qp37UDsn/KV/hkS/C4Iht59mIGmAYEkL76Bsqu14vbkTy2CyqtXj+endLn7w6I+DYbX sCcA== X-Received: by 10.112.161.66 with SMTP id xq2mr19884165lbb.31.1430323270892; Wed, 29 Apr 2015 09:01:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.216.79 with HTTP; Wed, 29 Apr 2015 09:00:50 -0700 (PDT) In-Reply-To: <552D2614.40003@aura.cz> References: <552D2614.40003@aura.cz> From: Mike Kienenberger Date: Wed, 29 Apr 2015 12:00:50 -0400 Message-ID: Subject: Re: h:inputFile required attribute don't work To: MyFaces Discussion Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org My apologies for the late reply. Any chance you can create an issue for this in our JIRA issue tracker and submit a patch with a fix? On Tue, Apr 14, 2015 at 10:37 AM, Vojt=C4=9Bch Zav=C5=99el wrote: > Hi, > it seems to me, that the required attribute of h:inputFile is not workin= g. > The reason is, that there is always an instance of javax.servlet.http.Par= t > in submitted value and there should be something like part.getSize() <=3D= 0 in > getConvertedValue() or maybe overriden isEmpty method of UIInput class wh= ere > is basic types emptiness check. > > You can repeat that problem just on a simple form with h:inputFile, with > required=3D"true" without any validator. > > > > > Upload File > label=3D"file" > value=3D"#{inputBean.part}" > required=3D"true" > requiredMessage=3D"File not selected !!"> > >
> > action=3D"#{inputBean.uploadFile}" > value=3D"upload file" />
>
> > Testing on Tomcat 7.0.59, MyFaces 2.2.6 > > -- > Mgr. Vojt=C4=9Bch Zav=C5=99el > System architect > AURA, s.r.o. > =C3=9Avoz 499/56 > 602 00 Brno > Czech Republic > > Tel.: +420 544 508 181 > Fax: +420 544 508 112 > E-mail: vojtech.zavrel@aura.cz > Internet: www.aura.cz > Certifikace ISO 9001, ISO 8000, ISO 27001 a =C4=8COS 051622 (AQAP 2110) >