中华技术网Servlet篇1-显示Servlet系统属性

Wuxuehui 2000-11-14 11:35:00
中华技术网Servlet篇1-显示Servlet系统属性 ( 连载篇 )
作者:Wuxuehui
网站:中华技术网 http://www.netqu.com

文件名:Servlet_Properties.java
-----------------------------------------
import javax.servlet.http.*;
import javax.servlet.*;

/* *
* 这是一个显示Servlet 服务器系统属性的列表程序
* This is a simple servlet that echo information
* about the client and also provide a listing of
* all of the system properties on the server.
*/
public class Servlet_Properties extends HttpServlet {
/* *
* 执行 HTTP GET 操做 ( Performs the HTTP GET operation )
* 参数 req 是客户端的要求值 ( Parameter req The request from the client )
* 参数 res 是服务器Servlet端的响应值 ( Parameter res The response from the servlet )
*/
public void doGet(
HttpServletRequest req,
HttpServletResponse res )
throws ServletException,java.io.IOException
{
// 设置 Servlet端的响应值内容类型 加入 'charset=gb2312' 这样 Servlet 才可以输出中文
// Set the content type of the response ,add 'charset=gb2312' support Chinese output
res.setContentType("text/html;charset=gb2312");
// 通过 PrintWriter 建立写权限输出Servlet端的响应值
// Create a PrintWriter to write the response
java.io.PrintWriter out = new java.io.PrintWriter(res.getOutputStream());
// 输出 HTML ( print the HTML )
out.println("<html><head><title>Java Servlet Properties</title><style>body,td {font-size:9pt;}</style></head><body bgcolor=white>");
out.println("<h3 align=center>Information About You</h3>");
out.println("
<center><table border=1 bordercolordark=white bordercolorlight=black cellpadding=0 cellspacing=0>");
out.println("<tr><td bgcolor=eeeeee>Method</td><td>" + req.getMethod() + "</td>");
out.println("<tr><td bgcolor=eeeeee>User</td><td>" + req.getRemoteUser() + "</td>");
out.println("<tr><td bgcolor=eeeeee>Client</td><td>" + req.getRemoteHost() + "</td>");
out.println("<tr><td bgcolor=eeeeee>Protocol</td><td>" + req.getProtocol() + "</td>");
out.println("</tr>");

java.util.Enumeration enum = req.getParameterNames();
// 显示URL参数值,可用 http://www.netqu.com/servlet/Properties?name=test 测试
// show URL Parameter browse http://www.netqu.com/servlet/Properties?name=test to test
while (enum.hasMoreElements()) {
String name = (String)enum.nextElement();
out.println("<tr>");
out.println("<td>Parameter'" + name + "'</td><td>" + req.getParameter(name) + "</td>");
out.println("</tr>");
}

out.println("</table>");
out.println("
<hr>
");
out.println("<h3 align=center>Server Properties</h3>");
out.println("
");
out.println("<table border=1 bordercolordark=white bordercolorlight=black cellpadding=0 cellspacing=0>");

java.util.Properties props = System.getProperties();
enum = props.propertyNames();

while (enum.hasMoreElements()) {
String name = (String)enum.nextElement();
out.println("<tr>");
out.println("<td bgcolor=eeeeee> " + name + "</td><td> " + props.getProperty(name) + "</td>");
out.println("</tr>");
}

out.println("</table><p><a href=http://www.netqu.com><img src=http://www.netqu.com/images/technet_banner.gif width=468 height=60 border=0 alt=中华技术网></a>

<a href=http://www.netqu.com/netqu_services.html target=_blank><font color=red>商业服务</font></a> | <a href=mailto:wuxuehui@sina.com?subject=站务合作>站务合作</a> | <a href=mailto:wuxuehui@sina.com?subject=广告联系>广告联系</a> | <a href=mailto:wuxuehui@sina.com?subject=联系方式>联系方式</a>
<table bgcolor=white><td>CopyRight © <a href=http://www.netqu.com>China Tech Net</a> All Rights Reserved Webmaster: <a href=mailto:Wuxuehui@sina.com?subject=fromnetqu>Wuxuehui</a> OICQ:178927 <img src=http://infocenter.tencent.com/178927/s/00/159/ width=16 height=16> ICQ: <a href=http://wwp.icq.com/2759606 target=_blank>2759606</a> <img width=55 height=14 src=http://online.mirabilis.com/scripts/online.dll?icq=2759606&img=9></table></p></center>");
// warp up
out.println("</body></html>");
out.flush();

}
/* *
* 初始化 Servlet. 叫做一次性Servlet载入.它可以保证编译前任何要求(request)值编译进servlet.
* Initialize the servlet. This is called once when the
* servlet is loaded. It is guaranteed to complete before any
* requests are made to the servlet
* 参数 cfg 设置 Servlet的信息
* Parameter cfg Servlet configuration information
*
*/
public void init(ServletConfig cfg)
throws ServletException
{
super.init(cfg);
}
/* *
* 摧毁 Servlet.卸载载入的Servlet程序
* Destroy the Servlet. This is called once when the servlet is unloaded.
*/

public void destroy()
{
super.destroy();
}
}
...全文
254 回复 打赏 收藏 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复
文末附数据集可视化效果图。 【数据集概况】 · 检测类别(中文):[护栏(bollard)] · 训练集:2239 张 · 验证集:640 张 · 测试集:320 张 · 总计:3199 张 城市街道护栏目标检测数据集... 【训练曲线与评估图】 【模型训练配置】 参数 | 值 模型 | yolo26n 训练轮数 | 100 epochs 输入尺寸 | 640x640 批次大小 | 24 优化器 | auto 初始学习率 | 0.01 训练设备 【关键指标汇总】 训练了 94 个 epoch,最终轮指标: 指标 | 数值 mAP50 | **0.7341** mAP50-95 | 0.3921 Precision | 0.7873 Recall | 0.6713 train/box_loss | 1.5260 train/cls_loss | 0.8206 val/box_loss | 1.7977 val/cls_loss | 1.1156 【训练过程分析】 94 轮训练后 mAP50 为 0.7341,模型基本收敛但还有提升余地。Loss 曲线下降正常,后期趋于平缓。mAP50-95 为 0.3921,和 mAP50 差距 0.34,定位精度是主要短板。 【模型性能评估】 Precision 0.7873、Recall 0.6713,精度高于召回,存在一定漏检。 【预测效果展示】 验证集预测效果一般,大部分目标能被检出,但存在部分漏检或框边缘贴合度不足的情况。 【改进建议】 1. 增强难例挖掘:在大规模数据中筛选误检、漏检样本做针对性增强。 2. 提升输入分辨率:640 对定位精度支撑不足,尝试 800 或 1024 改善 mAP50-95。 3. 调优 NMS 和置信度阈值:当前精召偏低,适当调整过滤阈值平衡输出质量。 【预测效果展示】

81,108

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧