Re: [Rife-users] Using Apache Derby
where did you place your derby jar? On 17-dec-05, at 20:52, F Baube wrote: Hmm, the switch from PostrgeSQL to Derby is giving me an NPE in Rife (!) What I did is, 1) Define the Derby system dir like so: >> echo $JAVA_OPTS -Dderby.system.home=/opt/metadoc/derbydb/ -ea -Xmx256m -Xms64m 2) Use this config info: org.apache.derby.jdbc.EmbeddedDriver jdbc:derby:rife;create=true 3) Redeploy my app into Tomcat 5.5.12 I'm using the Rife 1.3 jar. Here's the NPE: Dec 17, 2005 9:42:31 PM org.apache.catalina.core.StandardContext filterStart SEVERE: Exception starting filter RIFE javax.servlet.ServletException: java.lang.AssertionError at com.uwyn.rife.servlet.RifeFilter.init(RifeFilter.java:63) at org.apache.catalina.core.ApplicationFilterConfig.getFilter (ApplicationFilterConfig.java:225) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef (ApplicationFilterConfig.java:308) at org.apache.catalina.core.ApplicationFilterConfig. (ApplicationFilterConfig.java:79) at org.apache.catalina.core.StandardContext.filterStart (StandardContext.java:3563) at org.apache.catalina.core.StandardContext.start (StandardContext.java:4133) at org.apache.catalina.core.ContainerBase.addChildInternal (ContainerBase.java:759) at org.apache.catalina.core.ContainerBase.addChild (ContainerBase.java:739) at org.apache.catalina.core.StandardHost.addChild (StandardHost.java:524) at org.apache.catalina.startup.HostConfig.deployWAR (HostConfig.java:804) at org.apache.catalina.startup.HostConfig.deployApps (HostConfig.java:497) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1195) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.commons.modeler.BaseModelMBean.invoke (BaseModelMBean.java:503) at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke (DynamicMetaDataImpl.java:213) at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke (DefaultMBeanServerInterceptor.java:815) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke (JmxMBeanServer.java:784) at org.apache.catalina.manager.ManagerServlet.check (ManagerServlet.java:1377) at org.apache.catalina.manager.ManagerServlet.deploy (ManagerServlet.java:636) at org.apache.catalina.manager.ManagerServlet.doPut (ManagerServlet.java:423) at javax.servlet.http.HttpServlet.service(HttpServlet.java:712) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:178) at org.apache.catalina.authenticator.AuthenticatorBase.invoke (AuthenticatorBase.java:514) at org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process (Http11Processor.java:868) at org.apache.coyote.http11.Http11BaseProtocol $Http11ConnectionHandler.processConnection(Http11BaseProtocol.java: 663) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket (PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt (LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run (ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595) Any thoughts ? fred -- Geert Bevin Uwyn bvba "Use what you need" Avenue de Scailmont 34 http://www.uwyn.com 7170 Manage, Belgium gbevin[remove] at uwyn dot comTel +32 64 84 80 03 PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9 Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Using Apache Derby
Hmm, the switch from PostrgeSQL to Derby is giving me an NPE in Rife (!) What I did is, 1) Define the Derby system dir like so: >> echo $JAVA_OPTS -Dderby.system.home=/opt/metadoc/derbydb/ -ea -Xmx256m -Xms64m 2) Use this config info: org.apache.derby.jdbc.EmbeddedDriver jdbc:derby:rife;create=true 3) Redeploy my app into Tomcat 5.5.12 I'm using the Rife 1.3 jar. Here's the NPE: Dec 17, 2005 9:42:31 PM org.apache.catalina.core.StandardContext filterStart SEVERE: Exception starting filter RIFE javax.servlet.ServletException: java.lang.AssertionError at com.uwyn.rife.servlet.RifeFilter.init(RifeFilter.java:63) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:225) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:308) at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:79) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3563) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4133) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:804) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:497) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1195) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503) at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213) at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784) at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1377) at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:636) at org.apache.catalina.manager.ManagerServlet.doPut(ManagerServlet.java:423) at javax.servlet.http.HttpServlet.service(HttpServlet.java:712) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:514) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595) Any thoughts ? fred ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] ServletContext at Rep Startup?
The init parameters of the servlet are automatically aggregated into the properties or the repository, and thus also those of the elements. On 17-dec-05, at 20:28, F Baube wrote: I need to be able to obtain the ServletContext from within my Rep startup code, so that I can check values for init-params and attributes. i.e. http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/ ServletContext.html#getAttribute(java.lang.String) and http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/ ServletContext.html#getInitParameter(java.lang.String) But it appears that in Rife, the ServletContext is available to subclasses of Element [ i.e. http://rifers.org/docs/api/com/uwyn/rife/engine/ ElementSupport.html#getServletContext() ] but not to subclasses of (for example) BlockingParticipant. Is there a workaround for this ? thx fred -- F.Baube* Georgetown/MSFS/1988 * Act locally. email fbaube#welho.com * Think pangalactically. gsm +358 41 536 8192 * wmd 60°11'10.8"N 24°57'36.9"E ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn bvba "Use what you need" Avenue de Scailmont 34 http://www.uwyn.com 7170 Manage, Belgium gbevin[remove] at uwyn dot comTel +32 64 84 80 03 PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9 Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
[Rife-users] ServletContext at Rep Startup?
I need to be able to obtain the ServletContext from within my Rep startup code, so that I can check values for init-params and attributes. i.e. http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/ServletContext.html#getAttribute(java.lang.String) and http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/ServletContext.html#getInitParameter(java.lang.String) But it appears that in Rife, the ServletContext is available to subclasses of Element [ i.e. http://rifers.org/docs/api/com/uwyn/rife/engine/ElementSupport.html#getServletContext() ] but not to subclasses of (for example) BlockingParticipant. Is there a workaround for this ? thx fred -- F.Baube* Georgetown/MSFS/1988 * Act locally. email fbaube#welho.com * Think pangalactically. gsm +358 41 536 8192 * wmd 60°11'10.8"N 24°57'36.9"E ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Using Apache Derby
On 17-dec-05, at 20:14, F Baube wrote: Any Rife+Derby experts here ? I want to use Derby in embedded mode. AFAICT if I do this then I don't need to configure the DB in Tomcat's conf/ directory. This ought to work in rep/datasources.xml : org.apache.derby.jdbc.EmbeddedDriver jdbc:derby:/opt/myapp/databases/rife;create=true fred fubarfubar 5 I probably don't even need the and elements, altho I assume that Rife uses the element. Well derby will create the db with the credentials you provide and of course the pool is used. It looks tho like if I do it this way, then I can't use the Derby utilities such as "ij" and "dblook", since they would run in a different JVM from Tomcat+Rife+Derby. You can run Derby in embedded mode too when you use tools like Aqua Datastudio or DbVisualizer, just provide the same connection parameters. You'll have to shut down the web application before though, I think. -- Geert Bevin Uwyn bvba "Use what you need" Avenue de Scailmont 34 http://www.uwyn.com 7170 Manage, Belgium gbevin[remove] at uwyn dot comTel +32 64 84 80 03 PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9 Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
[Rife-users] Using Apache Derby
Any Rife+Derby experts here ? I want to use Derby in embedded mode. AFAICT if I do this then I don't need to configure the DB in Tomcat's conf/ directory. This ought to work in rep/datasources.xml : org.apache.derby.jdbc.EmbeddedDriver jdbc:derby:/opt/myapp/databases/rife;create=true fred fubarfubar 5 I probably don't even need the and elements, altho I assume that Rife uses the element. It looks tho like if I do it this way, then I can't use the Derby utilities such as "ij" and "dblook", since they would run in a different JVM from Tomcat+Rife+Derby. thx fred -- F.Baube* Georgetown/MSFS/1988 * Act locally. email fbaube#welho.com * Think pangalactically. gsm +358 41 536 8192 * wmd 60°11'10.8"N 24°57'36.9"E ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] ENGINEHTML and xhtml dtd in html file
How do you propose to indicate that the properties file should be interpreted in xhtml enabled or disabled mode? by choosing the right encoder when a template is instanciated by an element, with: - a parameter (L10N_XHTML_ENABLED_RESOURCEBUNDLE?) in config to specify the default behavior of the application (and by default "default", xhtml enabled) - each element can overwrite this parameter with its own property That doesn't work since you'll get threading issues. The config is shared throughout the entire application. So if you modify it in the middle of a certain element, another element might modify it again before you even used it. OK. So don't "overwrite" the config parameter: - each element will check if a L10N_XHTML_ENABLED_RESOURCEBUNDLE property is available - if not it will check if a L10N_XHTML_ENABLED_RESOURCEBUNDLE parameter is available in config - if not it will use the actual behavior. Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] ENGINEHTML and xhtml dtd in html file
On 17-dec-05, at 12:23, Raoul Pierre wrote: - separation of concern ( :-) I succeeded to place it!), i.e. "pure" text: if xhtml tags are needed, then escape <>&" with something like "\\" - xhtml enabled: <>&"' as literals must be escaped with xhtml entity references How do you propose to indicate that the properties file should be interpreted in xhtml enabled or disabled mode? by choosing the right encoder when a template is instanciated by an element, with: - a parameter (L10N_XHTML_ENABLED_RESOURCEBUNDLE?) in config to specify the default behavior of the application (and by default "default", xhtml enabled) - each element can overwrite this parameter with its own property That doesn't work since you'll get threading issues. The config is shared throughout the entire application. So if you modify it in the middle of a certain element, another element might modify it again before you even used it. -- Geert Bevin Uwyn bvba "Use what you need" Avenue de Scailmont 34 http://www.uwyn.com 7170 Manage, Belgium gbevin[remove] at uwyn dot comTel +32 64 84 80 03 PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9 Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] ENGINEHTML and xhtml dtd in html file
- separation of concern ( :-) I succeeded to place it!), i.e. "pure" text: if xhtml tags are needed, then escape <>&" with something like "\\" - xhtml enabled: <>&"' as literals must be escaped with xhtml entity references How do you propose to indicate that the properties file should be interpreted in xhtml enabled or disabled mode? by choosing the right encoder when a template is instanciated by an element, with: - a parameter (L10N_XHTML_ENABLED_RESOURCEBUNDLE?) in config to specify the default behavior of the application (and by default "default", xhtml enabled) - each element can overwrite this parameter with its own property Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] ENGINEHTML and xhtml dtd in html file
Yes. I think we should have the best of the two, as wanted: - separation of concern ( :-) I succeeded to place it!), i.e. "pure" text: if xhtml tags are needed, then escape <>&" with something like "\\" - xhtml enabled: <>&"' as literals must be escaped with xhtml entity references How do you propose to indicate that the properties file should be interpreted in xhtml enabled or disabled mode? -- Geert Bevin Uwyn bvba "Use what you need" Avenue de Scailmont 34 http://www.uwyn.com 7170 Manage, Belgium gbevin[remove] at uwyn dot comTel +32 64 84 80 03 PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9 Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] ENGINEHTML and xhtml dtd in html file
Geert, "http://www.w3.org/TR/xhtml1/DTD/xhtml1- transitional.dtd"> Ok, but that doesn't really matter, does it? There is a little difference about ' which is defined in xhtml but not in html. Atm StringUtils.encodeHtml doesn't encode it. Both engine types behave the same except for resolving the template name with a file name extension. Yes May be it's possible to do both of them: - for any element or template, to give the choice between with or without html tags/entities capabilities - even in the case "without html tags/entities", to be able to use them with escaping, like summary-legend = XHTML Transitional 1.0\\Fragment body-help = \\Vous pouvez saisir ici le texte complet de la "nouvelle". Seul \ du texte XHTML valide est acceptable.\ \ I'm not so sure about this. You'll still have to educate people that they have to escape these character with a custom RIFE method. Yes. In my opinion, it's much better for them to know how to escape the characterd that encodeDefensive doesn't handle in a standard xhtml way. At least they already know it correctly. My concern is to manage properties files with as few as possible code rules in them: - here, in addition to the specify rules of properties files (dynamic value, unicode, eol...), by default you must know at least the html codage of these characters - if you want to use these files in a not web context, you must then filter such html code. Also, check out the frequency. How often do you add <>&"' to text. It's actually just really once in a while. But it's something very nasty to deal with. And not so rare in language as french, with apostrophe and quotations When you have xhtml enabled properties, you'll have a lot more characters for the tags. So imho this custom escaping might actually be more work. Yes. I think we should have the best of the two, as wanted: - separation of concern ( :-) I succeeded to place it!), i.e. "pure" text: if xhtml tags are needed, then escape <>&" with something like "\\" - xhtml enabled: <>&"' as literals must be escaped with xhtml entity references Regards Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] ENGINEHTML and xhtml dtd in html file
No, it's used when you do getHtmlTemplate from within your element. Using getXhtmlTemplate gives you an ENGINEXHTML type. Sorry I was not clear enough. The point is neither about html or xhtml file suffix nor about ENGINEHTML or ENGINEXHTML instances: it's always EncoderHtml which is used. Yes, which provides exactly the functionality that the enginexhtml need too. What do you mean with the dtd? Even in files with html suffixe, it can be xhtml code, e.g. in src/ templates/crud/common/blueprint_admin.html, you have: "http://www.w3.org/TR/xhtml1/DTD/xhtml1- transitional.dtd"> Ok, but that doesn't really matter, does it? Both engine types behave the same except for resolving the template name with a file name extension. - AbstractTemplate.evaluateL10nTags uses EncoderHtml.encodeDefensive and not EncoderHtml.encodeDefensive to convert string, that is StringUtils.encodeHtmlDefensive - this last method doesn't convert "<", "&", ">", "'" and """ So, for html files with xhtml dtd and for xhtml files, we can have trouble when any of the above characters is present in a key's value, e.g. double quote used in an attribute's value: then the end of the value is not displayed. I'm not fully following, can you give an example? For exemples: 1/ put some < character inside element body like: Take xthen..., the tag will be 2/ a buttom wich must display text with quotation inside as: Liste des "canailles", the tag will be 3/ if simple quote is used for an attribut and the text is: S'inscrire, then the tag will be 4/ with value as "Rire & pleurer" Ok, yeah, of course I know about all this. One of the reasons that encodeDefensive has been created is to make the life of people that don't know anything about html entity encoding better. You an then simply provide html editing capabilities to your customer, without them needed to encode all the entities before it's considered valid. For property files, it's a different story, I agree. Is there any reason against to used EncoderHtml.encodeDefensive in all the cases. Yes, if you want to make sure that no html tags or entities can be provided at all through form fields. OK I never used such possibilities. I put only "pure" text in properties files: anybody can translate them without knowing anything in codage. Is the choice only between: - to be able to provide html tags ans entities from properties files - to be able to use "<", "&", ">", "'" and """ caracters for attribute or element values. May be it's possible to do both of them: - for any element or template, to give the choice between with or without html tags/entities capabilities - even in the case "without html tags/entities", to be able to use them with escaping, like summary-legend = XHTML Transitional 1.0\\Fragment body-help = \\Vous pouvez saisir ici le texte complet de la "nouvelle". Seul \ du texte XHTML valide est acceptable.\ \ I'm not so sure about this. You'll still have to educate people that they have to escape these character with a custom RIFE method. In my opinion, it's much better for them to know how to escape the characterd that encodeDefensive doesn't handle in a standard xhtml way. At least they already know it correctly. Also, check out the frequency. How often do you add <>&"' to text. It's actually just really once in a while. When you have xhtml enabled properties, you'll have a lot more characters for the tags. So imho this custom escaping might actually be more work. Best regards, Geert -- Geert Bevin Uwyn bvba "Use what you need" Avenue de Scailmont 34 http://www.uwyn.com 7170 Manage, Belgium gbevin[remove] at uwyn dot comTel +32 64 84 80 03 PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9 Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users