我查看了文档,我能找到的唯一参考是针对不同的颜色系列.但是我只有一个数据系列,并希望该系列上的点/条不同颜色.
我可以使用多个系列并将点设置为零,这将产生相同的效果.
是否有支持的机制,使用flot在条形图中使用不同的颜色条?
我正在尝试使用Maven在我的春季网络应用程序上运行一些单元测试.该应用程序安装并运行正常,它生成一个可部署的war文件,一切正常(全部使用Maven).
我的测试类(位于src/test/java中):
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"file:C:/myProjects/myWebapp/src/main/webapp/WEB-INF/applicationContext-test.xml"})
@Transactional
public class MyTest {
...
Run Code Online (Sandbox Code Playgroud)
但是我收到了错误:
Configuration problem: spring-security-web classes are not available. You need these to use <filter-chain-map>
Offending resource: URL [file:C:/myProjects/myWebapp/src/main/webapp/WEB-INF/applicationContext-test.xml]
Run Code Online (Sandbox Code Playgroud)
跑步时 Maven > test
我的pom依赖被定义为
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
哪个默认为compile范围,哪个应该可以?当我将范围更改为test和时,它返回相同的错误provided.
我.classpath看起来像这样:
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
Run Code Online (Sandbox Code Playgroud)
如何正确设置我的应用程序上下文和测试?
<c:url var="myUrl" value="/MyPath/${MyID}"/>
Run Code Online (Sandbox Code Playgroud)
我稍后使用它(使用户能够复制链接):
<input size="35" disabled value="${myUrl}" />
Run Code Online (Sandbox Code Playgroud)
它显示
/my-app-name/MyPath/23
Run Code Online (Sandbox Code Playgroud)
但我希望它是
http://myHost/my-app-name/MyPath/23
Run Code Online (Sandbox Code Playgroud)
我可以肯定前置字符串,但想要一种主动获取正确主机名的方法......?
我想从sql server表中检索底部的10个结果.我希望它们是插入的最后10条记录,我该怎么做?
我想写select bottom 10 * from mytable但是这不存在(afaik).
我想插入最后10行.没有时间戳.
试图让Spring国际化运作起来.我使用了classpath:messages basename,为语言创建了.properties文件.它们被核心地复制到web-inf文件夹,代码存在于属性文件中......
这是显示一切的ide,请帮助我.我已经从我已经完成的另一个项目中复制了该设置.我已经尝试创建一堆不同的消息文件,但它没有提取任何东西...图片显示了web.xml,spring-servlet.xml和目录结构.

编辑 如果我将bean定义添加到applicationContext而不是spring-servlet它可以工作..?
我将 jenkins 的安装升级到了 2.249.1 版。
以前只有当指定的用户登录时才会显示批准促销按钮。升级后,批准促销一直显示,标题未满足资格 - 但仍然可以批准!
版本:
詹金斯 2.249.1
混帐 4.4.4
git 客户端 3.5.1
升级版 3.6
执行此查询的最佳方法是什么.我有下表
列表的mytable
x y
1 a
2 b
3 c
Run Code Online (Sandbox Code Playgroud)
我想(在伪sql中)
select x as x1 ,x as x2, x as x3 from mytable where ????
Run Code Online (Sandbox Code Playgroud)
什么时候
x1 is x where y=a
x2 is x where y=b
x3 is x where y=c
Run Code Online (Sandbox Code Playgroud)
所以我想结果
1, 2, 3
Run Code Online (Sandbox Code Playgroud)
我目前正在使用cte和一个非常大的数据集,我试图减少查询时间,是否总是需要进行3次表扫描?
我使用的是Spring,这里是一个控制器:
@Controller
public class PersonController {
@Resource(name="PersonService")
private PersonService personService;
@RequestMapping(value = "/Person", method = RequestMethod.GET)
public String getPersons(Model model) {
// Retrieve all persons by delegating the call to PersonService
List<Person> persons = personService.getAll();
// Attach persons to the Model
model.addAttribute("persons", persons);
//then return to view jsp
}
Run Code Online (Sandbox Code Playgroud)
这是一项服务:
@Service("personService")
@Transactional
public class PersonService {
public List<Person> getAll() {
//do whatever
}
}
Run Code Online (Sandbox Code Playgroud)
但是,要正确使用DI,我应该更改控制器以使用接口(?),如下所示:
@Controller
public class PersonController {
@Resource(name="personService")
private IPersonService personService; //Now an interface
}
Run Code Online (Sandbox Code Playgroud)
例如,这将允许我使用两个服务,一个测试,一个实时.我可以通过添加/删除服务上的注释来改变:
@Service("personService") …Run Code Online (Sandbox Code Playgroud) 有没有一个模式,或内置功能我缺少或我应该像这样循环
public List<MyObject> convert(List<String> myStrings){
List<MyObject> myObjects = new ArrayList<MyObject>(myStrings.size());
Integer i = 0;
for(String string : myStrings){
MyObject myObject = new myObject(i, string);
myObjects.add(object);
i++;
}
return myObjects;
}
Run Code Online (Sandbox Code Playgroud)
这是因为我需要将列表保存到数据库并保留排序.
我已设置spring security以正确拦截并使用自定义登录页面提示用户,然后正确进行身份验证并将用户详细信息添加到SecurityContextHolder.
补充一点,我现在想要在执行登录时添加我自己的自定义User对象添加到会话中; 所以代码看起来像这样:
public returnwhat? doMySupplementaryLogin() {
UserDetails principal = (UserDetails) SecurityContextHolder.getContext()
.getAuthentication().getPrincipal();
MyUser user = myUserService.getMyUser(principal.getUsername());
add user to what ?
}
Run Code Online (Sandbox Code Playgroud)
这段代码会在哪里?我希望执行nomral spring身份验证,然后上面的代码将MyUser对象放入会话,然后将用户发送到原始拦截的url/viewname.我有强烈的感觉,我使事情变得比他们需要的更复杂......
java ×5
spring ×4
spring-mvc ×2
sql ×2
flot ×1
graph ×1
javascript ×1
jenkins ×1
jsp ×1
jstl ×1
junit4 ×1
maven ×1
sql-server ×1
unit-testing ×1