我的最新规范是允许创建招聘广告;所以我想要html textarea中的基本富文本编辑功能。据我所知,似乎没有明显的赢家?到目前为止,我发现:
哪个获得投票,还是我错过了获胜者?我已经在使用jquery和jquery-ui,因此任何与它们平滑集成的东西都将特别好。
是否可以通过CDN获得任何信息,或者我必须自己下载并提供该库?
它增加了新的,但据我所知,它不会丢弃旧的?
当我说旧的实体时,我的意思是现在完全删除的实体对象的属性,以前它们存在并注释了 @column
我是唯一可以手动删除col或将配置值更改为create?的选项?两者都不是特别迷人.
或者是其他东西 ?
我已实现UserDetailsService,它返回一个实例MyUser(实现UserDetails)
public MyUser loadUserByUsername(String arg0)
Run Code Online (Sandbox Code Playgroud)
现在我想MyUser在我的JSP页面中访问我的自定义getter/fields ,到目前为止我得到了这个:
${pageContext.request.userPrincipal.name}
Run Code Online (Sandbox Code Playgroud)
但这只允许访问Principal对象.我怎样才能访问MyUser对象?
在这里得到答案后,我试图在我的网站上允许一个公共页面,但它似乎不起作用.当它重定向到登录页面.但是,如果我更改为filters = none它可以工作,并且页面是可见的,没有重定向.
我的appContext.xml看起来像这样(当它不起作用时),/MyPath相关部分:
<security:intercept-url pattern="/**" access="ROLE_USER" />
<security:intercept-url pattern="/Admin/**" access="ROLE_ADMIN" />
<security:intercept-url pattern="/MyPath/**" access="IS_AUTHENTICATED_ANONYMOUSLY, IS_AUTHENTICATED_FULLY, IS_AUTHENTICATED_REMEMBERED" />
Run Code Online (Sandbox Code Playgroud)
这有效,但我需要安全功能,所以不能使用它:
<security:intercept-url pattern="/**" access="ROLE_USER" />
<security:intercept-url pattern="/Admin/**" access="ROLE_ADMIN" />
<security:intercept-url pattern="/MyPath/**" filters="none" />
Run Code Online (Sandbox Code Playgroud) final Criteria crit = session.createCriteria(MyClass.class);
final List<MyClass> myClassList = crit.list();
Run Code Online (Sandbox Code Playgroud)
结果如下: 类型安全:类型List的表达式需要未经检查的转换以符合List
他们是一个删除警告的方法,因为我使用这个得到一个错误:
final List<MyClass> myClassList = Collections.checkedList(MyClass.class, crit.list());
Run Code Online (Sandbox Code Playgroud) 控制器签名(我也尝试过请求者):
@RequestMapping(value = "/Lame", method = RequestMethod.POST)
public
@ResponseBody
boolean getLame(@RequestParam String strToMatchA, @RequestParam String strToMatchB) {}
Run Code Online (Sandbox Code Playgroud)
这就是我的json:
{
"strToMatchA": "EN",
"strToMatchB": "lon"
}
Run Code Online (Sandbox Code Playgroud)
不工作,我收到错误:
org.springframework.web.bind.MissingServletRequestParameterException: Required String parameter 'strToMatchA' is not present
Run Code Online (Sandbox Code Playgroud)
从方法签名中删除第一个参数然后使其工作(方法被正确调用),我该怎么办?
当我更改要注释的方法参数时,@RequestBody我得到以下错误:
java.io.IOException: Stream closed
Run Code Online (Sandbox Code Playgroud) 我想访问当前登录的用户,我这样做(从静态方法)
public static User getCurrentUser() {
final Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
if (principal instanceof User) {
return (User) principal;
}
}
Run Code Online (Sandbox Code Playgroud)
或注射和铸造如下:
@RequestMapping(value = "/Foo/{id}", method = RequestMethod.GET)
public ModelAndView getFoo(@PathVariable Long id, Principal principal) {
User user = (User) ((Authentication) principal).getPrincipal();
..
Run Code Online (Sandbox Code Playgroud)
在用户实现用户细节的地方,两者看起来有点蹩脚在Spring 3.2中有更好的方法吗?
当我有一个像这样的价值
x = 0.5771622052130299
Run Code Online (Sandbox Code Playgroud)
我想使用spring 3.2 Resutlmatcher执行以下操作:
.andExpect(jsonPath("$.[1].myX").value(myPojo.getMyX()))
Run Code Online (Sandbox Code Playgroud)
其中myPojo.getMyX返回一个double,测试失败,因为json转换为BigDecimal,错误是messaeg
java.lang.AssertionError:
For JSON path $.[1].myX type of value expected:
<class java.lang.Double> but was:<class java.math.BigDecimal>
Run Code Online (Sandbox Code Playgroud)
我怎么能避免这个?
watch服务是否创建了原始函数的代理?
$scope.$watch('query', doSearch, true);
Run Code Online (Sandbox Code Playgroud)
其中:
doSearch = function(query) {
alert("breakpoint not working");
// stuff
}
Run Code Online (Sandbox Code Playgroud)
显示警报,但如果我使用chrome调试器向代码添加断点,它根本不会中断.而非观看的javascript函数中的其他断点正常工作.
更新: 当我不使用chrome dev工具的工作区功能时,断点工作正常.
java ×7
spring-mvc ×4
javascript ×3
spring ×3
hibernate ×2
json ×2
angularjs ×1
generics ×1
html ×1
jenkins ×1
jquery ×1
jsonpath ×1
mysql ×1
unit-testing ×1