我安装了glassfish v3。
我正在使用Maven来部署我的应用程序。
但是当我尝试启动应用程序时,浏览器会返回:
请求的资源()不可用。
有什么想法吗?
答案 0 :(得分:0)
When you launch an application from the admin console, you will access
it at its document root. In your example, the launch link would look
as follows:
localhost:8080/HelloWorldServlet/
When you access an application at its document root, the container
will check the application's document root folder for any welcome pages.
You can define your own welcome page(s) in your application, but
unless you do so, your application will inherit a predefined list of welcome
pages from your domain's default-web.xml descriptor, which looks like this:
index.html
index.htm
index.jsp
Try placing a file with one of the above names in your application's document root, and you'll notice that when you click on the launch link for your
app, the contents of its welcome page will be served.
If your app does not contain any welcome pages, the container would
normally generate a directory listing of its docroot folder. By
default, this functionality is disabled for security reasons, but can
be enabled by setting the init parameter with name "listings" of the
"default" Servlet, which is declared in default-web.xml, to "true".
This will enable directory listings globally (for all apps).
Alternatively, you
may enable directory listings for your app only, by setting "listings" to
"true" in your app's sun-web.xml descriptor.