我是Intellij 14.0的新手.我当时正在使用Netbeans,但我的同事告诉我转移到intellij,所以我做了.
我需要运行我在Intellij上运行netbeans的同一个项目.我正在研究的项目是用grails和spring制作的.当我尝试使用Intellij运行项目时,这就是我得到的.
Spring配置检查找到未映射的Spring配置文件.请为模块配置/设置Spring facet:.........(1个文件)
这是文件.
applicationContext.xml中
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="grailsApplication" class="org.codehaus.groovy.grails.commons.GrailsApplicationFactoryBean">
<description>Grails application factory bean</description>
<property name="grailsDescriptor" value="/WEB-INF/grails.xml" />
<property name="grailsResourceLoader" ref="grailsResourceLoader" />
</bean>
<bean id="pluginManager" class="org.codehaus.groovy.grails.plugins.GrailsPluginManagerFactoryBean">
<description>A bean that manages Grails plugins</description>
<property name="grailsDescriptor" value="/WEB-INF/grails.xml" />
<property name="application" ref="grailsApplication" />
</bean>
<bean id="grailsConfigurator" class="org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator">
<constructor-arg>
<ref bean="grailsApplication" />
</constructor-arg>
<property name="pluginManager" ref="pluginManager" />
</bean>
<bean id="grailsResourceLoader" class="org.codehaus.groovy.grails.commons.GrailsResourceLoaderFactoryBean" />
<bean id="characterEncodingFilter" class="org.springframework.web.filter.CharacterEncodingFilter">
<property name="encoding">
<value>utf-8</value>
</property>
</bean>
<bean id="conversionService" class="org.springframework.context.support.ConversionServiceFactoryBean" />
</beans>
Run Code Online (Sandbox Code Playgroud)
老实说,我不知道如何解决它.根据我的理解,它正在寻找一些模块,但我无法解决它.我甚至试过这个"添加框架支持".但我在名单中找不到弹簧. …
我很长一段时间都在寻找答案,却找不到任何有用的东西
在我的休息服务中,我保留了一些功能:/ account/{id}/download我想在SecurityConfig java文件中设置access ROLE,只有ROLE_TOKENSAVED用户可以访问这个url
当{id}可更改时,模式应该如何?
我尝试了一些正则表达式模式,但没有任何工作,我想要的,这是我的一些尝试:
1. antMatchers("account/**/download").access(somerolehere)
2. antMatchers("account/\\d/download").access(somerolehere)
3. antMatchers("account/[\\d]/download").access(somerolehere)
Run Code Online (Sandbox Code Playgroud)
在此先感谢您的服务:)
编辑:
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.antMatchers("/admin**").access("hasRole('ROLE_ADMIN')")
.antMatchers("/account*//**").access("hasRole('ROLE_USER') or hasRole('ROLE_ADMIN')")
.antMatchers("/account/\\d+/download").access("hasRole('ROLE_TOKENSAVED')")
.antMatchers("/user**").permitAll()
//othercode...
}
Run Code Online (Sandbox Code Playgroud) 我在Controller中有一个简单的方法
@RequestMapping("admin")
public @ResponseBody
Boolean admin() {
Boolean success = true;
return success;
}
Run Code Online (Sandbox Code Playgroud)
并在回应我想要回报 { "success": true }
Annontation @ResponseBody说响应将是JSON.但现在在回复中,我接受了真实.
有没有其他方法可以解决它?
或者我应该做点什么
@RequestMapping("admin")
public @ResponseBody
Map<String, Boolean> admin() {
Map<String, Boolean> success = new TreeMap<String, Boolean>();
success.put("success", true);
return success;
}
Run Code Online (Sandbox Code Playgroud)
我想知道最佳实践.
我最近转向Sublime Text 3进行开发,并尝试找出一种方法,通过在编辑器中查看文件,我可以知道文件是否已保存.例如
在Sublime Text 3中是否有任何这样容易看到的视觉提示来知道文件是否有未保存的更改?
如何为Java调整InlliJ IDEA 14代码样式,使其在打开后立即关闭空构造函数/方法的大括号.
E. g.:
class A {
private A() {}
public void b() {}
}
Run Code Online (Sandbox Code Playgroud) 由于@RestController是组成@Controller和@ResponseBody,我相信如果我想我的控制器既MVC劳逸结合控制器只是标注@RestController应该罚款.那是对的吗?
由于@RestController是组成@Controller和@ResponseBody,我认为它在内部表示,这是很好的
@Controller)@ResponseBody)虽然可以根据需要进行更改我喜欢崇高的文字.我知道我可以在设置中完全禁用自动完成功能,但我只想禁用其中一个自动完成选项.
当您在python中键入@property装饰器时,您将获得一个名为New Property的自动完成选项,如果选择该选项,则会为您生成一个getter和setter.这最终会给我带来痛苦而不是好处.有关如何删除该自动完成选项的任何想法?
也许我错过了一些东西并且在同一时间谷歌都失败了但是我怎么说类似于:
...
if ($(this:enabled)){
//some code
}
...
Run Code Online (Sandbox Code Playgroud)
我通常知道你会说些什么,$("#someID:enabled")但如何使用$(this)?
Service1注入Repository1. Service2注入Repository2.
假设两种不同的场景:
1)Service2需要从Repository1. 应该Service2注入Service1还是Repository1当它们都提供各自的get()方法时?
2) 最后的某些方法Service1应该从Service2. 它是一个不好的做法,注入Service2到Service1这样的需求呢?使用 AOP 等事件侦听技术来满足此类需求是否是一个好习惯?
spring ×4
java ×3
spring-mvc ×3
sublimetext ×2
intellij-14 ×1
isenabled ×1
jackson ×1
jquery ×1
json ×1
python ×1
regex ×1
security ×1
service ×1
sublimetext2 ×1
sublimetext3 ×1
this ×1