action从actionForm中取,actionForm从表单中取
解决方案 »
- 请教:什么情况下会使用spring的PagedListHolder来分页?
- 高分求ehcache在spring的配置过程
- 急救ow2-jotm-dist-2.1.4+tomcat6.0+jdk6.0
- 绑定域名后 session丢失
- 安装Spring IDE问题
- !!!!!!!!!!!!!!!!!!!!我最恨铁道部门了?????
- 关于spring的事务问题
- 谁在weblogic9.0上成功的配置JMS 在线等
- BIRT 在谷歌浏览器报错
- struts+mysql 乱码问题(急)
- 在做《精通EJB2》最後一個例子時,那個批處理文件中有幾個命令不明白????
- 有没有人安装过petstore?指导我一下,我安装不起。
</form>
我是问struts怎么取到form标签的中action属性中那个xxAction.do这个字符串的。
(HttpServletRequest) pageContext.getRequest();
StringBuffer value = new StringBuffer(request.getContextPath());
ApplicationConfig config = (ApplicationConfig)
pageContext.getRequest().getAttribute(Action.APPLICATION_KEY);
if (config != null) {
value.append(config.getPrefix());
}
// Use our servlet mapping, if one is specified
String servletMapping = (String)
pageContext.getAttribute(Action.SERVLET_KEY,
PageContext.APPLICATION_SCOPE);
if (servletMapping != null) {
String queryString = null;
int question = action.indexOf("?");
if (question >= 0) {
queryString = action.substring(question);
}
String actionMapping = getActionMappingName();
if (servletMapping.startsWith("*.")) {
value.append(actionMapping);
value.append(servletMapping.substring(1));
} else if (servletMapping.endsWith("/*")) {
value.append(servletMapping.substring
(0, servletMapping.length() - 2));
value.append(actionMapping);
}
if (queryString != null) {
value.append(queryString);
}
} // Otherwise, assume extension mapping is in use and extension is
// already included in the action property
else {
if (!action.startsWith("/")) {
value.append("/");
}
value.append(action);
} // Return the completed value
return (value.toString()); }