接上:
struts-config.xml
--------------------------
....
<action path="/SelectAll"
        type="com.hdtq.main.SelectAction"
        scope="request">
<forward name="success" path="/MyLogin.jsp"/>
....
---------------------------
SelectAction.java
---------------------------
public class SelectAction {
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest req,
HttpServletResponse res
){
//SelectForm rf=(SelectForm)form;
String method=req.getParameter("method");
//String id=rf.getId();
String id=req.getParameter("id");

String strSQL="";
        String xml_start="<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
        xml_start+="<selects>";
        String xml_end="</selects>";
        String xml="<select><value>0</value><text>--</text></select>";
DBCPool dbc= new DBCPool();
Connection conn=dbc.getConnection("wy_manager");
Statement stmt=null;
if(conn!=null){
try{
stmt=conn.createStatement();
}catch(SQLException err){
System.out.println(err.getMessage());

}
}
if(method.equals("g1")){
strSQL="select cityID id,city name from city where father="+id;
}else if(method.equals("g1")){
strSQL="select areaID id,area name from area where father="+id;
}
ResultSet rs=null;

try{
rs=stmt.executeQuery(strSQL);
while(rs.next()){
xml +="<select><value>"+rs.getString("id")+"</value><text>"+rs.getString("name")+"</text></select>";
}
}catch(Exception e){
e.printStackTrace();
}
String last_xml=xml_start+xml+xml_end;
        try {
            res.getWriter().write(last_xml);
            
        } catch (Exception e) {
            e.printStackTrace();
        }

ActionForward forward= new ActionForward();
forward=mapping.findForward("success");
return forward;
}
}
-----------------------------------------------------------
各位大侠 帮忙看看啊~!!!