小编jpr*_*ova的帖子

调试Spring配置

我正在开发一个使用Spring和Hibernate并在Websphere上运行的Java应用程序.我遇到了一个问题,我希望Spring将Dao加载到我的对象中,但由于某种原因,这种情况不会发生.(用同样的方式指定的另一个Dao被装好了.)

问题是 - 我如何调试Spring如何决定加载什么?我可以打开Spring的日志记录,在哪里?

java websphere configuration spring hibernate

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

如何允许SQL Server用户插入/更新/删除数据,但不能更改架构?

我的应用程序(C#,ASP.Net)需要在数据库中插入,更新和删除数据,并运行存储过程.我需要阻止它修改数据库模式 - 不更改表,创建或删除,不存储过程的更改.

我需要向应用程序用户授予哪些权限组合?只是'select'不起作用,因为它需要在表中插入/更新/删除数据.

如何检查特定登录的权限和访问权限?如何授予或拒绝登录权限和访问权限?我需要授予新用户(登录)权限才能访问一个数据库.

使用SQL Server 2008 R2和SSMS.

user-roles sql-server-2008-r2 c#-4.0

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

如何组合多个基于uiBinder的小部件?

我需要在一个特定的位置插入一个[基于uiBinder的小部件]到另一个小部件.插入的小部件有一个有点复杂的布局,所以我试图用HTML定义它.

referencePanel.add(...)因java.lang.IllegalStateException而失败:此小部件的父级未实现HasWidgets.不知道哪个小部件的父级不满意 - innerPanel或referencePanel.

如果将ReferenceUI对象添加到RootPanel,然后将其添加到页面底部.但如果它首先添加到RootPanel,那么在添加到referencePanel时会出现JavaScriptException Code 3(HIERARCHY_REQUEST_ERR).

有什么建议?

public class AppUIDemo extends Composite {
    @UiTemplate("AppUIDemo.ui.xml")
    interface AppUIDemoUiBinder extends UiBinder<Widget, AppUIDemo> {
    }

    @UiTemplate("ReferenceUI.ui.xml")
    interface ReferenceUIUiBinder extends
            UiBinder<Widget, ReferenceUI> {
    }

    private static AppUIDemoUiBinder uiBinder = GWT
            .create(AppUIDemoUiBinder.class);
    private static ReferenceUIUiBinder refUIBinder = GWT
            .create(ReferenceUIUiBinder.class);

    @UiField
    FlowPanel referencePanel;

    public AppUIDemo() {
            initWidget(uiBinder.createAndBindUi(this));
            ReferenceUI reference = new ReferenceUI(refUIBinder);

            HTMLPanel innerPanel = reference.getRefPanel();
            innerPanel.getElement().setId(HTMLPanel.createUniqueId());
            referencePanel.add(innerPanel);
        }
}
Run Code Online (Sandbox Code Playgroud)

 

public class ReferenceUI extends Composite {

    interface ReferenceUIUiBinder extends
            UiBinder<Widget,ReferenceUI> {
    }

    private static ReferenceUIUiBinder …
Run Code Online (Sandbox Code Playgroud)

java xml gwt widget uibinder

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

Ansible 无法腌制“模块”对象

运行剧本

$ ansible-playbook 测试-playbook.yml

获取错误响应

错误!意外异常,这可能是一个错误:无法pickle“模块”对象

也试过了shell: "echo text",同样的错误。

Ansible 版本 2.9,Python 3.8,在 Macos 上运行。

测试-playbook.yml:

---
  - name: run on localhost
    hosts: localhost
    gather_facts: false
    connection: local

    tasks:

      - name: some name
        debug:  
          msg: "some text"
...
Run Code Online (Sandbox Code Playgroud)

完整输出:

$ ansible-playbook test-playbook.yml 
[WARNING]: No inventory was parsed, only implicit localhost is available

[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does
not match 'all'


PLAY [run on localhost] *************************************************************************************

TASK [some …
Run Code Online (Sandbox Code Playgroud)

ansible

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

以编程方式将子帖子插入Wordpress

我需要以编程方式为用户通过仪表板创建或更新的每个Wordpress帖子创建一个帖子(或页面)。我加了一个挂钩

add_action( 'publish_post', 'create_details_page');
Run Code Online (Sandbox Code Playgroud)

仅当用户在特定类别中创建或更新帖子,并且在其他类别中创建自动帖子时,才会创建自动帖子。每个帖子仅属于一个类别。创建帖子,如下所示:

        $auto_post = array(
                'comment_status' => 'closed',
                'post_category' => array($category->term_id),
                'post_author' => $latest_post[0]->post_author,
                'post_type' => 'post',
                'post_title' => 'Details for ' . $latest_post[0]->post_title,
                'post_parent' => $latest_post[0]->ID,
                'post_content' => 'Post content'
        );
        $auto_post_id = wp_insert_post ( $auto_post, true );
        $details = get_post( $auto_post_id );
        wp_publish_post( $auto_post_id );
Run Code Online (Sandbox Code Playgroud)

结果不一致:有时我创建了一个自动发布,有时创建了两个,有时却没有。为什么,以及如何精确地插入帖子一次?

要将自动发布作为用户创建的帖子的子代来检索:

$args = array(
        'post_type' => 'post',
        'post_parent' => $parent_post_id,
        'post_status' => 'publish'
        /* 'category_name' => array('Auto Post Category') */
);
$children = get_posts( $args );
Run Code Online (Sandbox Code Playgroud)

添加category_name参数将导致根本不检索任何子帖子。如果没有category参数,则返回子帖子,并且它们具有category set属性。但是,似乎未检索到完整列表,并且每次运行的结果都不同。

如果随后从仪表板编辑了自动发布的内容,则上面的查询不会返回此编辑过的帖子。为什么? …

php wordpress parent-child taxonomy

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

GWT:对多个页面使用相同的UI模板?

如何使用与从Composite扩展的多个Java对象相同的UI模板(*.ui.xml文件)?

我需要构建几个页面,这些页面应该以相同的布局显示基本相同的信息,但在一个页面上,某些字段将是可编辑的,而在另一个页面上,其他字段将是可编辑的.我想在ui.xml中只指定一次布局,并在不同的*.java类中创建不同的行为.

Eclipse给我一个语法错误"缺少FirstAppUI.ui.xml"

@UiTemplate("Template.ui.xml")
public class FirstAppUI extends Composite {
  interface FirstAppUIUiBinder extends
          UiBinder<Widget, FirstAppUI> {
  }
}
Run Code Online (Sandbox Code Playgroud)

谢谢!简·普鲁萨科娃

eclipse gwt uibinder

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

Telerik网格:使用Ajax绑定检索行计数

如何在Telerik ASP.Net MVC网格中使用Ajax绑定访问网格行计数?我需要在页脚中显示总数,请参阅下面的代码段.总计必须在插入和删除时更新.

使用服务器绑定时,有@ Model.Count().如何使用Ajax绑定执行相同的操作?

谢谢!

    @{
    Html.Telerik()
        .Grid<ContractMonth>()
        .Name("contractMonthGrid")
        .DataBinding(dataBinding => dataBinding
            .Ajax()
            .Select("_AjaxBinding", "ContractMonth")
            .Insert("_AjaxInsert", "ContractMonth")
            .Delete("_AjaxDelete", "ContractMonth")
            )
        .DataKeys(keys => keys.Add(c => c.Id))
        .ToolBar(commands => commands.Insert())
        .Columns(columns =>
        {
            columns.Bound(o => o.StartDate).EditorTemplateName("Date").FooterTemplate(@<text>@Model.Count()</text>);
Run Code Online (Sandbox Code Playgroud)

ajax asp.net-mvc telerik

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