报404错误并且控制台毫无信息怎么办?
我按照视频中的在index.jsp中写了一个超链接,href="timer",然后写了TimerAction,重写了execute方法,最后在struts.xml中配置了,但是跳转到success.jsp页面的时候报了404错误并且控制台没有报错信息,我该怎么追踪呢?
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> </head> <body> index,<a href="timer">执行action并计算执行时间</a> </body> </html>
package com.v3.action; import com.opensymphony.xwork2.ActionSupport; public class TimerAction extends ActionSupport { @Override public String execute() throws Exception { for(int i=0; i < 10000; i++){ System.out.println("I LOVE V3"); } return SUCCESS; } }
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.5//EN" "http://struts.apache.org/dtds/struts-2.5.dtd"> <struts> <package name="default" namespace="/" extends="struts-default"> <action name="timer" class="com.v3.action.TimerAction"> <result>/success.jsp</result> </action> </package> </struts>