// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space
// Source File Name: UbbCode.java
package zxwblog;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class UbbCode
{
private String source;
private String ubbTags[];
private String htmlTags[];
public UbbCode()
{
byte byte0 = 52;
source = new String();
ubbTags = new String[byte0];
htmlTags = new String[byte0];
ubbTags[0] = "[b]";
htmlTags[0] = "<b>";
ubbTags[1] = "[/b]";
htmlTags[1] = "</b>";
ubbTags[2] = "[i]";
htmlTags[2] = "<em>";
ubbTags[3] = "[/i]";
htmlTags[3] = "</em>";
ubbTags[4] = "[quote]";
htmlTags[4] = "<div style=\"border-style:dashed;background-color:#CCCCCC;border-width:thin;border-color:#999999\"><br><em>";
ubbTags[5] = "[/quote]";
htmlTags[5] = "</em><br><br></div>";
ubbTags[6] = "[/size]";
htmlTags[6] = "</font>";
ubbTags[7] = "[size=6]";
htmlTags[7] = "<font style=\"font-size:6px\">";
ubbTags[8] = "[size=8]";
htmlTags[8] = "<font style=\"font-size:8px\">";
ubbTags[9] = "[size=10]";
htmlTags[9] = "<font style=\"font-size:10px\">";
ubbTags[10] = "[size=12]";
htmlTags[10] = "<font style=\"font-size:12px\">";
ubbTags[11] = "[size=14]";
htmlTags[11] = "<font style=\"font-size:14px\">";
ubbTags[12] = "[size=18]";
htmlTags[12] = "<font style=\"font-size:18px\">";
ubbTags[13] = "[size=24]";
htmlTags[13] = "<font style=\"font-size:24px\">";
ubbTags[14] = "[size=36]";
htmlTags[14] = "<font style=\"font-size:36px\">";
ubbTags[15] = "[/font]";
htmlTags[15] = "</font>";
ubbTags[16] = "[font=宋体]";
htmlTags[16] = "<font face=\"宋体\">";
ubbTags[17] = "[font=黑体]";
htmlTags[17] = "<font face=\"黑体\">";
ubbTags[18] = "[font=隶书]";
htmlTags[18] = "<font face=\"隶书\">";
ubbTags[19] = "[font=仿宋_GB2312]";
htmlTags[19] = "<font face=\"仿宋_GB2312\">";
ubbTags[20] = "[font=幼圆]";
htmlTags[20] = "<font face=\"幼圆\">";
ubbTags[21] = "[font=Arial]";
htmlTags[21] = "<font face=\"Arial\">";
ubbTags[22] = "[font=Times New Roman]";
htmlTags[22] = "<font face=\"Times New Roman\">";
ubbTags[23] = "[red]";
htmlTags[23] = "<font color=\"red\">";
ubbTags[24] = "[/red]";
htmlTags[24] = "</font>";
ubbTags[25] = "[blue]";
htmlTags[25] = "<font color=\"blue\">";
ubbTags[26] = "[/blue]";
htmlTags[26] = "</font>";
ubbTags[27] = "[yellow]";
htmlTags[27] = "<font color=\"yellow\">";
ubbTags[28] = "[/yellow]";
htmlTags[28] = "</font>";
ubbTags[29] = "[green]";
htmlTags[29] = "<font color=\"green\">";
ubbTags[30] = "[/green]";
htmlTags[30] = "</font>";
ubbTags[31] = "[h1]";
htmlTags[31] = "<h1>";
ubbTags[32] = "[/h1]";
htmlTags[32] = "</h1>";
ubbTags[33] = "[h2]";
htmlTags[33] = "<h2>";
ubbTags[34] = "[/h2]";
htmlTags[34] = "</h2>";
ubbTags[35] = "[h3]";
htmlTags[35] = "<h3>";
ubbTags[36] = "[/h3]";
htmlTags[36] = "</h3>";
ubbTags[37] = "[h4]";
htmlTags[37] = "<h4>";
ubbTags[38] = "[/h4]";
htmlTags[38] = "</h4>";
ubbTags[39] = "[h5]";
htmlTags[39] = "<h5>";
ubbTags[40] = "[/h5]";
htmlTags[40] = "</h5>";
ubbTags[41] = "[h6]";
htmlTags[41] = "<h6>";
ubbTags[42] = "[/h6]";
htmlTags[42] = "</h6>";
ubbTags[43] = "[hr]";
htmlTags[43] = "<hr>";
ubbTags[44] = "[img]";
htmlTags[44] = "<br><img src=\"";
ubbTags[45] = "[/img]";
htmlTags[45] = "\"><br>";
ubbTags[46] = "[center]";
htmlTags[46] = "<div align=\"center\">";
ubbTags[47] = "[/center]";
htmlTags[47] = "</div>";
ubbTags[48] = "[left]";
htmlTags[48] = "<div align=\"left\">";
ubbTags[49] = "[/left]";
htmlTags[49] = "</div>";
ubbTags[50] = "[right]";
htmlTags[50] = "<div align=\"right\">";
ubbTags[51] = "[/right]";
htmlTags[51] = "</div>";
}
private String replace(String s, String s1, String s2)
{
StringBuffer stringbuffer = new StringBuffer();
for (int i = 0; i < s1.length(); i++)
{
char c = s1.charAt(i);
switch (c)
{
case 91: // '['
stringbuffer.append("\\[");
break;
case 93: // ']'
stringbuffer.append("\\]");
break;
default:
stringbuffer.append(c);
break;
}
}
Pattern pattern = Pattern.compile(stringbuffer.toString());
Matcher matcher = pattern.matcher(s);
StringBuffer stringbuffer1 = new StringBuffer();
for (boolean flag = matcher.find(); flag; flag = matcher.find())
matcher.appendReplacement(stringbuffer1, s2);
return matcher.appendTail(stringbuffer1).toString();
}
private String replaceNormalUBBCode(String s)
{
String s1 = new String(s);
for (int i = 0; i < ubbTags.length; i++)
s1 = replace(s1, ubbTags[i], htmlTags[i]);
return s1;
}
private String replaceURL(String s)
{
StringBuffer stringbuffer = new StringBuffer(s);
String s1 = new String();
int i = s.indexOf("[url]");
int j = s.indexOf("[/url]");
if (i != -1 && j != -1 && i < j)
{
String s2 = s.substring(i + 5, j);
String s3 = (new StringBuilder()).append("<a href=\"").append(s2).append("\">").append(s2).append("</a>").toString();
stringbuffer.replace(i, j + 6, s3);
}
return stringbuffer.toString();
}
private String replaceEmail(String s)
{
StringBuffer stringbuffer = new StringBuffer(s);
String s1 = new String();
int i = s.indexOf("[email]");
int j = s.indexOf("[/email]");
if (i != -1 && j != -1 && i < j)
{
String s2 = s.substring(i + 7, j);
String s3 = (new StringBuilder()).append("<a href=\"mailto:").append(s2).append("\">").append(s2).append("</a>").toString();
stringbuffer.replace(i, j + 8, s3);
}
return stringbuffer.toString();
}
public void setSource(String s)
{
source = s;
}
public String getResult()
{
return source;
}
public void run()
{
for (source = replaceNormalUBBCode(source); source.indexOf("[url]") != -1 && source.indexOf("[/url]") != -1; source = replaceURL(source));
for (; source.indexOf("[email]") != -1 && source.indexOf("[/email]") != -1; source = replaceEmail(source));
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
zxw.rar_java servlet_jsp servlet access _个人博客_博客_博客系统
共147个文件
gif:57个
jsp:28个
class:16个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 49 浏览量
2022-09-19
14:49:49
上传
评论
收藏 2.96MB RAR 举报
温馨提示
个人博客系统,采用jsp+servlet+access,放在tomcat服务器下即可运行。
资源推荐
资源详情
资源评论
收起资源包目录
zxw.rar_java servlet_jsp servlet access _个人博客_博客_博客系统 (147个子文件)
MD5.class 9KB
UbbCode.class 6KB
ChangePassword.class 4KB
AddLiuyanServlet.class 4KB
AddMessage.class 4KB
AddNote.class 3KB
UpdateNote.class 3KB
FaceFilter.class 3KB
AddReply.class 3KB
AdminBean.class 3KB
DB.class 3KB
AddDownload.class 3KB
SqLink.class 2KB
CheckAdmin.class 2KB
UpdateLink.class 2KB
HTMLFilter.class 2KB
index.css 2KB
lightbox.css 2KB
liuyan.css 1KB
poto.css 952B
head.css 818B
viewNote.css 767B
manage.css 668B
global.css 597B
editor.css 249B
footer.css 101B
Thumbs.db 27KB
Thumbs.db 9KB
Thumbs.db 9KB
Thumbs.db 8KB
Thumbs.db 7KB
1.gif 4KB
3.gif 4KB
4.gif 3KB
2.gif 3KB
26.gif 3KB
09.gif 3KB
loading.gif 3KB
06.gif 3KB
07.gif 2KB
24.gif 2KB
08.gif 2KB
12.gif 2KB
29.gif 2KB
25.gif 2KB
04.gif 2KB
10.gif 2KB
00.gif 2KB
27.gif 2KB
23.gif 2KB
16.gif 2KB
21.gif 2KB
05.gif 2KB
22.gif 2KB
02.gif 1KB
03.gif 1KB
01.gif 1KB
28.gif 1KB
prevlabel.gif 1KB
nextlabel.gif 1KB
30.gif 1KB
11.gif 1KB
download-icon.gif 1KB
13.gif 1KB
14.gif 1KB
20.gif 1KB
15.gif 1KB
19.gif 987B
closelabel.gif 979B
18.gif 943B
sun.gif 922B
donate-button.gif 723B
quote.gif 660B
image.gif 660B
link.gif 423B
date.gif 400B
email.gif 397B
17.gif 390B
close.gif 222B
underline.gif 88B
italic.gif 79B
bold.gif 76B
arrow.gif 71B
center.gif 70B
left.gif 70B
right.gif 70B
separator.gif 59B
bullet.gif 49B
testPrint.html 2KB
pic.html 2KB
poto.html 2KB
sqljdbc.jar 570KB
UbbCode.java 6KB
AddMessage.java 3KB
FaceFilter.java 3KB
AddNote.java 2KB
AddLiuyanServlet.java 2KB
AdminBean.java 2KB
CheckAdmin.java 2KB
HTMLFilter.java 2KB
共 147 条
- 1
- 2
资源评论
alvarocfc
- 粉丝: 105
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于springboot+vue实现的在线考试系统+源代码+文档
- RTL8723DS 2022 版本 Linux驱动,android驱动 支持4.0-10x
- 要玩NDS的遊戲,必須要先下載三個bios檔案到你的檔案資料夾
- 各类型数据库4月排名,基于排名网站数据爬虫json结果
- 基于springboot+vue实现的在线考试系统+源代码+文档
- 淮北市杜集区人才补贴+生活补贴
- JAVA-JSP技术文档
- 课内实验02-决策表(共享单车月卡).docx
- 基于【React + Node+SpringBoot】疫情数据查看系统的设计与实现【源码+lw+部署+讲解】
- 基于【React + Node】云课堂系统设计与实现【源码+lw+部署+讲解】
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功