只显示主题贴

有个问题请教一下各位大侠: 类A是ServletContextListener的实现类,在web.xml加入了listener。问题就来了,在A中无法访问 已经注入到spring中的bean B,只能用B b = new B()来访问。 我想原因是:A没有注入spring,所以访问不了spring中的bean。 问:怎么把A注入spring中呢? 谢谢了。 有空的话帮帮忙,这个问题已经困惑我很久了。我的邮箱(MSN): chenrongsen@hotmail.com
  • 进入论坛 Java
学习中,等整理出一些东西,也会拿来共享的
  • 进入论坛 Java
ServletActionContext.getRequest().getLocalAddr(); ServletActionContext.getRequest().getLocalName(); ServletActionContext.getRequest().getLocalPort(); 或者 String serverIP = ServletActionContext.getRequest().getServerName(); int serverPort = ServletActionContext.getRequest().getServerPort();
  • 进入论坛 Java
WebWork提供的使用Ajax的配置及使用太麻烦了,又难以理解。所以本人自己写了一套很简单方法来访问: 1.Action代码: public String forwordLog(){ log.info("forword to log tab...."); return "forwordLog"; } public String getLog(){ log.info("forword to getLog...."); String retDoc = ""; try{ if(fileName != null) retDoc = FileUti ...
  • 进入论坛 Java
hi,有个问题请教一下各位大侠: 类A是ServletContextListener的实现类,在web.xml加入了listener。问题就来了,在A中无法访问 已经注入到spring中的bean B,只能用B b = new B()来访问。 我想原因是:A没有注入spring,所以访问不了spring中的bean。 问:怎么把A注入spring中呢? 谢谢了。 有空的话帮帮忙,这个问题已经困惑我很久了。我的邮箱(MSN): chenrongsen@hotmail.com
  • 进入论坛 Java
<?xml version="1.0" encoding="UTF-8"?> <mosaic_info count="0" version="20071217"> <stream address="192.168.21.1" mosaicid="1"> <Id>aaaaa</Id> <name/> <desc/> </stream> </mosaic_info> 如上:name和desc节点是空,生成的时候希望得到的是<name></name>。如何生成? 当然了, ...
  • 进入论坛 Java