村西头最帅的仔 2015-11-26 02:06 采纳率: 25%
浏览 1791
已采纳

strtus2 注解action 访问URL 配置

问题:
用strtus注解的形式生成一个action

@ParentPackage("struts-default")
@Namespace("/welcome")
@Results(value={
@Result(name="success",location="/pub/index.html"),
@Result(name="fail",location="/pub/index1.html")
})
public class IndexAction extends ActionSupport{
@Action(value="/index")
public String index(){
System.out.println("ceshi1");
return "success";
}
}
访问URL:http://localhost:8080/项目/welcome/index.do 可以正常访问
但是为什么 我访问URL改为:
http://localhost:8080/项目/test/index.do

http://localhost:8080/项目/welcome/index11.do
也都可以访问,这是问什么啊?求大神指教

  • 写回答

2条回答 默认 最新

  • 紫气天堂 2015-11-26 03:05
    关注

    这应该是在配置文件中配置出来的效果

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?