struts2配置问题

来源:百度知道 编辑:UC知道 时间:2024/05/28 09:51:37
按照书上的方法实现零配置,但action中提示出错。我用的myeclipse。
错误在 @}) 这一行。
错误提示:
Syntax error on token "@", delete this token

package root;

import com.opensymphony.xwork2.ActionSupport;

@Results( { @Result(name = "success", type = NullResult.class, value = "/worldmap_index.jsp", param = {})
@})
public class i18nAction extends ActionSupport {
public String execute() throws Exception {
return SUCCESS;
}

}

使用@方法本质上是使用AspectJ的工作方式+反射的原理.
也就是说要把AscpectJ的jar包导入.
另外,请把异常也帖出来,方便分析.

1、导struts2.0的jar包
2、web-inf-》web.xml加
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

…………