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

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

ajax訪問(wèn)servlet沒(méi)反應(yīng)

ajax訪問(wèn)servlet沒(méi)反應(yīng)

我愛(ài)靜靜0 2016-07-09 19:16:30
?<script type="text/javascript" src="WEB-INF/lib/jquery-1.8.3.js"></script>? <script type="text/javascript">? function bb(){????? $.get("aja");???????????????? ????? ?? }? </script>? </head>? <a href="javascript:bb()">aa</a>? <a href="aj">bb</a>? <body>?? ?? </body>servlet中:package servlet;import java.io.IOException;import java.io.PrintWriter;import javax.servlet.ServletException;import javax.servlet.annotation.WebServlet;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;@WebServlet (urlPatterns={"/aja"})public class aj extends HttpServlet {?? ?/**?? ? * The doGet method of the servlet. <br>?? ? *?? ? * This method is called when a form has its tag value method equals to get.?? ? * ?? ? * @param request the request send by the client to the server?? ? * @param response the response send by the server to the client?? ? * @throws ServletException if an error occurred?? ? * @throws IOException if an error occurred?? ? */?? ?public void doGet(HttpServletRequest request, HttpServletResponse response)?? ??? ??? ?throws ServletException, IOException {?? ??? ?response.setContentType("text/html");?? ??? ?PrintWriter out = response.getWriter();?? ??? ?out.print("false");?? ??? ?out.flush();?? ??? ?out.close();?? ?}?? ?/**?? ? * The doPost method of the servlet. <br>?? ? *?? ? * This method is called when a form has its tag value method equals to post.?? ? * ?? ? * @param request the request send by the client to the server?? ? * @param response the response send by the server to the client?? ? * @throws ServletException if an error occurred?? ? * @throws IOException if an error occurred?? ? */?? ?public void doPost(HttpServletRequest request, HttpServletResponse response)?? ??? ??? ?throws ServletException, IOException {?? ??? ?doGet(request, response);?? ?}}
查看完整描述

2 回答

已采納
?
HansonQ

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

a標(biāo)簽 寫(xiě)到body 標(biāo)簽里面

查看完整回答
1 反對(duì) 回復(fù) 2016-07-09
?
我愛(ài)靜靜0

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

放在里面了還是不行啊

查看完整回答
反對(duì) 回復(fù) 2016-07-10
  • HansonQ
    HansonQ
    $.get("aja");這個(gè)地方有問(wèn)題 . 在js里面 先 var basePath = <%=request.getContextPath()%> ; 然后var rquestPath=basePath+"/"+"aja" 然后換成:$.get(rquestPath);
  • HansonQ
    HansonQ
    $.ajax({ type: "GET", url: "test.js", dataType: "script" }); 在看看是不是你的ajax 寫(xiě)的有問(wèn)題
  • 2 回答
  • 0 關(guān)注
  • 2823 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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