I was asked a question yesterday which stumped me about using images in you webpages for you project.
The correct way to do this, for a real website, would be to have them on a different webserver, not the application server. We, however, don't want to go to these lengths. We can add them I discovered, after a few minutes of fiddling with Netbeans, to the website relatively easily, only I couldn't find any documentation on this online--the topic was swamped by descriptions of uploading files and the html img tag--and the help built in to Netbeans is very cryptic.
This is what I did:
The correct way to do this, for a real website, would be to have them on a different webserver, not the application server. We, however, don't want to go to these lengths. We can add them I discovered, after a few minutes of fiddling with Netbeans, to the website relatively easily, only I couldn't find any documentation on this online--the topic was swamped by descriptions of uploading files and the html img tag--and the help built in to Netbeans is very cryptic.
This is what I did:
- Parallel to the NetbeansProjects directory I created a NetbeansProjectRecources directory (in My Documents).
- Inside that I created a directory with the same name as the project.
- Inside that I created the directory I wanted to add to the deployed website, images in this case but it could be any static content.
- Then, back in Netbeans, I right clicked on the project and selected Properties from the context menu.
- Selected the Packaging category.
- Clicked on (Add, I forget) Folder/Library and selected the directory I made in step 3.
- I then changed the second value, on the right--the mount point of the directory--and changed that to /images. The directory names and mount point names don't have to match but it would be less confusing for us if they do.
No comments:
Post a Comment