获取项目路径
摘要:引自:http://guozheng.iteye.com/blog/607012从Request对象中可以获取各种路径信息,以下例子: 假设请求的页面是index.jsp,项目是WebDemo,则在index.jsp中获取有关request对象的各种路径信息如下String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/&q
阅读全文
posted @
2013-06-06 11:05
NeverGiveUp_ZONE
阅读(216)
推荐(0)
Struts2 系列问题一
摘要:最近 项目中使用Struts2发现如下问题1.页面跳转在struts配置文件采用如下配置 <action name="toXXX" class="com.UserAction"> <result >/XXX.jsp</result> </action>此配置简单做一下页面跳转其中UserAction继承ActionSuport但未重写execute方法,于是出现如下问题在windows上可以正确跳转,但在Linux上却重定向到失败页面2.Struts2 装饰器问题 decorators.xml配置如出现冲突
阅读全文
posted @
2012-12-18 11:35
NeverGiveUp_ZONE
阅读(128)
推荐(0)
Struts 2 自定义标签开发
摘要:开发Struts 2 自定义标签三步曲: 1.定义标签 public class AddressTag extends ComponentTagSupport { //定义你JSP页面传来的标签设置的属性 private String id; //此方法就是获得一个基本类的Component对象(需自定义生成) @Override public Component getBean(ValueStack valueStack, HttpServletRequest request, HttpServletResponse response) { A...
阅读全文
posted @
2012-12-06 19:05
NeverGiveUp_ZONE
阅读(263)
推荐(0)