servlet编程中的特征文件.properite中的参数是怎么定义的?

icmas 2001-12-03 10:10:49
JSDK中是
servlet.<servletname>.code=<servletclass>
servlet.<servletname>.initArgs=<name=value>.<name=value>
而tomcat中怎么又是
servelt.title.<....>=.....
servlet.mothed.<....>=.....
那位能具体的讲一下,急!!!!!
...全文
141 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
icmas 2001-12-03
  • 打赏
  • 举报
回复
Thanks,xmviour for your help.
xmvigour 2001-12-03
  • 打赏
  • 举报
回复
看一下jdk文档java.util
Class Properties

java.lang.Object
|
+--java.util.Dictionary
|
+--java.util.Hashtable
|
+--java.util.Properties

icmas 2001-12-03
  • 打赏
  • 举报
回复
谁能确切的讲一下呢,好象刚才的properites文件不对,服务器提示出错
icmas 2001-12-03
  • 打赏
  • 举报
回复
能否确切的讲一下,什么样的KEY需要定义呢?title,method,requesturi象上面的initString,还有什么,老兄具体的讲一下,提供一下材料也行!谢谢//
xmvigour 2001-12-03
  • 打赏
  • 举报
回复
String initString;
public void init(ServletConfig config) throws ServletException{
super.init(config);
initString=new String("I have been initialized");
}

你是定义一个initString;程序运行时调用该init中它的值吗?

hello.properties:
initString=I have been initialized
icmas 2001-12-03
  • 打赏
  • 举报
回复
楼上老兄,象下面的程序该怎么写它的特征文件:
import java.io.*;
import java.util.Date;
import javax.servlet.*;
class aaa extends GenericServlet{
String initString;
public void init(ServletConfig config) throws ServletException{
super.init(config);
initString=new String("I have been initialized");
}
public void service(ServletRequest req,ServletResponse res)
throws ServletException,IOException{
Date today=new Date();
ServletOutputStream out=res.getOutputStream();
out.println("hello world");
out.println("today.toString()");
out.println(getServletInfo());
}
public void Destroy(){
}
public String getServletInfo(){
return "Create a page that says HELLO WORLD and send dat back produced by ly";
}
}
谢谢!
xmvigour 2001-12-03
  • 打赏
  • 举报
回复
requestinfo.title=Request Information Example
requestinfo.label.method=Method:
requestinfo.label.requesturi=Request URI:
requestinfo.label.protocol=Protocol:
requestinfo.label.pathinfo=Path Info:
requestinfo.label.remoteaddr=Remote Address:

all of them are "key=value"!
icmas 2001-12-03
  • 打赏
  • 举报
回复
没有人能看一下????

81,116

社区成员

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

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