File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about Eclipse/Bootstrap/Tomcat

 
David Borchgrevink
Ranch Hand
Posts: 93
2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone know why bootstraps effects would be working fine within Eclipse when I right click my servlet and choose "run on server", but yet when I go to the same address in my browser(Chrome) there aren't any effects? It's obviously working, but why only inside Eclipse is mysterious to me.

Thanks in advance for any response
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Likely your CSS or JavaScript paths are wrong. What happens inside Eclipse is not the real world -- you should be more concerned with how it runs outside of the IDE.

Most experienced developers will use IDEs as smart editors, but run web apps outside the IDE.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
P.S. See the JspFaq for info on how to correctly format resource paths.
 
David Borchgrevink
Ranch Hand
Posts: 93
2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Likely your CSS or JavaScript paths are wrong. What happens inside Eclipse is not the real world -- you should be more concerned with how it runs outside of the IDE.

Most experienced developers will use IDEs as smart editors, but run web apps outside the IDE.


Thanks for the response. In regards to CSS or JavaScript, I have neither (that I know of) in my jsp. And that's why I'm asking, because I want it to work on a browser, not just Eclipse's environment. What's really strange is that for about 30 minutes, it worked fine on the browser as well, then all of the sudden I refreshed, and it was just basic text...no more bootstrap effects, when I had made no changes. And it's been that way since. :/
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, if you are not talking about this Bootstrap, which is a JavaScript and CSS library, you'll need to be much more specific about what you mean by "bootstrap effects".
 
David Borchgrevink
Ranch Hand
Posts: 93
2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:OK, if you are not talking about this Bootstrap, which is a JavaScript and CSS library, you'll need to be much more specific about what you mean by "bootstrap effects".


I stand corrected, that is indeed the Boostrap I'm using. Didn't realize it contained JavaScript (I figured CSS was involved). But I've used the same code on multiple projects and it will work in either the Eclipse environment or the browser(I'm using Chrome). So again, it's just strange that it would be working fine in the browser, and then with no changes, all of the sudden the browser doesn't recognize it. This isn't an assignment, or a work project or anything, just something I'm tinkering around with since recently learning to work with Eclipse, dBeaver, and EE in general. Again though, the strange part is that the browser just stopped recognizing the bootstrap components all of the sudden.

and for comparison's sake, I removed that project from my Tomcat7 server, and added a previously working project back onto the server and ran it in Chrome at http://localhost:8080. low and behold, bootstrap is working fine in the browser for that project. So I know it has to do with this specific thing I'm tinkering with. I'm just not sure where because all of the files pertaining to bootstrap (and pretty much everything else for that matter) are identical.

Strange...
 
David Borchgrevink
Ranch Hand
Posts: 93
2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I removed all projects from my Tomcat7 server, and closed Eclipse, then restarted. Added this project back in, and of course, now it's working in both the Eclipse environment, and my browser. I have a sneaking suspicion that the same thing may happen again, so I'll let you know if that's warranted, but for now, lesson learned - don't underestimate the power of a reboot

EDIT: my suspicions were indeed warranted. I just went to refresh http://localhost:8080 and of course, the bootstrap components are gone...just plain text. This is so weird...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So we come back to properly formatting the resource paths...
 
David Borchgrevink
Ranch Hand
Posts: 93
2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:So we come back to properly formatting the resource paths...


The wise bear knows all! Okay so again, very new to Eclipse - how exactly would I go about doing that?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See the JspFaq. There's an entry on properly formatting resource URLs to be bulletproof.
 
David Borchgrevink
Ranch Hand
Posts: 93
2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:See the JspFaq. There's an entry on properly formatting resource URLs to be bulletproof.


Well I looked through that, and everything looked as it should be according to the suggestions. But then I realized in my Servlet, the @WebServlet annotation was set to ("/"), whereas in my previous projects, I had set it to (""). So I changed that and now the styling is showing up again in both Eclipse and the browser. I'm not sure why I was putting the slash there, but I think I confused that annotation with something else I needed to change to a single /.

So it's working for now, but again, being very new to all this, can you or anyone else explain why having that slash there would remove the styling of the .jsp?


EDIT: PS - I just noticed this thread was moved from where I had posted. Apologies if that was the wrong spot, and thanks for the correction!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic