Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Google·ÖÒ³¹¦ÄܵÄjsp±êǩʵÏÖ

 ÏÂÃæÊÇjsp´úÂë<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page import="com.yourcompany.struts.action.Student" %>
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
System.out.println("&&&path&"+path);
System.out.println("&&&basepath&"+basePath);
%>
<html>
<head></head>
<body>
<pg:pager
items="<%=((List<Student>)request.getAttribute("listPage")).size() %>"
url="/FenyeStruts/hello.do"
index="center"
maxPageItems = "4"
maxIndexPages="4"
isOffset = "<%=false%>"
export = "pageOffset,currentPageNumber=pageNumber"
scope = "request">

<pg:index>
<table border=0 cellpadding=0 width=10% cellspacing=0>
<tr align=center valign=top>
<pg:pages>
<% if (pageNumber == currentPageNumber) { %>
<td><br>
<font color=#A90A08><%=pageNumber%></font></td>
<% } else { %>
<td><A HREF="<%=pageUrl%>"><br>
<%= pageNumber %></A></td>
<% } %>
</pg:pages>
</tr>
</table>
</pg:index>

<table border=1>
<tr>
<td>student no</td>
<td>student name</td>
<td>student score</td>
</tr>


<%
List<Student> slist=(List<Student&


Ïà¹ØÎĵµ£º

jspÖеÄÔªËصÄidÖµºÍnameÖµ£¬ÔÚieºÍffÖеÄÇø±ð

document.getElementById("flag")ÔÚieÖУ¬jspÖеÄÔªËØûÓÐidÖµ£¬ÓÐnameֵʱ£¬Ò²Äܲé³öÀ´£¬°´ÕÕnameÖµ²é¡£
µ«ÊÇÔÚfirefoxÖУ¬Èç¹ûûÓÐidÖµ£¬Ôò²é²»³öÀ´¡£ËùÒÔieÖУ¬nameºÍidÓÐʱͨÓ㻵«ÊÇfirefoxÖУ¬ÊÇÓÐÕâÑϸñÇø±ðµÄ¡£ ......

jsp/servletÖеĹýÂËÆ÷FilterÅäÖÃ×ܽá

ÔÚJava web¿ª·¢Öг£»áʹÓõ½¹¦ÄÜÇ¿´óµÄ¹ýÂËÆ÷£¬Ëû±Ï¾¹ÄܸøÎÒÃÇ´øÀ´ºÜ´óµÄ·½±ã£¬µ«ÊÇÕë¶Ô¹ýÂ˵Ä×ÊÔ´ÎÒÃÇÐèÒªÏêϸµÄÁ˽âËûÃÇÔÚweb.xmlÖеÄÅäÖÃÐÅÏ¢¡£Õâ¸ö¸ù¾Ý¼¸ÖÖ³£ÓõIJ»Í¬Çé¿ö½øÐÐÁË×ܽ᣺
1.Èç¹ûÒªÓ³Éä¹ýÂËÓ¦ÓóÌÐòÖÐËùÓÐ×ÊÔ´£º
<filter>
    <filter-name>loggerfilter</filter-name> ......

JSP+MySqlµÄʱ¼ä´¦Àí

ºÜ¾ÃûÓÐÓÃMysqlÁË£¬·¢ÏÖССµÄʱ¼äÎÊÌâÒ²Óöµ½²»ÉÙÂé·³£¬ºÇºÇ
ËùÒÔ×ܽáһϣº
µÚÒ»ÖÖ:
Date time= new java.sql.Date(new java.util.Date().getTime());
µÚ¶þÖÖ:
java ÓÃPreparedStatementÀ´setDate,ÓÃÎʺŵÄÐÎʽ¸øÈÕÆÚÎʺŸ³Öµ
pstmt.setTimestamp(8, new Timestamp(System.currentTimeMillis()));  
pst ......

Jsp JavaBean ServletʵÏÖMVC ϸ΢ÎÊÌâ×¢Òâ!

ÔÚJspÖе÷ÓÃSerlvetÖÐÒѾ­´æ´¢ÁËÐÅÏ¢µÄ JavaBean.
ServletÖÐÒѾ­°ÑÊý¾Ý¿âµÄÐÅÏ¢±£´æµ½JavaBeanÖÐ,ÔÙ°ÑJavaBean±£´æµ½SessionÖÐ.
Jsp¿ªÊ¼µ÷ÓÃ:
<jsp:useBean id="key" type="ClassName" scope="Session" />
<jsp:getProperty name="key" property="PropertyName" />
ÎÞ·¨¶Á³öÐÅÏ¢:
Ô­Òò: JavaBean ÖÐÊôÐÔµ ......

²»¼ä¶ÏÑ­»·¹ö¶¯Í¼Æ¬£¬jspÍøÒ³´úÂë

<html>
 <head>
  <title>marquee</title>
  <style>
   #marq {
    width:500px;
    height:100px;
    border:1px solid red;
    overflow:hidden;
   }
   #mar ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ