??xml version="1.0" encoding="utf-8" standalone="yes"?> 1.高PR值站点的导入链接关键词位|、密度、处?/span>
1.URL中出现关键词Q英文)
2.|页标题中出现关键词Q?-3个)
3.关键词标{中出现关键词(1-3个)
4.描述标签中出现关键词Q主关键词重?ơ)
5.内容中自然出现关键词
6.内容W一D和最后一D出现关键词
7.H1QH2标签中出现关键词
8.导出链接锚文本中包含关键?br style="outline-width: medium; outline-style: none; outline-color: initial; " />9.囄的文件名包含关键?br style="outline-width: medium; outline-style: none; outline-color: initial; " />10.ALT属性中出现关键?br style="outline-width: medium; outline-style: none; outline-color: initial; " />11.关键词密?-8%
12.对关键词加粗或斜?br style="outline-width: medium; outline-style: none; outline-color: initial; " />内容质量、更新频率、相x?/span>
1.原创的内Ҏ(gu)佻I切忌被多ơ{载的内容
2.内容独立性,与其他页面至?0%互异
3.1000-2000字,合理分段
4.有规律更斎ͼ最好是每天
5.内容围绕面关键词展开Q与整站主题相关
6.h评论功能Q评Z出现关键?br style="outline-width: medium; outline-style: none; outline-color: initial; " />导入链接和锚文本
2.内容相关面的导入链?/span>
3.导入链接锚文本中包含面关键?/span>
4.锚文本存在于|页内容?/span>
5.锚文本周围出现相兛_键词
6.导入链接存在3个月以上
7.导入链接所在页面的导出链接于100?/span>
8.导入链接来自不同IP地址
9.导入链接自然增加
10.锚文本多样化Q如QSEO和SEO十万个ؓ什么)
原文地址Q?div style="display: inline-block; ">
]]>
]]>
if(applet_type == 1) {
s = '<embed TYPE="application/x-java-applet;version=1.3"\n';
s += ' PLUGINSPAGE="http://java.sun.com/products/plugin/1.3/plugin-install.html"\n';
} else if(applet_type == 2) {
s = '<object CLASSID="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"\n';
s += ' CODEBASE=" http://java.sun.com/products/plugin/autodl/jinstall-1_4_2-windows-i586.cab#Version=1,3,0,0"\n';
} else {
s = '<applet';
}
修改Z下代码即可(1.6Q:
if(applet_type == 1) {
s = '<embed TYPE="application/x-java-applet;jpi-version=1.6"\n';
s += ' PLUGINSPAGE="http://java.sun.com/products/plugin/index.html#download"\n';
} else if(applet_type == 2) {
s = '<object CLASSID="clsid:CAFEEFAC-0016-0000-0000-ABCDEFFEDCBA"\n';
s += ' CODEBASE="http://java.sun.com/update/1.6.0/jinstall-6-windows-i586.cab"\n';
} else {
s = '<applet';
}
]]>
Attributes
total (required) - The total number of results to paginate
action (optional) - the name of the action to use in the link, if not specified the default action will be linked
controller (optional) - the name of the controller to use in the link, if not specified the current controller will be linked
id (optional) - The id to use in the link
params (optional) - A map containing request parameters
prev (optional) - The text to display for the previous link (defaults to "Previous" as defined by default.paginate.prev property in I18n messages.properties)
next (optional) - The text to display for the next link (defaults to "Next" as defined by default.paginate.next property in I18n messages.properties)
max (optional) - The number of records displayed per page (defaults to 10). Used ONLY if params.max is empty
maxsteps (optional) - The number of steps displayed for pagination (defaults to 10). Used ONLY if params.maxsteps is empty
offset (optional) - Used ONLY if params.offset is empty
source: ./checkout/grails/src/groovy/org/codehaus/groovy/grails/plugins/web/taglib/RenderTagLib.groovy (No such file or directory)
3Q在jsp中加入代码:
<%@ taglib uri="
<str:substring start="0" end="40"><c:out value="${messages}"/></str:substring>
因此JSTL内置了几个用于字W串操作的方法,可以直接在表辑ּ中用,大大的简化了代码Q提供代码的可读性。在JSTL的表达是中要使用一个函敎ͼ其格式如?/p>
${ns:methodName(args....)}
在用这些函C前必dJSP中引入标准函数的声明
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
下面是JSTL中自带的Ҏ(gu)列表以及其描q?/p>
函数?/strong> | 函数说明 | 使用举例 |
contains | 判断字符串是否包含另外一个字W串 | <c:if test="${fn:contains(name, searchString)}"> |
containsIgnoreCase | 判断字符串是否包含另外一个字W串(大小写无? | <c:if test="${fn:containsIgnoreCase(name, searchString)}"> |
endsWith | 判断字符串是否以另外字符串结?/font> | <c:if test="${fn:endsWith(filename, ".txt")}"> |
escapeXml | 把一些字W{成XML表示Q例?lt;字符应该转ؓ< | ${fn:escapeXml(param:info)} |
indexOf | 子字W串在母字符串中出现的位|?/font> | ${fn:indexOf(name, "-")} |
join | 数l中的数据联合成一个新字符Ԍq用指定字W格开 | ${fn:join(array, ";")} |
length | 获取字符串的长度Q或者数l的大小 | ${fn:length(shoppingCart.products)} |
replace | 替换字符串中指定的字W?/font> | ${fn:replace(text, "-", "")} |
split | 把字W串按照指定字符切分 | ${fn:split(customerNames, ";")} |
startsWith | 判断字符串是否以某个子串开?/font> | <c:if test="${fn:startsWith(product.id, "100-")}"> |
substring | 获取子串 | ${fn:substring(zip, 6, -1)} |
substringAfter |
获取从某个字W所在位|开始的子串 |
${fn:substringAfter(zip, "-")} |
substringBefore | 获取从开始到某个字符所在位|的子串 | ${fn:substringBefore(zip, "-")} |
toLowerCase | 转ؓ写 | ${fn.toLowerCase(product.name)} |
toUpperCase | 转ؓ大写字符 | ${fn.UpperCase(product.name)} |
trim | 去除字符串前后的I格 | ${fn.trim(name)} |
import Java.io.IOException;
import Java.util.Collection;
import Java.util.Iterator;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.BodyTagSupport;
public class IterateTag extends BodyTagSupport {
private String name; //代表了在pageContext中表C的一个属性的名字
private Iterator it; //代表要P代的内容
private String type; //表示it中对象的cd
public void setCollection(Collection collection){
if(collection.size()>0){
it=collection.iterator();
}
}
public void setName(String name){
this.name=name;
}
public void setType(String type){
this.type=type;
}
@Override
public int doAfterBody() throws JspException {
// TODO Auto-generated method stub
return continueNext(it);
}
@Override
public int doEndTag() throws JspException {
// TODO Auto-generated method stub
try{
if(bodyContent!=null){
bodyContent.writeOut(bodyContent.getEnclosingWriter());
}
}catch(IOException e){
throw new JspTagException("IO Error:"+e.getMessage());
}
return EVAL_PAGE;
}
@Override
public int doStartTag() throws JspException {
// TODO Auto-generated method stub
if(it==null){
return SKIP_BODY;
}else{
return continueNext(it);
}
}
protected int continueNext(Iterator it)throws JspTagException{
if(it.hasNext()){
pageContext.setAttribute(name, it.next(), PageContext.PAGE_SCOPE);
return EVAL_BODY_AGAIN;
}else{
return SKIP_BODY;
}
}
}
׃BodyTagSupportcdCTagSupportQ而TagSupport又实CTterationTag接口。故在开发P代标{时可以直接从BodyTagSupportl承?br />
package com.rain.tag;
import javax.servlet.jsp.tagext.TagData;
import javax.servlet.jsp.tagext.TagExtraInfo;
import javax.servlet.jsp.tagext.VariableInfo;
//TagExtraInfo用于提供一些在标签译时相关的信息
public class IterateTEI extends TagExtraInfo {
public IterateTEI(){
super();
}
@Override
public VariableInfo[] getVariableInfo(TagData arg0) {
// TODO Auto-generated method stub
return new VariableInfo[]{
new VariableInfo(arg0.getAttributeString("name"),
arg0.getAttributeString("type"),
true,
VariableInfo.NESTED)
};
}
}
需要说明的是VariableInfo的几个常敎ͼ如下所C:
1.NESTEDQ标{中的参数在starttag到endtag之间是有效的?br />2.AT_BENGINQ标{中的参数在标签的开始到JSP面l束是有效的?br />3.AT_ENDQ标{中的参数在标签的结束到JSP面l束是有效的?br />
在标{描述中,必须同时指定标签的实现类和IterateTEIcR?br /> <tag>
<name>iterate</name>
<tag-class>com.rain.tag.IterateTag</tag-class>
<tei-class>com.rain.tag.IterateTEI</tei-class>
<body-content>jsp</body-content>
<attribute>
<name>collection</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>name</name>
<required>true</required>
</attribute>
<attribute>
<name>type</name>
<required>true</required>
</attribute>
</tag>
q行l果Q?br />one
two
three
import Java.io.IOException;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.tagext.BodyTagSupport;
/*
* if tag
* usage:<tag:if value=true>
* ...
* </tag:if>
*/
public class IfTag extends BodyTagSupport {
private boolean value;
public void setValue(boolean value){
this.value=value;
}
@Override
public int doEndTag() throws JspException {
// TODO Auto-generated method stub
try{
if(bodyContent!=null){
bodyContent.writeOut(bodyContent.getEnclosingWriter());
}
}catch(IOException e){
throw new JspTagException("IO Error:"+e.getMessage());
}
return EVAL_PAGE;
}
@Override
public int doStartTag() throws JspException {
// TODO Auto-generated method stub
if(value){
System.out.println("value is true");
return EVAL_BODY_INCLUDE;
}else{
System.out.println("value is false");
return SKIP_BODY;
}
}
}
import Java.io.IOException;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.tagext.TagSupport;
public class OutTag extends TagSupport {
private Object value;
public void setValue(Object value){
this.value=value;
}
@Override
public int doEndTag() throws JspException {
// TODO Auto-generated method stub
return EVAL_BODY_INCLUDE;
}
@Override
public int doStartTag() throws JspException {
// TODO Auto-generated method stub
try{
System.out.println(value);
pageContext.getOut().write(value.toString());
}catch(IOException e){
throw new JspTagException("IO Error:"+e.getMessage());
}
return EVAL_PAGE;
}
}
import Java.io.IOException;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.tagext.BodyContent;
import javax.servlet.jsp.tagext.BodyTagSupport;
public class BodyTagExample extends BodyTagSupport {
int counts; //countsP代的ơ数
public BodyTagExample(){
super();
}
/*
* 讄counts属性,q个Ҏ(gu)由容器自动调?br /> */
public void setCounts(int c){
this.counts=c;
}
@Override
public int doAfterBody() throws JspException {
// TODO Auto-generated method stub
System.out.println("doAfterBody"+counts);
if(counts>1){
counts--;
return EVAL_BODY_AGAIN;
}else{
return SKIP_BODY;
}
}
@Override
public int doEndTag() throws JspException {
// TODO Auto-generated method stub
System.out.println("doEndTag");
try{
if(bodyContent!=null){
bodyContent.writeOut(bodyContent.getEnclosingWriter());
}
}catch(IOException e){
throw new JspTagException("IO Error:"+e.getMessage());
}
return EVAL_PAGE;
}
@Override
public void doInitBody() throws JspException {
// TODO Auto-generated method stub
System.out.println("doInitBody");
}
@Override
public int doStartTag() throws JspException {
// TODO Auto-generated method stub
System.out.println("doStartTag");
if(counts>0){
return EVAL_BODY_AGAIN;
}else{
return SKIP_BODY;
}
}
@Override
public void setBodyContent(BodyContent arg0) {
// TODO Auto-generated method stub
System.out.println("setBodyContent");
this.bodyContent=arg0;
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<taglib xmlns=" xmlns:xsi=" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd"
version="2.0">
<description>A tag library exercising SimpleTag handlers.</description>
<tlib-version>1.0</tlib-version>
<short-name>examples</short-name>
<uri>/demotag</uri>
<description>JSP应用开?lt;/description>
<tag>
<name>loop</name>
<tag-class>com.rain.tag.BodyTagExample</tag-class>
<body-content>jsp</body-content> Body-Content必须为JSP
<attribute>
<name>counts</name> 定义中必LsetCounts(int counts)Ҏ(gu)
<required>true</required> 表示q个属性是必须?/font>
<rtexprvalue>true</rtexprvalue> 支持JSP表达?br /> </attribute>
</tag>
</taglib>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "<web-app>
<taglib>
<taglib-uri>/demotag</taglib-uri>
<taglib-location>/WEB-INF/mytag.tld</taglib-location>
</taglib>
</web-app>
<%@ page language="Java" contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="/demotag" prefix="bodytag" %>
<html>
<head>
<title>Insert title here</title>
</head>
<body>
<bodytag:loop counts="5">
现在旉?<%=new Java.util.Date()%><br>
</bodytag:loop>
</body>
</html>
执行l果Q?/strong>
控制台打印出
doStartTag
setBodyContent
doInitBody
doAfterBody5
doAfterBody4
doAfterBody3
doAfterBody2
doAfterBody1
doEndTag
面昄
现在旉?Mon Jan 22 14:52:43 CST 2007
现在旉?Mon Jan 22 14:52:43 CST 2007
现在旉?Mon Jan 22 14:52:43 CST 2007
现在旉?Mon Jan 22 14:52:43 CST 2007
现在旉?Mon Jan 22 14:52:43 CST 2007
import Java.io.IOException;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.Tag;
public class HelloTag implements Tag {
private PageContext pageContext;
private Tag parent;
public HelloTag(){
super();
}
public int doEndTag() throws JspException {
// TODO Auto-generated method stub
try{
pageContext.getOut().write("Hello World! 你好");
}catch(IOException e){
throw new JspTagException("IO Error:"+e.getMessage());
}
return EVAL_PAGE;
}
public int doStartTag() throws JspException {
// TODO Auto-generated method stub
return SKIP_BODY; //q回SKIP_BODYQ表CZ计算标签?br /> }
public Tag getParent() {
// TODO Auto-generated method stub
return this.parent;
}
public void release() {
// TODO Auto-generated method stub
}
public void setPageContext(PageContext arg0) {
// TODO Auto-generated method stub
this.pageContext=arg0;
}
public void setParent(Tag arg0) {
// TODO Auto-generated method stub
this.parent=arg0;
}
}
~写标签库描q?br />
<?xml version="1.0" encoding="UTF-8" ?>
<taglib xmlns=" xmlns:xsi=" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd"
version="2.0">
<description>A tag library exercising SimpleTag handlers.</description>
<tlib-version>1.0</tlib-version>
<short-name>examples</short-name>
<uri>/demotag</uri>
<description>JSP应用开?lt;/description>
<tag>
<description>Outputs Hello,World</description>
<name>hello_int</name>
<tag-class>com.rain.tag.HelloTag</tag-class>
<body-content>empty</body-content>
</tag>
</taglib>
使用自定义标{?br />
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "<web-app>
<taglib>
<taglib-uri>/demotag</taglib-uri>
<taglib-location>/WEB-INF/mytag.tld</taglib-location>
</taglib>
</web-app>
<%@ page language="Java" contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="/demotag" prefix="hello" %>
<html>
<head>
<title>Insert title here</title>
</head>
<body>
<p>以下的内Ҏ(gu)从Taglib中显C的Q?lt;/p>
<p><i><hello:hello_int/></i></p>
</body>
</html>
本实例是实现Tag接口Q但Z在开发中方便单,一般直接承TagSupportc,只覆盖doStartTag和doEndTag两个Ҏ(gu)可以。TagSupport是Tag的子cR?/p>
1Q?span style="FONT: 7pt 'Times New Roman'">
把数据保存在 Session 中(q是常见方式Q;2Q?span style="FONT: 7pt 'Times New Roman'">
通过 Cookie Q?/span>3Q?span style="FONT: 7pt 'Times New Roman'">
通过隐含的表单把数据提交C一个页面;4Q?span style="FONT: 7pt 'Times New Roman'"> 通过 ServletContext 对象Q?/span>
5Q?span style="FONT: 7pt 'Times New Roman'"> 通过 Application 对象Q?/span>
6Q?span style="FONT: 7pt 'Times New Roman'"> 通过文gpȝ或者数据库?/span>
在不同用户之间共享数据,通常用法是:
1Q?span style="FONT: 7pt 'Times New Roman'"> 通过 ServletContext 对象Q?/span>
2Q?span style="FONT: 7pt 'Times New Roman'"> 通过 Application 对象Q?/span>
3Q?span style="FONT: 7pt 'Times New Roman'"> 通过文gpȝ或者数据库?/span>
|
byte[] buff = new byte[2048];
int bytesRead;
while(-1 != (bytesRead = bis.read(buff, 0, buff.length))) {
bos.write(buff,0,bytesRead);
}
} catch(final IOException e) {
System.out.println ( "出现IOException." + e );
} finally {
if (bis != null)
bis.close();
if (bos != null)
bos.close();
}
return;
%>
<select name="kind1" id="kind1" onChange="onchange_kind1(this.value);">
<%
Vector myvector=null;
myvector=kind1info.selectInfor();
for(int i=0;i<myvector.size();i++)
{
kind1id=((kind1Unit)myvector.elementAt(i)).getID();
kindname1=((kind1Unit)myvector.elementAt(i)).getKindName1();
%>
<option value="<%=kind1id%>"><%=kindname1%></option>
<%
}//循环l束
%>
</select></td>
<td width="81%"><div id="divKind" name="divKind">
<select name="kind2" id="kind2">
</select>
</div>
<iframe id="frmcontent" name="frmcontent" width="400" height="40" src=""></iframe>
W二面
<div id="divKind" name="divKind">
<select name="kind2" id="kind2" >
<%
Vector myvector=null;
myvector=kind2info.selectInfor(kind1id);
for(int i=0;i<myvector.size();i++)
{
kind2id=((kind2Unit)myvector.elementAt(i)).getID();
kindname2=((kind2Unit)myvector.elementAt(i)).getKindName2();
%>
<option value="<%=kind2id%>"><%=kindname2%></option>
<%
}//循环l束
%>
</select>
</div>
<script language="javascript">
function getItem()
{
//alert(document.form1.kind2.innerHTML);
//alert(parent.document.form1.kind2.innerHTML);
parent.document.all.divKind.innerHTML = document.all.divKind.innerHTML;
//alert(parent.document.form1.kind2.innerHTML);
//.innerText
}
getItem();
</script>