Re: Defining mask globally
Hi Hermod, I am using version 1.0.4 of shale-validator. Is this the right approach to manage the regex for the mask? I also double checked about typo error, that error was in email message but not in the code. Thanks On 3/14/07, Hermod Opstvedt [EMAIL PROTECTED] wrote: Hi Another question: Which version is this of shale-validator? The linenumbers don't match up with the current. Hermod -Opprinnelig melding- Fra: Sanjay Choudhary [mailto:[EMAIL PROTECTED] Sendt: 14. mars 2007 21:33 Til: user@shale.apache.org Emne: Defining mask globally hi I wish to define the global regex for masks in a common file. For example , name field mask will be like ^[a-zA-Z]+$. h:inputText id=nameame styleClass=inputText value=#{BrokerRepresentative.name} size=20 val:commonsValidator type=mask arg=Company Name server=true client=false val:validatorVar name=mask value=^[a-zA-Z]+$ / /val:commonsValidator /h:inputText I wish to replace this with something like f:loadBundle basename=globalmasks val=globalmask/ h:inputText id=nameame styleClass=inputText value=#{BrokerRepresentative.name} size=20 val:commonsValidator type=mask arg=Company Name server=true client=false val:validatorVar name=mask value=#{ globalmask.name} / /val:commonsValidator /h:inputText This will enable me to validate the name field in a uniform way through out my application. Also if any change is need in regex then it needs to applied in one place. When I tried this solution I got java.lang.NullPointerException org.apache.shale.validator.CommonsValidator.convert(CommonsValidator.java :95 4) org.apache.shale.validator.CommonsValidator.loadMethodParamValues (CommonsVal idator.java:715) org.apache.shale.validator.CommonsValidator.validate(CommonsValidator.java :7 93) javax.faces.component.UIInput.validateValue(UIInput.java:781) javax.faces.component.UIInput.validate(UIInput.java:645) javax.faces.component.UIInput.executeValidate(UIInput.java:849) javax.faces.component.UIInput.processValidators(UIInput.java:412) javax.faces.component.UIComponentBase.processValidators( UIComponentBase.java :912) javax.faces.component.UIForm.processValidators(UIForm.java:170) javax.faces.component.UIComponentBase.processValidators( UIComponentBase.java :912) javax.faces.component.UIComponentBase.processValidators( UIComponentBase.java :912) javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:342) com.sun.faces.lifecycle.ProcessValidationsPhase.execute (ProcessValidationsPh ase.java:78) com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java :200) com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java :90) javax.faces.webapp.FacesServlet.service(FacesServlet.java:197) Any help /commens/ pointers appreciated to resolve this problem. I open to different solution too. Thanks, sanjay
Re: SV: Re: basic dialog nullpointerexception
Hi. After I switched my local project to another version (different workspace), it indeeded stopped working with 5.5.23. But it worked before with 5.5.23. I don't know what it blew up. So that means, listeners in tlds only work up to tomcat 5.5.17? But it didn't work out with my 5.5.17 version. Strange thing. Meanwhile I think perhaps it's a problem with eclipse wtp and tomcat. Never tried it with tomcat standalone. Did you? BTW: I'm using Java5. regards, Veit Hermod Opstvedt schrieb: Hi The last working version of Tomcat is actually 5.5.17 with Java5. If you switch to Java 1.4 things are different. There is a post by me on this, where I went through and tested on all 5.5.x versions, and things stopped working after 5.5.17 Hermod -Opprinnelig melding- Fra: Veit Guna [mailto:[EMAIL PROTECTED] Sendt: 12. mars 2007 20:34 Til: user@shale.apache.org Emne: SV: Re: basic dialog nullpointerexception Hi again. I upgraded my Tomcat 5.5.17 installation (it wasn't 5.5.16) to tomcat 5.5.23 and now the BasicLifecycleListener gets invoked. Seemed to be a problem with tomcat?! Regards, Veit Original-Nachricht Datum: Mon, 12 Mar 2007 13:41:26 +0100 Von: Veit Guna [EMAIL PROTECTED] An: user@shale.apache.org CC: Betreff: Re: basic dialog nullpointerexception I'm using tomcat 5.5.16. Original-Nachricht Datum: Mon, 12 Mar 2007 05:31:50 -0700 Von: Craig McClanahan [EMAIL PROTECTED] An: user@shale.apache.org CC: Betreff: Re: basic dialog nullpointerexception On 3/12/07, Veit Guna [EMAIL PROTECTED] wrote: Hi. I'm trying to get the basic dialog feature of shale 1.0.4 working. I've added the jars view, dialog, basic-dialog, core to my classpath and created a dialog xml file in WEB-INF. Now when I try in a h:commandLink an action like dialog:myDialog a NullPointerException occurs: java.lang.NullPointerException at org.apache.shale.dialog.basic.BasicDialogManager.create(BasicDialogManager.j ava:97) at org.apache.shale.dialog.basic.BasicDialogManager.create(BasicDialogManager.j ava:87) at org.apache.shale.dialog.faces.DialogNavigationHandler.handleNavigation(Dialo gNavigationHandler.java:121) at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListen erImpl.java:84) at org.apache.shale.view.faces.ViewActionListener.processAction(ViewActionListe ner.java:74) at ... I've taken a look at the BasicDialogManager. It tries to use an uninitialized Map. I guess it should be initialized by the BasicLifecycleListener but it isn't. Any hints, what I've forgotten? Do I have to put the BasicLifecycleListener somewhere manually? In general, you should *not* have to configure this listener manually. It is registered in a listener defined in the shale-dialog-basic-xxx.jar file that you're including. However, not all containers properly implement registering listeners in a TLD inside a JAR file. What container and version are you running on? Craig Regards, Veit -- Feel free - 5 GB Mailbox, 50 FreeSMS/Monat ... Jetzt GMX ProMail testen: www.gmx.net/de/go/mailfooter/promail-out -- Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten Browser-Versionen downloaden: http://www.gmx.net/de/go/browser
Re: Strange behavior from a tags when using Clay HTML templates
From: Richard Eggert [EMAIL PROTECTED] I'm having an issue using anchor () tags that are explicitly mapped to h:commandLink (implicitly mapped tags don't work at all in this case). Consider the following HTML template named bugTest.html loaded via an XML view named /bugTest.clay: html body form a href=some-other-page.html jsfid=h:commandLink action=/some-other-view.clay Go here /a /form /body /html When viewed offline in a web browser, this page works fine. However, when viewed online using Clay, the text within the link becomes some-other-page.html Go here instead of just Go here, and clicking on the link just causes the page to reload. Is this a bug, or am I doing something wrong? There doesn't seem to be any valid reason why the contents of the href attribute should be moved to be nested within the tag, or why the action attribute shouldn't propagate to the commandLink component. Yeah, I think this is a bug. What I think is going on here is that the implicit mapping is overriding the commandLink's value [1]. What I mean is that the anchored tag is mapped to the outputLink by default. We should check to see if there is an action symbol override before using the href. Or, just look at the componentType after the jsfid overrides to make sure it's an outputLink. The outputLink puts the href in the components value attribute where a commandLink puts the text in the value attribute. Please create a JIRA ticket for this one. [1] http://svn.apache.org/viewvc/shale/framework/trunk/shale-clay/src/main/java/org/apache/shale/clay/parser/builder/OutputLinkBuilder.java?view=markup Rich Eggert Member of Technical Staff Proteus Technologies, LLC http://www.proteus-technologies.com Gary
SV: SV: Re: basic dialog nullpointerexception
Hi Try it with jdk 1.4 on 5.5.23 and see what happens then. Hermod -Opprinnelig melding- Fra: Veit Guna [mailto:[EMAIL PROTECTED] Sendt: 14. mars 2007 23:06 Til: user@shale.apache.org Emne: Re: SV: Re: basic dialog nullpointerexception Hi. After I switched my local project to another version (different workspace), it indeeded stopped working with 5.5.23. But it worked before with 5.5.23. I don't know what it blew up. So that means, listeners in tlds only work up to tomcat 5.5.17? But it didn't work out with my 5.5.17 version. Strange thing. Meanwhile I think perhaps it's a problem with eclipse wtp and tomcat. Never tried it with tomcat standalone. Did you? BTW: I'm using Java5. regards, Veit Hermod Opstvedt schrieb: Hi The last working version of Tomcat is actually 5.5.17 with Java5. If you switch to Java 1.4 things are different. There is a post by me on this, where I went through and tested on all 5.5.x versions, and things stopped working after 5.5.17 Hermod -Opprinnelig melding- Fra: Veit Guna [mailto:[EMAIL PROTECTED] Sendt: 12. mars 2007 20:34 Til: user@shale.apache.org Emne: SV: Re: basic dialog nullpointerexception Hi again. I upgraded my Tomcat 5.5.17 installation (it wasn't 5.5.16) to tomcat 5.5.23 and now the BasicLifecycleListener gets invoked. Seemed to be a problem with tomcat?! Regards, Veit Original-Nachricht Datum: Mon, 12 Mar 2007 13:41:26 +0100 Von: Veit Guna [EMAIL PROTECTED] An: user@shale.apache.org CC: Betreff: Re: basic dialog nullpointerexception I'm using tomcat 5.5.16. Original-Nachricht Datum: Mon, 12 Mar 2007 05:31:50 -0700 Von: Craig McClanahan [EMAIL PROTECTED] An: user@shale.apache.org CC: Betreff: Re: basic dialog nullpointerexception On 3/12/07, Veit Guna [EMAIL PROTECTED] wrote: Hi. I'm trying to get the basic dialog feature of shale 1.0.4 working. I've added the jars view, dialog, basic-dialog, core to my classpath and created a dialog xml file in WEB-INF. Now when I try in a h:commandLink an action like dialog:myDialog a NullPointerException occurs: java.lang.NullPointerException at org.apache.shale.dialog.basic.BasicDialogManager.create(BasicDialogManager.j ava:97) at org.apache.shale.dialog.basic.BasicDialogManager.create(BasicDialogManager.j ava:87) at org.apache.shale.dialog.faces.DialogNavigationHandler.handleNavigation(Dialo gNavigationHandler.java:121) at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListen erImpl.java:84) at org.apache.shale.view.faces.ViewActionListener.processAction(ViewActionListe ner.java:74) at ... I've taken a look at the BasicDialogManager. It tries to use an uninitialized Map. I guess it should be initialized by the BasicLifecycleListener but it isn't. Any hints, what I've forgotten? Do I have to put the BasicLifecycleListener somewhere manually? In general, you should *not* have to configure this listener manually. It is registered in a listener defined in the shale-dialog-basic-xxx.jar file that you're including. However, not all containers properly implement registering listeners in a TLD inside a JAR file. What container and version are you running on? Craig Regards, Veit -- Feel free - 5 GB Mailbox, 50 FreeSMS/Monat ... Jetzt GMX ProMail testen: www.gmx.net/de/go/mailfooter/promail-out -- Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten Browser-Versionen downloaden: http://www.gmx.net/de/go/browser