第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

異常問題 謝謝!!

異常問題 謝謝!!

慕姐8946757 2017-09-16 07:44:01
package com.itheima.b_login;import java.io.IOException;import javax.servlet.ServletException;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import sun.security.util.Password;/**?* Servlet implementation class UserServlet?*/public class UserServlet extends HttpServlet {?? ?private static final long serialVersionUID = 1L;?? ?protected void doGet(HttpServletRequest request, HttpServletResponse response)?? ??? ??? ?throws ServletException, IOException {?? ??? ?try {?? ??? ??? ?String username = request.getParameter("username");?? ??? ??? ?String password = request.getParameter("password");?? ??? ??? ?User user = new User();?? ??? ??? ?user.setUsername(username);?? ??? ??? ?user.setUsername(password);?? ??? ??? ?UserService userService = new UserService();?? ??? ??? ?User existUser = userService.login(user);?? ??? ?} catch (Exception e) {?? ??? ??? ?e.printStackTrace();?? ??? ?}?? ?}?? ?protected void doPost(HttpServletRequest request, HttpServletResponse response)?? ??? ??? ?throws ServletException, IOException {?? ??? ?doGet(request, response);?? ?}}請(qǐng)問代碼中的異常已經(jīng)拋出了 為神惡魔還要try catch;它倆有什么不同,以及什么時(shí)候用, 什么時(shí)候一起用?
查看完整描述

1 回答

?
精慕門9254224

TA貢獻(xiàn)167條經(jīng)驗(yàn) 獲得超46個(gè)贊

他聲明的異常只是servlet 和io 異常,但你看他通過try catch 捕捉的是所有異常!

查看完整回答
反對(duì) 回復(fù) 2017-09-16
  • 1 回答
  • 0 關(guān)注
  • 918 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)