configuration

Struts 2 Acceptable Parameter's Names

岁酱吖の 提交于 2020-01-14 04:52:06
问题 In order to take control of the parameters which an action accept you must: Make your action implement ParameterNameAware like: public class sample implements ParameterNameAware(){ public boolean acceptableParameterName(String parameterName) { if (("amount".equals(parameterName) || "sourceAccount".equals(parameterName) || "destinationAccount".equals(parameterName)) return true; else return false; } } This method is called for the excluded properties of param properties. So, you need to

android app/business-logic config

主宰稳场 提交于 2020-01-14 03:04:49
问题 how does an app developer store app-specific (ie. my server addresses, path endpoints, etc.) global and build variant specific config values in an android app? further, is it possible to have overrides? ie. i want to set a default value in my global.config, but collisions in staging-build-variant.config and prod-build-variant.config should override this, while dev-build-variant.config would simply use the default value. i've read about SharedPreferences but this seems for storing user input

NHibernate using single configuration file to connect to multiple dbs

孤街醉人 提交于 2020-01-14 02:22:08
问题 I'd like to have a single configuration file and then when I'm creating a session change the hibernate-configuration->session-factory->connection.connection_string property to what I want it to be programmatically? Is it possible? UPDATE: I believe I may be able to do this like this Configuration cfg = new Configuration(); cfg.Configure(sessionFactoryConfigPath); cfg.Properties["connection.connection_string"] = ... What I would wonder than, if that is ok, Is this a bad way to handle

HAProxy 1.4 - Don't log 2xx, only log 5xx

柔情痞子 提交于 2020-01-14 02:22:06
问题 Good evening, I'm using HAProxy (ver 1.4.24) as a load balancer for ~3000 requests per second. I am trying to log only 5xx responses, but I am unable to achive that. I am using the following configuration: http://pastebin.com/TsTk9GQE This configuration also logs 2xx requests, as long as 5xx and 4xx. I need only 5xx and 4xx, or just 5xx. Thanks, 回答1: There is an option called "dontlog-normal" in HAProxy to log only errors (whatever type of errors). Just enable it in your defaults section.

How to pass system property to map function in hadoop

泄露秘密 提交于 2020-01-14 02:21:07
问题 is there a way how to pass system parameter (something like -Dmy_param=XXX) to map function in hadoop map reduce framework. Submission of job to hadoop cluster is done via .setJarByClass(). In mapper I have to create configuration so I would like to make it configerable so I thought that standard way via property file would be ok. Just struggling with passing parameter where the property is set. Another way would be to add property file to submitted jar. Does someone have an experience how

Spring Boot & Thymeleaf with XML Templates

老子叫甜甜 提交于 2020-01-13 18:57:09
问题 I have a Spring Boot application with a controller that returns a ModelAndView and Thymeleaf to render templates, where the templates live in /src/main/resources/templates/*.html This works fine, but How can I configure Spring and/or Thymeleaf to look for xml files instead of html? If it helps, I'm using Gradle with the org.springframework.boot:spring-boot-starter-web dependency to set things up. I am currently running the server using a class with a main method. 回答1: After trying and failing

Struts 2 Convention Plugin and JSP files under WEB-INF

蹲街弑〆低调 提交于 2020-01-13 18:11:11
问题 When using Struts2 convention plugin, the plugin automatically forwards a hello-world.action request to /WEB-INF/content/hello-world.jsp even if no HelloWorld.java is defined. Please see http://struts.apache.org/release/2.1.x/docs/convention-plugin.html for that. On the other hand, we put JSP files under WEB-INF to avoid any direct access to JSP files. I think this behavior of convention plugin ruins JSP access policy. Any one can make a direct access to a JSP by simply calling a, build on

Struts 2 Convention Plugin and JSP files under WEB-INF

喜夏-厌秋 提交于 2020-01-13 18:11:10
问题 When using Struts2 convention plugin, the plugin automatically forwards a hello-world.action request to /WEB-INF/content/hello-world.jsp even if no HelloWorld.java is defined. Please see http://struts.apache.org/release/2.1.x/docs/convention-plugin.html for that. On the other hand, we put JSP files under WEB-INF to avoid any direct access to JSP files. I think this behavior of convention plugin ruins JSP access policy. Any one can make a direct access to a JSP by simply calling a, build on

Regex in Apache 'if' directive … what's wrong here?

时间秒杀一切 提交于 2020-01-13 11:33:29
问题 (A possible bug in Apache is now suspected ... see below.) Here's the statements: (Apache 2.4) <IfDefine !SERVER_TYPE> Define SERVER_TYPE prod </IfDefine> <If "${SERVER_TYPE} !~ /prod|demo|test/"> <===error here=== Error "Define 'SERVER_TYPE' is hosed'" </If> Apache complains about the IF: Cannot parse condition clause: syntax error, unexpected T_OP_NRE, expecting '(' I can guess that T_OP_NRE refers to "negated regular-expression" i.e. "!~" but I can't for the life of me figure out what's

FitNesse configuration files

耗尽温柔 提交于 2020-01-13 10:29:28
问题 I'm using FitNesse as a functional testing framework. I'm running into trouble when FitNesse runs code that needs configuration. If I need to get a connection string from the configuration file, I can get it to work by adding it to the FitServer.exe.config. However, I don't like that solution. I would like FitNesse to load my own configuration file, namely TheNameOfMyApp.dll.config. Is this possible? 回答1: Sure, easy to do. I'm assuming you're using the dotnet or dotnet2 test runner. I'm using