weblogic之servlet问题请教!急!

friendy 2002-03-03 08:10:42
weblogic之servlet问题请教!
安装完weblogic后测试jsp可以运行,现测试servlet是否正常工作,
名为现想运行C:\bea\weblogic6.1\samples\examples\servlets\HelloWorldServlet.java的servlet,请问怎样才能运行成功,
1.已经在weblogic.properties文件中加入:
weblogic.httpd.register.HelloWorldServlet=examples.servlets.HelloWorldServlet
2.在地址栏中键入:http://localhost:7001/HelloWorldServlet
出错信息为:
Error 404--Not Found
From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
10.4.5 404 Not Found
The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.

If the server does not wish to make this information available to the client, the status code 403 (Forbidden) can be used instead. The 410 (Gone) status code SHOULD be used if the server knows, through some internally configurable mechanism, that an old resource is permanently unavailable and has no forwarding address.

不知道哪儿出了错!!!谢谢!!!
...全文
74 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
refc 2002-03-03
  • 打赏
  • 举报
回复
BEA WebLogic Server™ Fast Track for Web Applications

Servlet Fast Track
To deploy a servlet:
Create a subdirectory called classes under the following directory:
WL_HOME\config\mydomain\applications\
DefaultWebApp\WEB-INF\.
(Where WL_HOME is the directory of your WebLogic Server installation and mydomain is the name you specified as the WebLogic Admin Domain Name d uring installation.)


Copy your servlet class file into the following directory:
WL_HOME\config\mydomain\
applications\DefaultWebApp\
WEB-INF\classes.
If your servlet class has a package statement, create an additional subdirectory for each level of the package statement. For example, if your package statement is package color.blue, then place your servlet class in the following directory:
WL_HOME\config\mydomain\
applications\DefaultWebApp\
WEB-INF\classes\color\blue.

If you do not have a servlet class to use for this Fast Track procedure, and you have installed the WebLogic Server examples, try the following file: WL_HOME\config\examples\
applications\examplesWebApp\
WEB-INF\classes\examples\servlets\
HelloWorldServlet.class.


Modify the web.xml file located in the WL_HOME\config\mydomain\
applications\DefaultWebApp\
WEB-INF\ directory of your WebLogic Server installation by adding the following, in between the <web-app> and </web-app> tags:
<servlet>
<servlet-name>
myServlet
</servlet-name>
<servlet-class>
package.name.myServlet
</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>
myServlet
</servlet-name>
<url-pattern>
quickStartServlet
</url-pattern>
</servlet-mapping>



where:
myServlet is the name of your servlet class file.

package.name.myServlet is the full package name of your servlet class.


Save the web.xml file.

Start the default WebLogic Server. Windows NT users can use the Start Menu shortcut labeled Start Default Server.

Call your servlet from a Web browser with the following URL:
http://localhost:port/quickStartServlet

where:
localhost is the host name of the machine running WebLogic Server

port is the port number where WebLogic Server is listening for requests.

quickStartServlet is the value of the <url-pattern> element that you defined in the web.xml file in step 3.



--------------------------------------------------------------------------------

What's Going On?
The web.xml file that you edited is the deployment descriptor for a Web Application called DefaultWebApp. A Web Application is a J2EE deployment unit that ties together resources of a Web-based application. The DefaultWebApp Web Application is preconfigured in your WebLogic Server installation.
In the deployment descriptor you defined the class name of the servlet (the <servlet-class> element) and the URL that is used to resolve requests for the servlet (the <url-pattern> element).


--------------------------------------------------------------------------------

Additional Resources
Programming WebLogic HTTP Servlets
Assembling and Configuring Web Applications
Writing Web Application Deployment Descriptors
refc 2002-03-03
  • 打赏
  • 举报
回复
去Bea下一个文档吧,非常详细

23,407

社区成员

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

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