Action中不执行execute,怎么办!!跪求答案!!!

kzj112w kzj112w 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我的Action头执行得了System.out.println("\nscrip***************11******action=");也能打印,但是到了execute中的System.out.println("\nscrip*********************action=");执行不了,是什么原因?源码如下:
java.action
public class SongAction extends Action {
private SongDAO songDAO = null;
MyPagination pagination = null;
StringUtils su=new StringUtils();
public SongAction() {
this.songDAO = new SongDAO();
System.out.println("\nscrip***************11******action=");
}
public ActionForward execute(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response)throws IOException,ServletException
{
System.out.println("\nscrip*********************action=");

System.out.println("\nscrip*********************action=");
String action = request.getParameter("action");
System.out.println("\nscrip*********************action="+action);
if ("main".equals(action)) {
return main(mapping, form, request, response); // 前台首页
} else if ("songQuery".equals(action)) {
return songQuery(mapping, form, request, response); // 查询歌曲信息
} else if ("tryListen".equals(action)) {
return tryListen(mapping, form, request, response); // 查询试听歌曲信息
} else if ("continuePlay".equals(action)) {
return continuePlay(mapping, form, request, response); // 进行歌曲连播
} else if ("songSort".equals(action)) {
return songSort(mapping, form, request, response); // 歌曲排行(试听和下载)
} else if ("navigation".equals(action)) {
return navigation(mapping, form, request, response); // 查询导航栏信息
} else if ("search".equals(action)) {
return search(mapping, form, request, response); // 按条件查询歌曲
} else if ("download".equals(action)) {
return download(mapping, form, request, response); // 文件下载
} else if ("songType".equals(action)) {
return songType(mapping, form, request, response); // 查询歌曲类别
} else if ("adm_search".equals(action)) {
return adm_search(mapping, form, request, response); // 后台查询歌曲信息
} else if ("add".equals(action)){
return adm_add(mapping,form,request,response); //添加歌曲信息
} else if ("checkMusic".equals(action)){
return checkMusic(mapping,form,request,response); //检测歌曲是否已经添加
} else if ("del".equals(action)) {
return del(mapping, form, request, response); // 删除歌曲信息
} else {
request.setAttribute("error", "操作失败!");
return mapping.findForward("error");
}
}
Confing.xml:

<struts-config>
<data-sources />
<form-beans>
<form-bean name="songForm" type="com.model.SongForm"/>
<form-bean name="managerForm" type="com.model.ManagerForm"/>
</form-beans>
<global-exceptions />
<global-forwards />

<action-mappings>
<action name="songForm" path="/song" scope="request" input="/index.jsp" type="com.action.SongAction" validate="true">
<forward name="main" path="/main.jsp"/>
<forward name="songQuery" path="/songList.jsp"/>
<forward name="search" path="/searchResult.jsp"/>
<forward name="download" path="/download.jsp"/>
<forward name="tryListen" path="/tryListen.jsp"/>
<forward name="continuePlay" path="/continuePlay.jsp"/>
<forward name="adm_search" path="/adm_main.jsp"/>
<forward name="addok" path="/addok.jsp"/>
<forward name="checkMusic" path="/checkMusic.jsp"></forward>
<forward name="delok" path="/delok.jsp"/>
<forward name="error" path="/error.jsp"/>
</action>
<action name="managerForm" path="/manager" scope="request" type="com.action.ManagerAction" validate="true">
<forward name="managerLoginok" path="/login_ok.jsp"/>
<forward name="error" path="/error.jsp"/>
</action>
</action-mappings>
<controller processorClass="com.action.SelfRequestProcessor" />
<message-resources parameter="com.yourcompany.struts.ApplicationResources" />
</struts-config>
...全文

相关推荐

评论 11
收藏 已收藏
分享
返回顶部
kzj112w
Web 开发 81,108 成员 341,721 内容