properties

JSF call message bundle : EL in EL

泄露秘密 提交于 2020-01-11 07:18:09
问题 I am working in JSF2 and I have displayed a resource bundle to display messages from property files. The configuration seems to be great (if I call #{msg.risk} "toto" is displayed) messages.properties ... COMPANYGROWTH=E249 RISK=TOTO I would like to do this kind of thing : View <f:loadBundle basename="toto" var="msg"/> ... <p:column> <h:outputText value="#{msg.#{key}}" /> </p:column> Putting an EL in an EL like #{msg.#{key}} where key would be a declared row value in a datatable. Is there a

Access child user control's property in parent user control

ぐ巨炮叔叔 提交于 2020-01-11 06:37:14
问题 I have included a user control in another statically following code : place the folowing directive in the asp code of the parent page or usercontrol: <%@ Register src="Name_of_your_child_control.ascx" tagname="Name_of_your_child_control" tagprefix="uc1" %> use the following tag in the asp-code of the parent page/control: <uc1:Name_of_your_child_control ID="Name_of_your_child_control1" runat="server" /> ..... But the issue is...i am not able to access the public properties of user control

Groovy dynamic property per object

这一生的挚爱 提交于 2020-01-11 05:27:36
问题 Using Groovy 1.8. I'm trying to create a dynamic class definition that will cache properties per object. I did use propertyMissing without adding the property to the object just fine. I just think caching the properties would be more efficient. Right? Note that each instance must have its own different properties. The code below works fine: class C {} def c = new C() c.metaClass.prop = "a C property" println c.prop def x = new C() x.prop will output: a C property groovy.lang

PropertyPlaceHolder in spring

白昼怎懂夜的黑 提交于 2020-01-10 20:19:13
问题 We access a java property in spring like this: <property name="fileSizeLimit" value="${someProperty}" /> The bean declares int fileSizeLimit = 9999; How can I set a default if "someProperty" is missing in the properties-file? ATM, we get NumberFormatException because spring calls the int-setter with the name of the property "someProperty". When the property is set, everything works fine. http://static.springsource.org/spring/docs/1.1.5/api/org/springframework/beans/factory/config

Java操作Kafka

萝らか妹 提交于 2020-01-10 18:30:58
java操作kafka非常的简单,然后kafka也提供了很多缺省值,一般情况下我们不需要修改太多的参数就能使用。下面我贴出代码。 pom.xml <dependency> <groupId>org.apache.kafka</groupId> <artifactId>kafka-clients</artifactId> <version>0.10.2.0</version> </dependency> 生产者: package cn.duanjt; import java.util.Properties; import java.util.Random; import org.apache.kafka.clients.producer.KafkaProducer; import org.apache.kafka.clients.producer.ProducerConfig; import org.apache.kafka.clients.producer.ProducerRecord; import org.apache.kafka.common.serialization.StringSerializer; public class Producer { public static String topic = "duanjt_test";//定义主题 public

selenium登陆模拟

Deadly 提交于 2020-01-10 13:39:45
selenuim.properties文件涉及一些个人信息,自己加 package selenium ; import org . openqa . selenium . By ; import org . openqa . selenium . Keys ; import org . openqa . selenium . WebDriver ; import org . openqa . selenium . chrome . ChromeDriver ; import org . openqa . selenium . chrome . ChromeOptions ; import org . openqa . selenium . interactions . Actions ; import java . io . IOException ; import java . util . Properties ; import java . util . Set ; public class Case { private ChromeDriver driver = new ChromeDriver ( ) ; public void login ( ) { ChromeOptions options = new ChromeOptions ( ) ; driver . get

Expression-bodied properties vs. {get; set;} [duplicate]

荒凉一梦 提交于 2020-01-10 10:25:08
问题 This question already has answers here : C# 3.0 auto-properties — useful or not? [closed] (18 answers) Closed 2 years ago . When I have Visual Studio 2017 generate properties for me, it will always use the new expression-bodied properties, for example: private static string username; internal static string Username { get => username; set => username = value; } Is there any advantage of using this style over the following or is it just a matter of preference and readability? internal static

Expression-bodied properties vs. {get; set;} [duplicate]

社会主义新天地 提交于 2020-01-10 10:22:17
问题 This question already has answers here : C# 3.0 auto-properties — useful or not? [closed] (18 answers) Closed 2 years ago . When I have Visual Studio 2017 generate properties for me, it will always use the new expression-bodied properties, for example: private static string username; internal static string Username { get => username; set => username = value; } Is there any advantage of using this style over the following or is it just a matter of preference and readability? internal static

Log4J change File path dynamically

早过忘川 提交于 2020-01-10 08:57:08
问题 I want to change the path and file name of my log4j logfile dynamically. I have read a lot of pages and nearly every tell me that I should use system properties like here: how to change the log4j log file dynamically? So my log4j.properties file looks like this: log4j.logger.JDBC_LOGGER=INFO,jdbcTests log4j.additivity.JDBC_LOGGER = false log4j.appender.jdbcTests=org.apache.log4j.FileAppender log4j.appender.jdbcTests.File=${my.log} log4j.appender.jdbcTests.layout=org.apache.log4j.PatternLayout