我的ASP.NET MVC 3项目中有以下模型:
public class Task
{
public int Id { get; set; }
public DateTime CreatedOn { get; set; }
public TaskStatus Status { get; set; }
}
public class TaskStatus
{
public int Id { get; set; }
public string Description { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
作为参考,这是我的DbContext类:
public class TaskManagerSets : DbContext
{
public DbSet<Task> TaskSet { get; set; }
public DbSet<TaskStatus> TaskStatusSet { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
然后我在TaskController中有一个List Action :
TaskManagerSets dbcontext …Run Code Online (Sandbox Code Playgroud) 我正在关注Spring 2.5教程并尝试将代码/设置更新到Spring 3.0.
在Spring 2.5中我有HelloController(供参考):
public class HelloController implements Controller {
protected final Log logger = LogFactory.getLog(getClass());
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
logger.info("Returning hello view");
return new ModelAndView("hello.jsp");
}
}
Run Code Online (Sandbox Code Playgroud)
以及HelloController的JUnit测试(供参考):
public class HelloControllerTests extends TestCase {
public void testHandleRequestView() throws Exception{
HelloController controller = new HelloController();
ModelAndView modelAndView = controller.handleRequest(null, null);
assertEquals("hello", modelAndView.getViewName());
}
}
Run Code Online (Sandbox Code Playgroud)
但现在我将控制器更新到Spring 3.0,它现在使用注释(我还添加了一条消息):
@Controller
public class HelloController {
protected final …Run Code Online (Sandbox Code Playgroud) 我需要杀死一个远程KDB +会话。这可以通过几种方式完成,但我更喜欢使用IPC处理程序。
我开始一个KDB +会话:
$ q -p 5000
KDB+ 3.0 2012.11.13 Copyright (C) 1993-2012 Kx Systems
Run Code Online (Sandbox Code Playgroud)
然后,我开始另一个KDB会话,并成功杀死了服务器:
$ q
KDB+ 3.0 2012.11.13 Copyright (C) 1993-2012 Kx Systems
q)h: hopen `::5000
q)h(exit;0)
'close
q)\\
Run Code Online (Sandbox Code Playgroud)
但是,如果我按照上述说明创建脚本(test.q),它将失败:
$ cat test.q
h: hopen `::5000
h(exit;0)
\\
$ q test.q
KDB+ 3.0 2012.11.13 Copyright (C) 1993-2012 Kx Systems
k){0N!x y}
'close
@
"q"
"h(exit;0)"
q))
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?我真的很感激。
我是一个核心Java开发人员(J2SE),被分配给一个单人项目,一个小型内联网网站.
当我的主管需要Microsoft技术时,我打算学习Hibernate和Spring.我决定使用ASP.Net MVC,但我觉得我错过了学习我想要的东西的机会.
如果我放弃ASP.Net MVC并开始学习NHibernate和Spring.Net,我能否将这些知识无缝转移到Java环境中?
注意:我曾经使用iTextSharp,一个来自流行的Java iText(PDF库)的.Net端口.两种环境的使用率均为95%.Spring和Hibernate会发生这种情况吗?
spring ×2
.net ×1
annotations ×1
c# ×1
hibernate ×1
java ×1
junit ×1
kdb ×1
nhibernate ×1
spring.net ×1