📄 citydispaction.java
字号:
package xian.bin.city;import org.apache.struts.action.*;import javax.servlet.http.*;import xian.bin.serivce.*;public class CityDispAction extends BaseCityDispAction { //添加市 public ActionForward addCity(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { CityForm cityForm = (CityForm) actionForm; Object[] obj=null; ServiceCity service=null; try{ service=this.getServiceCity(); obj[0]=new Integer(cityForm.getSheng()); obj[1]=new Integer(cityForm.getCno()); obj[2]=new Integer(cityForm.getCorder()); service.addCity(obj); System.out.println("添加市"); } catch(Exception e){ e.printStackTrace(); } throw new java.lang.UnsupportedOperationException("Method perform() not yet implemented."); } //删除一个市信息 public ActionForward delCity(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { CityForm cityForm = (CityForm) actionForm; ServiceCity service=null; try{ service=this.getServiceCity(); service.delCity(cityForm.getCid()); System.out.println("删除一个市信息"); } catch(Exception e){ e.printStackTrace(); } throw new java.lang.UnsupportedOperationException("Method perform() not yet implemented."); } //获得所有市信息 public ActionForward getAllCity(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { CityForm cityForm = (CityForm) actionForm; ServiceCity service=null; try{ service=this.getServiceCity(); cityForm.setCitys(service.getAllCity()); System.out.println("获得所有市信息"); } catch(Exception e){ e.printStackTrace(); } throw new java.lang.UnsupportedOperationException("Method perform() not yet implemented."); } //修改一个市信息 public ActionForward updataCity(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { CityForm cityForm = (CityForm) actionForm; Object[] obj=null; ServiceCity service=null; try{ service=this.getServiceCity(); obj[0]=new Integer(cityForm.getSheng()); obj[1]=new Integer(cityForm.getCno()); obj[2]=new Integer(cityForm.getCorder()); service.updataCity(obj); System.out.println("添加市"); } catch(Exception e){ e.printStackTrace(); } throw new java.lang.UnsupportedOperationException("Method perform() not yet implemented."); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -