首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

struts2默许action

2012-08-29 
struts2默认actionjava-web交流群:132607763struts2的默认action,当其它action都不能匹配时,将用默认的act

struts2默认action
java-web交流群:132607763

struts2的默认action,当其它action都不能匹配时,将用默认的action进行处理。
默认action配置在默认命名空间里。
下面是struts.xml中的配置:

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts><constant name="struts.custom.i18n.resources" value="mess"></constant><constant name="struts.i18n.encoding" value="UTF-8"></constant><package name="struts2" extends="struts-default"><default-action-ref name="mo"></default-action-ref><global-results><result name="login">/login.jsp</result><result name="error">/error.jsp</result></global-results><action name="mo" name="code">package com.randy.com;import com.opensymphony.xwork2.ActionSupport;public class DefaultAction extends ActionSupport {private static final long serialVersionUID = 2377192390092411385L;public String execute() {return ERROR;}}

热点排行