小编use*_*895的帖子

Apache POI中行的自动大小高度

我正在使用Apache POI将值输入到电子表格中.这些值有换行符,我能够成功使用此代码:

CellStyle style = cell.getCellStyle()
style.setWrapText(true)
cell.setCellStyle(style)
Run Code Online (Sandbox Code Playgroud)

不幸的是,虽然文本正确包装,但行的高度并不总是足以显示内容.如何确保我的行总是正确的高度?

java excel apache-poi

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

如何在XCode 4.3中创建新的View Controller

所以我已经想到在XCode 4.3中,要创建一个新的ViewController,我必须做New> Objective-C Class,然后继承UIViewController.但是,为什么xib复选框显示为灰色?如何使用xib创建新的视图控制器?

在此输入图像描述

iphone xcode

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

Amazon DynamoDB映射枚举

我需要映射Amazon DynamoDB的User类.User对象的一个​​属性是AccountType(枚举).我该如何处理?下面是我尝试过的枚举和代码.

public enum AccountType {
    TYPE_A,
    TYPE_B
}
Run Code Online (Sandbox Code Playgroud)

-

@DynamoDBAttribute(attributeName="AccountType")   *<< THIS FAILS*
public AccountType getAccountType() {
    return accountType;
}
Run Code Online (Sandbox Code Playgroud)

任何帮助,将不胜感激.

java amazon-web-services amazon-dynamodb

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

SpriteKit中的持续移动

我有一个游戏,我想向左或向右移动一个SKNode,具体取决于用户是否触摸屏幕的左侧或右侧.如何在用户触摸屏幕时将恒定运动应用于节点?

ios sprite-kit

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

iOS中的亚马逊产品广告API签名

我正在尝试在我的iOS应用程序中访问亚马逊的产品广告API.创建签名似乎是一个艰难的部分.在本页面:

http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/rest-signature.html

它说"使用SHA256哈希算法计算符合RFC 2104的HMAC".亚马逊还提供了一个java类来为您执行此操作:

http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/AuthJavaSampleSig2.html

有人知道我如何在Objective-C中做到这一点吗?我查看了AWS iOS SDK,但它似乎没有包含Product Advertising API.

amazon objective-c amazon-web-services amazon-product-api ios

14
推荐指数
4
解决办法
3978
查看次数

自定义UITableViewCell的覆盖

我有一个UITableViewCell我这样使用的自定义:

AppTableCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"AppTableCell" owner:self options:nil];  
    for(id currentObject in topLevelObjects) {
        if([currentObject isKindOfClass:[AppTableCell class]]) {
            cell = (AppTableCell *)currentObject;
            break;
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

工作完美无瑕.但是,我想在创建时为单元格做一些自定义的事情.通常我会覆盖类似的东西initWithFrame,但它没有在这里使用.我应该覆盖哪种方法来自定义初始化?

iphone ios

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

没有名为authenticationManager的bean

可能重复:
获取错误org.springframework.beans.factory.NoSuchBeanDefinitionException:没有定义名为'springSecurityFilterChain'的bean

在我的Spring应用程序中,我不断收到此错误:

No bean named 'org.springframework.security.authenticationManager' is defined: Did you forget to add a gobal <authentication-manager> element to your configuration (with child <authentication-provider> elements)? Alternatively you can use the authentication-manager-ref attribute on your <http> and <global-method-security> elements.
Run Code Online (Sandbox Code Playgroud)

在我的Spring Security上下文xml文件中,我定义了以下内容:

<beans:bean id="myUserDetailsService" class="com.myProject.core.security.MyUserDetailsService" />

<beans:bean id="encoder" class="com.myProject.core.security.HmacPasswordEncoder" />

<authentication-manager id="clientAuthenticationManager" >
    <authentication-provider user-service-ref="myUserDetailsService">
        <password-encoder ref="encoder" />
    </authentication-provider>
</authentication-manager>
Run Code Online (Sandbox Code Playgroud)

当我明确定义了我的身份验证管理器和身份验证提供程序时,有什么想法让它抱怨吗?

注意:这可能会有所帮助,这是一个更具描述性的错误:

org.springframework.beans.factory.BeanCreationException: Error creating bean with 
name 'org.springframework.security.filterChains': Cannot resolve reference to bean
'org.springframework.security.web.DefaultSecurityFilterChain#2' while setting bean
property 'sourceList' with key …
Run Code Online (Sandbox Code Playgroud)

java spring spring-security

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

未知的弹簧标签

我下载了springource工具套件,并创建了一个springMVC模板项目(hello world).工作得很好.我刚刚添加了一个简单的表单,而spring标签似乎不起作用.STS无法识别标签,并且在加载时它们无法在页面上正确呈现.有任何想法吗?

simpleForm.jsp:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<form:form action="formOutput.html" commandName="user">
    <table align="center">
        <tr>
            <td>Username:</td>
            <td><form:input path="userName" /></td>
        </tr>
        <tr>
            <td>First Name:</td>
            <td><form:input path="firstName" /></td>
        </tr>
        <tr>
            <td>Last Name:</td>
            <td><form:input path="lastName" /></td>
        </tr>
        <tr>
            <td>Email:</td>
            <td><form:input path="email" /></td>
        </tr>
        <tr>
            <td>Mobile Number:</td>
            <td><form:input path="mobile" /></td>
        </tr>
        <tr>
            <td></td>
            <td><input type="submit" value="Submit" /></td>
        </tr>
    </table>
</form:form>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

有任何想法吗?

java spring spring-mvc sts-springsourcetoolsuite

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

从@RequestParam获取没有指定名称的值

我知道如果参数看起来像这样:

@RequestParam("userId") String userId
Run Code Online (Sandbox Code Playgroud)

我可以通过调用这个获得值:

requestParam.value()
Run Code Online (Sandbox Code Playgroud)

但是如果我没有指定名称,Spring会自动使用变量名.像这样:

@RequestParam String userId
Run Code Online (Sandbox Code Playgroud)

如果未指定param名称,我该如何访问它?我知道它可能因为Spring以某种方式做到了,但在这种情况下requestParam.value()是空白的.

java spring annotations

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

iOS7中UIActionSheet旁边的奇怪工件

我的iOS7应用程序在UIActionSheet中有一个奇怪的视觉错误.如下所示.有什么想法吗?

在此输入图像描述

码:

UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Done" destructiveButtonTitle:nil otherButtonTitles:nil];
[actionSheet showInView:self.view];
Run Code Online (Sandbox Code Playgroud)

ios ios7

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