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&
相关文档:
连接ACCESS数据库的简单JSP代码:
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<%@ page import="java.sql.*" %>
<%
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ;
String url="jdbc:odbc:Driver={MicroSoft Access Drive ......
努力了一天再加一天,就写个脚本还是不行。怎么办。
下面的代码有错的,执行不了。暂时还没有发现MyEclipse里面如何来单步调试,就像在vs2005里面可以按住F10来调试,看出自己的那个语句写错了,而在里只能够自己检查,查了多少遍了也还是没有能够发现有什么错的。代码摘录如下:
<script language="javaScript ......
在Java web开发中常会使用到功能强大的过滤器,他毕竟能给我们带来很大的方便,但是针对过滤的资源我们需要详细的了解他们在web.xml中的配置信息。这个根据几种常用的不同情况进行了总结:
1.如果要映射过滤应用程序中所有资源:
<filter>
<filter-name>loggerfilter</filter-name> ......
request request表示HttpServletRequest对象。它包含了有关浏览器请求的信息,并且提供了几个用于获取cookie, header, 和session数据的有用的方法。
response response表示HttpServletResponse对象,并提供了几个用于设置送回 浏览器的响应的方法(如cookies,头信息等)
out out 对象是javax.jsp.JspWriter的一个实例, ......
<html>
<head>
<title>marquee</title>
<style>
#marq {
width:500px;
height:100px;
border:1px solid red;
overflow:hidden;
}
#mar ......