• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using External style sheet to include background image in JSP

 
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am trying to include background image in my JSP using external stylesheet.But when I run my tomcat server, the image is not being displayed. I use Spring MVC framework and eclipse IDE. This is my jsp code fragment



This is what I have in my est.css


My image are in the eclipse folder : com/myorg/projectname/web/image
My stylesheet is in the eclipse folder : com/myorg/projectname/web/styles

Thanks in advance.
Ms.Ranjan

 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where is the image file located in the WAR file? Where is the stylesheet located in the WAR file?
 
Romeo Ranjan
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am new to web application. I am sorry if I am not answering your question but willing to learn..

As far as I know the WAR file is the used for the deployment of the web application. I use eclipse to run this dynamic project that I created. I didnt create any WAR file as such. Does it require to create WAR file to run the application in eclipse?? or am I missing something basic I am supposed to know??
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since you are new to web applications, my recommendation is to use a text editor and build your web application by hand. There are resources that will guide you through this, such as http://www.moreservlets.com/. That is a fairly old resource but it will teach you the basics, especially how a WAR file is laid out and how the parts of it work together. And how to deploy it to a servlet container.

The problem with relying on Eclipse when you are trying out a new Java technology is that when Eclipse screws up (and it does that fairly regularly), it you do not have the basic understanding about the technology, then you will be completely lost. Personally, I use Eclipse as a glorified text editor and use other mechanisms (Maven, Ant) to do my builds and deployment of web applications.
 
Romeo Ranjan
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Thanks for your suggestions and your views. But I have a question this is how generally web application are being built, not many people use eclipse to develop dynamic webapplication? I am just weighing my option to learn maven and ant and start to build.

In my case the application will have to connect to Oracle database in future, in which case I have to setup the drivers if I start to do it by hand. But In eclipse just need to add jar files, which will save me from configuring the drivers and connecting to oracle. I am also using spring framework for this application.

Any other solution??
 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's a hint: the code you generate shouldn't have any references to Eclipse in it. If you think about it for a few seconds, you should realize the the application is going to be run on a different computer where Eclipse isn't even installed. So start by getting your hard-coded Eclipse references out of there.
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes lots of people use Eclipse (or NetBeans) to develop their web applications. But those people also understand how WAR files are laid out and how WAR files are deployed to the application servers of their choice. If you are unaware of these details then you will spent all of your time fighting Eclipse rather than getting anything done.

Also, you should learn both Ant and Maven. Depending on Eclipse to do your builds and deployment is not recommended. Yes you can use Eclipse to debug your app, but the "official" build should be done using Ant or Maven. Heck, even when I used Visual Studio to develop and debug C++ applications I still relied on make files for the official build. That is the only sane way to do things when there are multiple developers on a project andwhen you want to avoid the "gee, it works just fine on my machine" bug.
 
Romeo Ranjan
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Peter Johnson wrote:Where is the image file located in the WAR file? Where is the stylesheet located in the WAR file?



Hi,

I am using WAR file to deploy the application.
 
Romeo Ranjan
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Peter and Paul
reply
    Bookmark Topic Watch Topic
  • New Topic