2 qq 40094582 qq_40094582 于 2017.09.04 12:53 提问

求解决在jsp中用struct进行跳转时出现HTTP Status 404

struts-config.xml文件中


调用页面


MemberDao.jsp中
package com.xg.dao;

import com.xg.tool.JDBConnection;
import java.sql.*;
import java.util.*;
import com.xg.domain.MemberForm;

public class MemberDao {
private Connection connection = null;
private PreparedStatement ps = null;
private JDBConnection jdbc = null;
public MemberDao() {
jdbc = new JDBConnection();
connection = jdbc.connection;
}

public MemberForm selectMemberForm(String name) {
MemberForm member = null;
try {
ps = connection.prepareStatement("select * from userinfo where user_name=?");
ps.setString(1, name);
ResultSet rs = ps.executeQuery();
while (rs.next()) {
member = new MemberForm();
member.setUser_id(Integer.valueOf(rs.getString(1)));
member.setUser_name(rs.getString(2));
member.setUser_password(rs.getString(3));
}
}
catch (SQLException ex) {
ex.printStackTrace();
}
return member;
}

}

4个回答

qq_28215471
qq_28215471   2017.09.04 13:47

配置文件贴出来看一下。。

qq_40094582
qq_40094582 <form-bean name="memberForm" type="com.xg.domain.MemberForm" /> <action name="memberForm" path="/memberAction" scope="request" type="com.xg.webtier.MemberAction" validate="true"> <forward name="checkMember" path="/fg-checkMemberResult.jsp" /> 还有一个MemberFormAction和MemberForm文件
3 个月之前 回复
qq_40094582
qq_40094582   2017.09.04 13:54
<form-bean name="memberForm" type="com.xg.domain.MemberForm" />
     <action name="memberForm" path="/memberAction" scope="request" type="com.xg.webtier.MemberAction" validate="true">
  <forward name="checkMember" path="/fg-checkMemberResult.jsp" />

        还有一个MemberFormAction和MemberForm文件
hhhCSDNbk
hhhCSDNbk   2017.09.04 15:15

这个action和后台方法匹配上了吗

qq_40094582
qq_40094582 我看着所有的路径都是对的呀
3 个月之前 回复
IsStyleBoy
IsStyleBoy   2017.09.04 15:50

action的xml是不是少了 method



/advice/list.jsp


qq_40094582
qq_40094582 method属性不是必须的吧
3 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片