小编qxl*_*lab的帖子

如何消除php5严格的标准错误?

将我的PHP升级到5.4.3(WAMP服务器2.2)后,我在CakePHP 1.3中创建的Web应用程序在我的索引中显示以下错误:

严格的标准:重新定义C语言中类Object的已定义构造函数:第63行的...\cake\cake\libs\object.php

严格的标准:非静态方法Configure :: getInstance()不应该在第49行的C:...\cake\cake\bootstrap.php中静态调用

我发现有些人通过将error_reportingphp.ini 设置为来解决这个问题E_ALL & ~E_STRICT.

我在我的计算机上存在的php.ini文件(C:\ wamp\bin\php\php5.4.3和C:\ wamp\bin\apache\apache2.4.2\bin)中都这样做但它没有解决问题.

我也尝试php_value error_reporting 6143输入C:...\cake.htaccess但没有成功.

有谁知道我该如何解决这个问题?由于火鸟,我无法升级我的CakePHP.

php cakephp cakephp-1.3

26
推荐指数
3
解决办法
8万
查看次数

无法自动装配ServletContext

我是Spring的新手,我正在尝试使用带有class属性的ServletContext的@Autowire注释:

@Controller
public class ServicesImpl implements Services{

    @Autowired
    ServletContext context;
Run Code Online (Sandbox Code Playgroud)

我在dispatcher-servlet.xml中为这个类定义了bean:

<bean id="services" class="com.xxx.yyy.ServicesImpl" />
Run Code Online (Sandbox Code Playgroud)

但是当我尝试运行JUnit测试时,会出现以下错误:

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [javax.servlet.ServletContext] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
Run Code Online (Sandbox Code Playgroud)

我认为ServletContext注入是自动弹簧...我该如何解决这个问题?

谢谢!

编辑:我想使用servletContext来调用getRealPath()方法.还有其他选择吗?

spring

19
推荐指数
2
解决办法
2万
查看次数

已保存密码的Chrome问题 - 连续表单提交重试

我的网络应用程序(JSF - PrimeFaces)开始在谷歌Chrome更新59上出现问题.在58上它很好,在其他所有浏览器上都可以.

发生的情况是,当用户首次登录时,如果用户接受Chrome保存密码,则一旦用户退出或用户随时返回此页面,Chrome会自动尝试将登录表单提交为空密码,并在失败时继续尝试.

我的表格上有什么问题吗?

我创建了一个示例应用程序来演示问题:

https://powerful-badlands-23851.herokuapp.com/test

重现步骤:

  1. 使用chrome 59,使用"test@test.com"密码"test"登录
  2. 当Chrome询问您是否要保存密码时,请说"是"
  3. 现在点击退出...你会看到这个错误

谢谢

html forms google-chrome primefaces

6
推荐指数
1
解决办法
379
查看次数

&lt;p:确认消息&gt;中的换行符

如何在的消息中添加新行<p:confirm>

<p:confirm header="COnfirmation"  
    message="Are you sure you want to continue? Bla bla bla" 
    icon="ui-icon-alert"  />
Run Code Online (Sandbox Code Playgroud)

我希望将“ Bla bla bla”换行。

confirm jsf newline primefaces jsf-2

5
推荐指数
2
解决办法
2万
查看次数

具有多个连接可能性的连接的MySQL更新

概念上的疑问:

我已经尝试了很多事情(MySQL),但是此更新起作用的唯一方法是我在此处描述的方法。它正在工作,但是我要确保这一点:

当我们在更新中使用join时,我将要设置的值来自被连接的表,并且每一行有多个连接可能性,更新是否总是获得进行连接的第一行?

create table letter (id_letter bigint, id_group_table bigint, letter char(1));  
create table group_table (id_group_table bigint, id_whatever bigint, champion char(1));
create table whatever (id_whatever bigint);

insert into whatever values (1);
insert into whatever values (2);
insert into whatever values (3);
insert into whatever values (4);
insert into whatever values (5);

insert into group_table values(1, 1, null); -- champion should be B
insert into group_table values(2, 2, null); …
Run Code Online (Sandbox Code Playgroud)

mysql sql join sql-update

5
推荐指数
1
解决办法
431
查看次数

如何 spring-boot: 在多模块项目的根 pom.xml 上运行

我有一个带有 Spring Boot 的多模块项目。

我的根 pom.xml 只包含这个:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.something</groupId>
    <artifactId>my-application</artifactId>
    <version>0.1.0</version>
    <packaging>pom</packaging>

    <modules>
        <module>library</module>
        <module>application</module>
    </modules>

</project>
Run Code Online (Sandbox Code Playgroud)

spring-boot-maven-pluginapplication模块上,如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.something.tcc</groupId>
    <artifactId>my-application-application</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.7.RELEASE</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>
        <jsf.version>2.2.11</jsf.version>
    </properties>

    <dependencies>
        <!-- use this for automatic hot deployment on code changes -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId> …
Run Code Online (Sandbox Code Playgroud)

java maven spring-boot

5
推荐指数
2
解决办法
1895
查看次数

什么是高并发性的良好骨骼配置

我有一个必须处理高并发性的Web应用程序,例如100个用户查询相同的5个表(其中一个,返回超过500行)以及其他一些用户同时插入这些表.

当用户太多时,并发性太高,我的应用程序挂起,我必须重启tomcat.我在日志中找不到多少.当我执行"show process list;"时 在MySQL中,每个连接都有进程,其中大多数都处于状态"查询"...在应用程序挂起之前,一个进程一个进入"睡眠"状态,直到所有进程都具有此状态并且应用程序挂起.

诊断正在发生的事情是非常困难的...我正在尝试更好地同步代码,但没有任何成功......好吧,我在这里询问有关我是否使用了一个好的骨骼配置的意见在这种环境中:

<property name="bonecp.idleMaxAgeInMinutes">10</property>
            <property name="bonecp.maxConnectionAgeInSeconds">3000</property>   
            <property name="bonecp.idleConnectionTestPeriodInMinutes">5</property>
            <property name="bonecp.connectionTestStatement">/* ping */ SELECT 1</property>
            <property name="bonecp.partitionCount">2</property>
            <property name="bonecp.acquireIncrement">2</property>
            <property name="bonecp.maxConnectionsPerPartition">12</property>
            <property name="bonecp.minConnectionsPerPartition">5</property>
            <property name="bonecp.statementsCacheSize">50</property>
            <property name="bonecp.releaseHelperThreads">3</property>
Run Code Online (Sandbox Code Playgroud)

根据我的MySQL配置,我使用默认设置,除了这两个:

autocommit = 0
innodb_thread_concurrency = 8 
Run Code Online (Sandbox Code Playgroud)

(服务器有3个CPU和1个磁盘)

你们劝我改变什么吗?谢谢!

mysql jdbc bonecp

4
推荐指数
1
解决办法
1761
查看次数

Primefaces commandLink仅在单击两次后更新数据

以下代码是关于一个表,我可以在其中添加(commandButton)或删除(commandLink)行.这两个按钮都在工作并调用相应的bean方法.但是,对于每次单击添加按钮将更新表立即添加一行,对于删除按钮,我必须单击它两次以删除行.即使第一次没有删除该行,也会调用bean方法.我该怎么办?谢谢!

    <h:form id="form">
        <table>
            <tr>
                <td>
                    <h:panelGrid columns="2" width="100%">
                        <p:dataTable id="univertitiesTable" value="#{universityBean.universityList}" var="university"
                            editable="true" editMode="cell" style="align:center;" >

                            <p:column headerText="Name" style="width:80px" >
                                <p:inputText value="#{university.name}" style="width:25px;" id="nameField"  label="name"  />
                            </p:column>

                            <p:column headerText="" style="width:20px; ">
                                <p:commandLink actionListener="#{universityBean.deleteUniversity}" update="univertitiesTable" id="removeButton" ajax="true">
                                    <h:graphicImage value="/resources/icones/delete.gif" />
                                    <f:setPropertyActionListener value="#{university}"
                                        target="#{universityBean.university}" />
                                </p:commandLink> 
                            </p:column>
                        </p:dataTable>

                        <p:commandButton value="+" update="univertitiesTable" id="addButton" ajax="true"
                            actionListener="#{universityBean.addUniversity}"
                            styleClass="ui-priority-primary"  />

                    </h:panelGrid>                  
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <h:commandButton id="save" value="Save"
                        action="#{universityBean.save}" binding="#{save}" />
                </td>
            </tr>
        </table>    
    </h:form>
Run Code Online (Sandbox Code Playgroud)

datatable commandlink primefaces jsf-2

2
推荐指数
1
解决办法
4571
查看次数

使用反射从 POJO 获取 id 列名称

@Entity
@Table(name="MY_TABLE")
public class MyTable{

    @Id 
    @Column(name="MY_TABLE_ID") 
    @GeneratedValue(strategy = GenerationType.AUTO ,generator="SQ_MY_TABLE")    
    @SequenceGenerator(name="SQ_MY_TABLE", sequenceName="SQ_MY_TABLE")
    private Long myTableId;
Run Code Online (Sandbox Code Playgroud)

如何使用反射从 POJO 中获取使用javax.persistence.Id注释定义的主键列名称?我必须找到@Id然后获取注释name的属性@Column...我不知道该怎么做...

谢谢!

java reflection annotations jpa

2
推荐指数
1
解决办法
4724
查看次数