[color=blue]1: 在jsp 页面读取 web-INF 下面东西:
<%=request.getSession().getServletContext().getRealPath("/")%> WEB-INF/lib/cofigs/application.xml
2: 在main里写测试类。调用 application.xml (其他的也类似,比如 user.xml
)
ApplicationContext ctx = new FileSystemXmlApplicationContext("D:/workspace/Test/WEB-INF/applicationContext.xml");
3: 在页面放入图片等路径问题: 首先要取得Context 路径
<img src="<%=request.getContextPath()%>/images/aa.jsp"></td>[/color]
<%=request.getSession().getServletContext().getRealPath("/")%> WEB-INF/lib/cofigs/application.xml
2: 在main里写测试类。调用 application.xml (其他的也类似,比如 user.xml
)
ApplicationContext ctx = new FileSystemXmlApplicationContext("D:/workspace/Test/WEB-INF/applicationContext.xml");
3: 在页面放入图片等路径问题: 首先要取得Context 路径
<img src="<%=request.getContextPath()%>/images/aa.jsp"></td>[/color]