deploying webapps to glassfish (v2/v3)
I've recently switched from tomcat/resin to glassfish.
But so far when I added glassfish into my idea (idea 8 not 7). I've successfully deployed and started.
Let's say: http://localhost:8080/test
However it seems only the .class files are deployed, because I could access http://localhost:8080/test/index.jsp. But all the css files and relative paths are corrupted, which means the page is rendered but the css are not loaded.
ex:
I've coded like "<link rel="stylesheet" type="text/css" href="/css/style.css" media="screen"/>" to refer to my css file in my index.jsp.
But the page cannot find this file..
anyone has an idea?
请先登录再写评论。
please ignore
Hello.
If you have the following layout of web application:
- (resource dir)/index.jsp
- (resource dir)/css/style.css
And context root is "test", then changing href="/css/style.css" to href="css/style.css" or href="/test/css/style.css" helps. (At least on glassfish 2.)
Alexander.