Issue
I found this question: Netbeans Web application .html .jsp
I have the same issue. Is there a way to change it somewhere somehow? Or if I create a new .jsp file in the same project, how do I make runnable(when I click on Run on Server to load the .jsp file and to threat that one as default instead of the .html)?
Thanks for the help!
Solution
I'm not entirely sure but I think that you're referring to the welcome files mechanism. What file this mechanism prefers depends on the version of Glassfish/JavaEE you're using as in more recent versions jsp is kind of deprecated. As you mention jsp I also assume that you're not using faces.
The easiest way to control what file or files gets offered as default file you have to edit web.xml, the standard deployment file (which became optional in EE6 but if it's there it will still be consulted:
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
As stated in the tutorial:
If a web container receives a valid partial request, the web container examines the welcome file list and appends to the partial request each welcome file in the order specified and checks whether a static resource or servlet in the WAR is mapped to that request URL. The web container then sends the request to the first resource that matches in the WAR.
With Netbeans you can also edit this list via the web.xml file, under the "Pages" tab.
Answered By - fvu
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.