導航:首頁 > 編程語言 > jsp新開一個窗口

jsp新開一個窗口

發布時間:2023-03-25 04:07:47

jsp在新窗口打開

直接對你的按鈕做個鏈接就OK了嘛~
<a href="./help/<%=request.getAttribute("mod_url")%>.html" target="_blank">幫助</a>
其中的屬性target="_blank"就表示打開一個新的頁面
補充:在JSP頁面先調用你action裡面的那個方法獲得你返回的URL給字元串s,然後將上面的語句中的「=request.getAttribute("mod_url")」改為「=s」就OK了……

㈡ jsp裡面彈出一個新的窗口怎麼做

1、你可以用一個來div作為彈出窗口;源

2、將你的這個div裝飾成一個窗口,很簡單;

3、在這個div中,你可以寫一些文本輸入框,form表單或者其他標簽都可以;

4、你在用絕對定位將這個div移到你要的未知。

㈢ JSP打開新窗口問題

如果單純在jsp頁面進行跳轉可以直接用

<ahref="./b.jsp">

servlet中跳轉可以

java">response.sendRedirect("./b.jsp");

不知道你是不是這個意思?

㈣ 如何在jsp頁面上實現點擊注冊按鈕,彈出一個窗體來注冊(類似於百度貼吧的登錄和注冊),求詳細代碼和注釋

jsp中的注冊彈出新窗口是通過window.open一個新頁面來實現的。
頁面register.jsp代碼如下:
<%@ page contentType="text/html; charset=gb2312" language="java" import="cn.wy.Pet.User" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>會員注冊例子講解</title>
<style type="text/css">
<!--
.STYLE1 {
color: #FF0000;
font-weight: bold;
}
.STYLE2 {color: #FF0000}
.STYLE3 {
font-size: 18px;
font-weight: bold;
}
-->
</style>
</head>

<body style="font-size:12px">
<form id="form1" name="form1" method="post" action="<%=actionStr%>reg">
<p align="center"><br />
<span class="STYLE3">用戶注冊</span></p>
<table width="582" height="302" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#BCACD2">
<tr>
<td width="80" align="right">用戶名:</td>
<td width="496" align="left"><input name="userName" type="text" id="userName" size="16" maxlength="16" />
<span class="STYLE1">*</span> 3~16位字母或者數字(如:8hack)</td>
</tr>
<tr>
<td align="right">密碼:</td>
<td align="left"><input name="password1" type="text" id="password1" size="16" maxlength="16" />
<span class="STYLE1">* </span> 3~16位字母或者數字(如:abc123)</td>
</tr>
<tr>
<td align="right">確認密碼:</td>
<td align="left"><input name="password2" type="text" id="password2" size="16" maxlength="16" />
<span class="STYLE1">*</span> 必須和上面輸入的密碼相同</td>
</tr>
<tr>
<td align="right">電子郵件:</td>
<td align="left"><input name="email" type="text" id="email" maxlength="20" />
<span class="STYLE1">*</span> 找回密碼和聯系用(如:[email protected])</td>
</tr>
<tr>
<td align="right">聯系電話:</td>
<td align="left"><input name="tel" type="text" id="tel" size="20" maxlength="20" />
如(0871-8888888,13888853113)</td>
</tr>
<tr>
<td align="right">聯系地址:</td>
<td align="left"><input name="address" type="text" id="address" maxlength="50" /></td>
</tr>
<td height="40" colspan="2" align="center"><input type="submit" name="Submit" value="確認注冊" />
<input type="reset" name="Submit2" value="重新填寫" /></td>
</tr>
</table>
</form>
</body>
</html>
後台servlet的處理:
public class reg extends HttpServlet
{
public reg()
{
}
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
PrintWriter out;
DBConnection dbc=null;
String userName;
String psd;
String email;
String tel;
String address;
int popedom;
response.setContentType("text/html;charset=UTF-8");
out = response.getWriter();
try{
dbc = new DBConnection();
PreparedStatement ps = null;
userName = request.getParameter("userName");
psd = login.encrypt(request.getParameter("password1").toString());
email = request.getParameter("email");
tel = request.getParameter("tel");
address = request.getParameter("address");
popedom = Integer.parseInt(request.getParameter("popedom"));
if (userName != null && psd != null && email != null)
{
ps = dbc.getCon().prepareStatement("insert into [User](UName,Upass,UEmail,UTel,UAddress,UPopedom) values(?,?,?,?,?,?)");
ps.setString(1, userName);
ps.setString(2, psd);
ps.setString(3, email);
ps.setString(4, tel);
ps.setString(5, address);
ps.setInt(6, popedom);
ps.execute();
System.out.print("新用戶注冊:" + request.getParameter("userName") + " ");
out.print("<script>alert('恭喜您:注冊成功!現已經登錄到網站!');history.go(-1)</script>");
}
if (dbc != null)
dbc.dbClose();
}
catch(SQLException ex)
{
out.print("<script>alert('注冊失敗!資料庫連接錯誤!');history.go(-1)</script>");
ex.printStackTrace();
if (dbc != null)
dbc.dbClose();
}
}
}

㈤ html或者jsp中如何點擊超鏈接,打開一個新窗口,點擊一次,打開一個

在超鏈接中有一個target 屬性,它是規定在何處打開 action URL的一個屬性,其用法內如下:

<ahref="test.html"target="_blank"></a>

2、點擊這個連接將會在新的選項卡中打開test.html頁面

㈥ 如何在jsp中點擊一個超鏈接時彈出一個新的窗口

使用
<a href="http://unigreen.cn" target="_blank">超鏈接文字</a>
其中target="_blank"就是新窗口打開的版意權思。

㈦ 在JSP頁面上增加編輯窗口,應如何操作

按鈕上onClick事件調用個js方法:
function
winhref()
{
var
blankObj
=
window.open('./add.jsp','_blank','top=100,left=100,width=600,height=300,scrollbars=yes,toolbars=no');
}
這樣調用的頁面add.jsp會在新窗口彈出

㈧ 急急急~~~jsp 點擊按鈕打開一個新窗口

用form的submit做按鈕,點擊提交後就自動跳轉到action指定的新頁面去了吧

閱讀全文

與jsp新開一個窗口相關的資料

熱點內容
maya粒子表達式教程 瀏覽:84
抖音小視頻如何掛app 瀏覽:283
cad怎麼設置替補文件 瀏覽:790
win10啟動文件是空的 瀏覽:397
jk網站有哪些 瀏覽:134
學編程和3d哪個更好 瀏覽:932
win10移動硬碟文件無法打開 瀏覽:385
文件名是亂碼還刪不掉 瀏覽:643
蘋果鍵盤怎麼打開任務管理器 瀏覽:437
手機桌面文件名字大全 瀏覽:334
tplink默認無線密碼是多少 瀏覽:33
ipaddgm文件 瀏覽:99
lua語言編程用哪個平台 瀏覽:272
政采雲如何導出pdf投標文件 瀏覽:529
php獲取postjson數據 瀏覽:551
javatimetask 瀏覽:16
編程的話要什麼證件 瀏覽:94
錢脈通微信多開 瀏覽:878
中學生學編程哪個培訓機構好 瀏覽:852
榮耀路由TV設置文件共享錯誤 瀏覽:525

友情鏈接