| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| hi i am learning to create and deploy web apps using NetBeansIDE and tomcat6,I used the following dir structure myapp -src -web -MET-INF ---has context.xml -WEB-INF--has html, jsps and web.xml In context.xml ,I set the following context <Context path="/myapp"> ....some db resource with name jdbc/myapp </Context> In web.xml ,I set <welcome-file-list> <welcome-file>begin.html</welcome-file> </welcome-file-list> <resource-ref> <res-ref-name>jdbc/myapp</res-ref-name> <res-type>javax.sql.DataSource</res-type> ... I have a begin.html in WEB-INF directory that i want to be loaded when the app starts.When I build the application ,java classes are compiled and a browser window opens and tries to load http://localhost:8080/myapp/ But i get an error 404 saying that The requested resource (/myapp/) is not available. Is there something wrong with the entries in the xml files?Is that why i get this error? pls help harry |
|
#2
| |||
| |||
| harryos wrote: > i [sic] am learning to create and deploy web apps using NetBeansIDE and > tomcat6,I used *the following dir structure > > myapp > * * -src > * * -web Web pages here. > * * * * * -MET-INF *---has context.xml > * * * * * -WEB-INF--has html, jsps and web.xml > > In context.xml ,I set the following context > <Context path="/myapp"> > ... > </Context> > > In web.xml ,I set > <welcome-file-list> > * * * * <welcome-file>begin.html</welcome-file> > * * * * </welcome-file-list> > .. > > I have a begin.html in WEB-INF directory that i [sic] want to be loaded when > the app starts.When I build the application ,java classes are compiled > and a browser window opens and tries to loadhttp://localhost:8080/myapp/ > But i [sic] get an error 404 saying that The requested resource (/myapp/)is > not available. Try putting 'begin.html' directly in the context root, i.e, in the source tree under web/ instead of web/WEB-INF/. > Is there something wrong with the entries in the xml files?Is that why > i [sic] get this error? WEB-INF is for resources that you want hidden from the browser, such as including .jspf page fragments. You have successfully hidden 'begin.html' from the browser by putting it in that directory. -- Lew |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.