You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shale.apache.org by Wendy Smoak <ws...@gmail.com> on 2006/10/06 21:11:55 UTC
Re: Shale validation & facelet
On 9/25/06, Mauricio Scheffer <ma...@yahoo.com.ar> wrote:
> Thanks everyone, I'll try the latest svn
I only fixed the website, nothing related to Shale Validation and
Facelets. Which I'm now having my own problems with. :/
Facelets 1.1.11, Shale 1.0.4-SNAPSHOT, MyFaces Core 1.1.4
I'm trying to add a required validator to a Facelets template, and
MyFaces is complaining "Unknown validator id
'org.apache.shale.validator.CommonsValidator'."
With this in accessRequest.xhtml
<h:outputText value="#{messages['prompt.effectiveDate']}"/>
<h:inputText id="effectiveDate"
value="#{effectiveDate}">
<s:commonsValidator
type="required"
arg="#{messages['prompt.effectiveDate']}"
server="true"
client="false"/>
</h:inputText>
<h:message for="effectiveDate" styleClass="errors"/>
The <s:commonsValidator> tag comes through in the HTML. Fair enough.
If I add a Facelets tag file (and the corresponding web.xml context param,)
<?xml version="1.0"?>
<!DOCTYPE facelet-taglib PUBLIC
"-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
"http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
<facelet-taglib>
<namespace>http://shale.apache.org/validator</namespace>
<tag>
<tag-name>commonsValidator</tag-name>
<validator>
<validator-id>org.apache.shale.validator.CommonsValidator</validator-id>
</validator>
</tag>
</facelet-taglib>
then I get:
javax.faces.FacesException: Unknown validator id
'org.apache.shale.validator.CommonsValidator'.
at org.apache.myfaces.application.ApplicationImpl.createValidator(ApplicationImpl.java:600)
at com.sun.facelets.tag.jsf.ValidateHandler.createValidator(ValidateHandler.java:116)
at com.sun.facelets.tag.jsf.ValidateHandler.apply(ValidateHandler.java:90)
...
Full stack trace here:
http://wiki.wsmoak.net/cgi-bin/wiki.pl?Facelets#validator
Does anyone see anything obviously wrong above (or on the wiki page)
or have any advice?
Thanks,
--
Wendy
Re: Shale validation & facelet
Posted by Rahul Akolkar <ra...@gmail.com>.
On 10/6/06, Wendy Smoak <ws...@gmail.com> wrote:
> On 10/6/06, Greg Reddin <gr...@apache.org> wrote:
>
> > I don't see any reference to adding the <validator> tag to faces-
> > config.xml. Did you do that? (or did I miss something?)
>
> Do I have to? Shouldn't the faces-config.xml file in
> shale-validator.jar take care of it?
>
<snip/>
It should, but the validator-id's must match. Here's the id from the jar:
org.apache.shale.CommonsValidator
(note absence of ".validator" substring in the above id)
-Rahul
> --
> Wendy
>
Re: Shale validation & facelet
Posted by Wendy Smoak <ws...@gmail.com>.
On 10/6/06, Wendy Smoak <ws...@gmail.com> wrote:
> Do I have to? Shouldn't the faces-config.xml file in
> shale-validator.jar take care of it?
Got it, I think. The <validator-id>s didn't match. The Facelets
taglib file should be:
<facelet-taglib>
<namespace>http://shale.apache.org/validator</namespace>
<tag>
<tag-name>commonsValidator</tag-name>
<validator>
<validator-id>org.apache.shale.CommonsValidator</validator-id>
</validator>
</tag>
</facelet-taglib>
--
Wendy
Re: Shale validation & facelet
Posted by Wendy Smoak <ws...@gmail.com>.
On 10/6/06, Greg Reddin <gr...@apache.org> wrote:
> I don't see any reference to adding the <validator> tag to faces-
> config.xml. Did you do that? (or did I miss something?)
Do I have to? Shouldn't the faces-config.xml file in
shale-validator.jar take care of it?
--
Wendy
Re: Shale validation & facelet
Posted by Greg Reddin <gr...@apache.org>.
I don't see any reference to adding the <validator> tag to faces-
config.xml. Did you do that? (or did I miss something?)
Greg
On Oct 6, 2006, at 2:11 PM, Wendy Smoak wrote:
> On 9/25/06, Mauricio Scheffer <ma...@yahoo.com.ar> wrote:
>
>> Thanks everyone, I'll try the latest svn
>
> I only fixed the website, nothing related to Shale Validation and
> Facelets. Which I'm now having my own problems with. :/
>
> Facelets 1.1.11, Shale 1.0.4-SNAPSHOT, MyFaces Core 1.1.4
>
> I'm trying to add a required validator to a Facelets template, and
> MyFaces is complaining "Unknown validator id
> 'org.apache.shale.validator.CommonsValidator'."
>
> With this in accessRequest.xhtml
>
> <h:outputText value="#{messages
> ['prompt.effectiveDate']}"/>
> <h:inputText id="effectiveDate"
> value="#{effectiveDate}">
> <s:commonsValidator
> type="required"
> arg="#{messages
> ['prompt.effectiveDate']}"
> server="true"
> client="false"/>
> </h:inputText>
> <h:message for="effectiveDate" styleClass="errors"/>
>
> The <s:commonsValidator> tag comes through in the HTML. Fair enough.
>
> If I add a Facelets tag file (and the corresponding web.xml context
> param,)
>
> <?xml version="1.0"?>
> <!DOCTYPE facelet-taglib PUBLIC
> "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
> "http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
>
> <facelet-taglib>
> <namespace>http://shale.apache.org/validator</namespace>
> <tag>
> <tag-name>commonsValidator</tag-name>
> <validator>
> <validator-
> id>org.apache.shale.validator.CommonsValidator</validator-id>
> </validator>
> </tag>
> </facelet-taglib>
>
> then I get:
>
> javax.faces.FacesException: Unknown validator id
> 'org.apache.shale.validator.CommonsValidator'.
> at org.apache.myfaces.application.ApplicationImpl.createValidator
> (ApplicationImpl.java:600)
> at com.sun.facelets.tag.jsf.ValidateHandler.createValidator
> (ValidateHandler.java:116)
> at com.sun.facelets.tag.jsf.ValidateHandler.apply
> (ValidateHandler.java:90)
> ...
>
> Full stack trace here:
> http://wiki.wsmoak.net/cgi-bin/wiki.pl?Facelets#validator
>
> Does anyone see anything obviously wrong above (or on the wiki page)
> or have any advice?
>
> Thanks,
> --
> Wendy
>