小编Lis*_*aMM的帖子

从相应的格鲁吉亚日期显示高级图表中的波斯日期

我们可以使用格里高利日期和格鲁吉亚语到波斯语日期转换器脚本来显示波斯日期HighchartHighstock吗?

javascript highcharts

10
推荐指数
3
解决办法
3073
查看次数

无法创建[org.springframework.orm.jpa.SharedEntityManagerCreator]类型的内部bean'(内部bean)'?

我使用了基于Java的配置.当我使用jpa存储库时,我得到了can not create inner bean exception of type shared entity manger creator.

Spring contex配置:

@Configuration
@ComponentScan(basePackages = { "com.sample.proj.controller" })
@EnableWebMvc
@EnableTransactionManagement
@EnableJpaRepositories("com.sample.proj.domain")
@PropertySource("classpath:application.properties")
public class ServletContextConfig {

    private static final String PROPERTY_NAME_DATABASE_DRIVER = "db.driver";
    private static final String PROPERTY_NAME_DATABASE_URL = "db.url";
    private static final String PROPERTY_NAME_DATABASE_USERNAME = "db.username";
    private static final String PROPERTY_NAME_DATABASE_PASSWORD = "db.password";
    private static final String PROPERTY_NAME_HIBERNATE_DIALECT = "hibernate.dialect";
    private static final String PROPERTY_NAME_HIBERNATE_FORMAT_SQL = "hibernate.format_sql";
    private static final String PROPERTY_NAME_HIBERNATE_NAMING_STRATEGY = "hibernate.ejb.naming_strategy";
    private …
Run Code Online (Sandbox Code Playgroud)

spring jpa spring-mvc spring-data

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

Jquery UI结合了可排序和可拖动

我正在尝试组合一个可拖动的面板(在顶部)和一个可排序的面板(底部).

拖动工作正常,但排序失败.

这是我的JS小提琴:http: //jsfiddle.net/dmUKY/9/

drag'n drop和sortable函数共享该droppable:drop函数.排序元素时,该函数必须替换所选对象.

 drop: function (event, ui) {
    //alert($(this).parent().html());
    //alert($(ui.helper).attr('class'));
    var obj;
    if ($(ui.helper).hasClass('draggable')) {
        //alert('draggable');
      obj = $(ui.helper).clone();  
      obj.removeClass('draggable').addClass('editable')
      //obj.addClass('droppable');
      $(this).parent().append(obj);

    }


    //alert($(this).parent().html());
}
Run Code Online (Sandbox Code Playgroud)

我应该如何结合这两个功能?

jquery draggable jquery-ui-sortable jquery-ui-draggable

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

为什么我收到AngularJs帖子的400个错误请求?

我使用Spring MVC和AngularJs来创建Web应用程序.我向服务器发送请求,但我收到了400 error bad request.我在Spring servlet配置文件中为json格式配置了消息转换器.我想知道为什么我得到这个错误.

这是我的角度服务:

save : function(user) {
    return $http({
        method: 'POST',
        url: '/app-web/user/create',
        contentType: "application/json",
        data:user
    });
}
Run Code Online (Sandbox Code Playgroud)

在服务器端,我有一个Spring MVC Controller,如下所述:

@RequestMapping(value="/user/create", method= RequestMethod.POST)
@ResponseBody
public String createAccount(@RequestBody User user){
  //some logic
    return "Ok";
}
Run Code Online (Sandbox Code Playgroud)

我注意到了其他的东西:当我@RequestBody在控制器中删除时,我没有400错误,但用户是null:

@RequestMapping(value="/user/create", method= RequestMethod.POST)
@ResponseBody
public String createAccount(User user){
  //some logic
    return "Ok";
}
Run Code Online (Sandbox Code Playgroud)

java spring spring-mvc angularjs

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

使用Retrofit库获取简单的JSON对象响应

我有一个带有JSON响应的Web查询:

{
    "status":true,
    "result":
      {
        "id":"1",
        "name":"ABC 1",
        "email":"info@ABc.dcom",
        "password":"123456",
        "status":false,
        "created":"0000-00-00 00:00:00"
      },
    "message":"Login successfully"
}
Run Code Online (Sandbox Code Playgroud)

我使用以下代码:

@GET("/stockers/login")
public void login(
        @Query("email") String email,
        @Query("password") String password,
        Callback<JSONObject> callback);
Run Code Online (Sandbox Code Playgroud)

在Debugger中,由Retrofit库进行的查询是正确的,但是我得到了一个空的JSON作为响应.

ApiManager.getInstance().mUrlManager.login(
        email.getText().toString().trim(),
        password.getText().toString().trim(),
        new Callback<JSONObject>()
        {
            @Override
            public void success(JSONObject jsonObj, Response response)
            {
                mDialog.dismiss();
Run Code Online (Sandbox Code Playgroud)

android json retrofit

7
推荐指数
4
解决办法
3万
查看次数

Magento:在后端代码中以编程方式创建订单

我尝试在Magento(1.5.1.0)的后端创建一个订单.

这是一些代码:

        // Get the product id stored in the optionValue of the widget
        $productId = $order['customIdNumber'];

        // Load the product
        $product = Mage::getModel('catalog/product')->load($productId);

        // Check whether the product could be loaded
        if($product->getId())
        {
            // Get the customer model
            $customer = Mage::getModel('customer/customer');

            // Set the website id associated with the customer
            $customer->setWebsiteId(Mage::app()->getWebsite()->getId());

            // Try to load the customer by email
            $customer->loadByEmail($order['personAddresses'][0]['email']);

            // Check whether the customer not exists
            if(!$customer->getId())
            {
                // Create the customer
                $customer->setEmail($order['personAddresses'][0]['email']);
                $customer->setFirstname($order['personAddresses'][0]['firstName']);
                $customer->setLastname($order['personAddresses'][0]['lastName']);
                $customer->save();
            }

            // …
Run Code Online (Sandbox Code Playgroud)

php backend magento

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

Checkstyle"'id'的预期@param标签"错误

我在我的代码库中使用checkstyle,http: //checkstyle.sourceforge.net/,我对JAVADOC有疑问.

我有这样的静态函数:

 **
 * @param id
 */
public static void getName(final String id) {
 }
Run Code Online (Sandbox Code Playgroud)

checkstyle抱怨的地方

'id'的预期@param标签

当我给出类似的描述时

@param id id
Run Code Online (Sandbox Code Playgroud)

然后它工作正常,但我不想给每个参数的描述并返回.有没有办法解决这个问题?

java checkstyle

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

在Kettle下使用xstream时nodecom.thoughtworks.xstream.mapper.CannotResolveClassException

我使用的XStream水壶下反序列化XML的Java对象,它总是给我的例外: nodecom.thoughtworks.xstream.mapper.CannotResolveClassException

然后我分别从Kettle和一个简单的Java应用程序中尝试了我的代码.它工作正常.例如:

public static void main(String[] args) {
    person p = new person("JJ", "MM");
    XStream xstream = new XStream(new DomDriver());
    xstream.alias("personname", person.class);
    String xml = xstream.toXML(p);
    person pp = (person) xstream.fromXML(xml);
    System.out.println(pp.toString());
}


public class person {

    private String firstname;
    private String lastname;

    public person(String first, String last) {
        this.firstname = first;
        this.lastname = last;
    }

    public String getFirstname() {
        return this.firstname;
    }

    public String getLastname() {
        return this.lastname;
    }

    public void setFirstname(String name) {
        this.firstname = name;
    } …
Run Code Online (Sandbox Code Playgroud)

xstream kettle

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

如何提高Java中的Hibernate性能?

我有数千条记录需要在单个用户点击时检索.目前它给我的结果很慢,我要等很长时间.有没有办法改善使用hibernate检索这些结果?

我有一种情况,其中具有选择查询的方法将每分钟运行一次.这就是Hibernate给我缓慢结果的地方.我正在使用Hibernate和MySQL.

java hibernate

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

使用spring 3 restful以编程方式更改http响应状态

我有一个像下面这样的控制器

@Controller("myController")
@RequestMapping("api")
public class MyController {

     @RequestMapping(method = RequestMethod.GET, value = "/get/info/{id}", headers = "Accept=application/json")
    public @ResponseBody
    Student getInfo(@PathVariable String info) {
.................
}




    @ExceptionHandler(Throwable.class)
    @ResponseStatus( HttpStatus.EXPECTATION_FAILED)
    @ResponseBody
    public String handleIOException(Throwable ex) {
        ErrorResponse errorResponse = errorHandler.handelErrorResponse(ex);
        return errorResponse.toString();
    }

}
Run Code Online (Sandbox Code Playgroud)

控制器有一个错误处理机制,在错误处理选项中它总是返回期望失败状态代码417.但我需要根据错误类型设置动态错误Http状态代码,如500,403等.我该怎么做呢?

java spring spring-mvc

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