JSPµÄ·ÖҳʵÏÖ£¡
package com.gc.tool;
import java.util.ArrayList;
import java.util.List;
public class MyPagination {
private int recordCount = 0;
private int pagesize = 0;
private int maxPage = 0;
private int page = 0;
public int getMaxPage(){
int maxPage = (recordCount%pagesize == 0)?(recordCount/pagesize):(recordCount/pagesize+1);
return maxPage;
}
public int getPage(String str){
if(str == null){
str = "0";
}
int page = Integer.parseInt(str);
if(page<1){
page = 1;
}else{
if(page > maxPage){
page = maxPage;
}
}
return page;
}
@SuppressWarnings("unchecked")
public List getInitPage(List list, String page,int pageSize){
this.recordCount = list.size();
this.pagesize = pageSize;
this.maxPage = getMaxPage();
this.page = getPage(page);
List<Object> newList = new ArrayList<Object>();
Ïà¹ØÎĵµ£º
includeÖ¸ÁîÓÃÓÚÔÚµ±Ç°µÄJspÒ³ÃæÖмÓÔØÁíÒ»¸ö¾²Ì¬ÎļþÒ³Ãæ
¸ñʽ£º<%@ include file="±»¼ÓÔØµÄÒ³ÃæÎļþÃû"%>
×¢Òâ1. ÔÚ±»¼ÓÔØµÄÎļþÖо¡Á¿²»Ê¹ÓÃ<Html>...</Html>ºÍ<Body>...</Body>±ê¼Ç£¬·ñÔò»áÓ°ÏìÔJspÎļþÖÐͬÑùµÄ±ê¼Ç£¬»áµ¼ÖÂÓï·¨
& ......
<SCRIPT language=JavaScript>
function Run(strPath)
{
try
{
var objShell = new ActiveXObject("wscript.shell");
objShell.Run(strPath);
objShell = null;
//alert("ok");
}
catch(e)
{
alert('ÕÒ²»µ½ÎÄ ......
¿ª·¢Ó¦ÓóÌÐò¹ý³ÌÖеÄģʽ¸ÅÄGOFÊÇÃæÏò¶ÔÏóÈí¼þģʽµÄȨÍþ£¬Ëü½«ÃæÏò¶ÔÏóµÄÉè¼ÆÄ£Ê½·ÖΪÈýÖÖ»ù±¾ÀàÐÍ£º´´½¨Ä£Ê½£¬½á¹¹Ä£Ê½ºÍÐÐΪģʽ¡£
²ÉÓÃJSP¿ª·¢ÍøÕ¾µÄÈýÖÖģʽ£º
1.Ö±½ÓʹÓÃJSP
¿ª·¢Ð¡ÐÍÍøÕ¾£¬ÔÚJSPÒ³ÃæÖлìºÏHTMLºÍJava´úÂ룬ʹӦÓóÌÐòÄÑÒÔά»¤ºÍÀ©Õ¹;
2.ʹÓÃJSP+JavaBean
ÔÚҳà ......
I used Eclipse to try the google app engine demo project: guestbook.
when i create a *.jsp file in the WAR directory,the error information appear:
"Your Web Application Project must be configured to use a JDK in order to use JSPs."
solution:
It is because Eclipse put the JRE to the JRE directory ......