JS 与 trick 代码的运用及解析全攻略
634
2022-10-29
解决在JBoss 下不能找到 Action 问题
import java-.MalformedURLException; import java-.URL; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.struts2.convention.PackageBasedActionConfigBuilder; import com.opensymphony.xwork2.ObjectFactory; import com.opensymphony.xwork2.config.Configuration; import com.opensymphony.xwork2.inject.Container; import com.opensymphony.xwork2.inject.Inject; import com.opensymphony.xwork2.util.finder.ClassFinder; import com.opensymphony.xwork2.util.finder.Test; /** * * 解决在JBoss 下不能找到 Action 问题 * */ public class MyActionConfigBuilder extends PackageBasedActionConfigBuilder { private static Log log = LogFactory.getLog(MyActionConfigBuilder.class); private static final String BASE_FILE = "applicationContext.xml"; private String[] actionPackages; private String[] packageLocators; public static String classPath=""; /** * * @param configuration * @param container * @param objectFactory * @param redirectToSlash * @param defaultParentPackage */ @Inject public MyActionConfigBuilder( Configuration configuration, Container container, ObjectFactory objectFactory, @Inject("struts.convention.redirect.to.slash") String redirectToSlash, @Inject("struts.convention.default.parent.package") String defaultParentPackage) { super( configuration, container, objectFactory, redirectToSlash, defaultParentPackage ); } /** * * @param actionPackages * (Optional) An optional list of action packages that this * should create * * configuration for. * */ @Inject(value = "struts.convention.action.packages", required = false) public void setActionPackages(String actionPackages) { super.setActionPackages(actionPackages); if ( !"".equals( actionPackages.trim() ) ) { this.actionPackages = actionPackages.split( "\s*[,]\s*" ); } } /** * * @param packageLocators * (Optional) A list of names used to find action packages. * */ @Inject(value = "struts.convention.package.locators", required = false) public void setPackageLocators(String packageLocators) { super.setPackageLocators(packageLocators); this.packageLocators = packageLocators.split("\s*[,]\s*"); } @Override @SuppressWarnings("unchecked") protected Set
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~