Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > J2EE
|
J2EE General J2EE (Java 2 Enterprise Edition) discussions. Questions not specific to EE will be redirected elsewhere.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the J2EE section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 25th, 2009, 03:43 PM
Registered User
 
Join Date: Jan 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to set context in web application [PLEASE HELP]

hi, I'm new in J2EE
I develop a web app
in my application I create a folder(in root) "Files" and put some file such as style.css, engine.js and some images to
so I can not and don't know how I can access to them
I want access to my images like this "localhost:1313/myPro/Files/1.jpeg" but I cant and web server return 404 Error
I use JDK6 and Apache Tomcat 6 for web server
so please how can allow access to load files from Files folder?
and also I want load something in my Servlet and JavaBeans too
please help me how to configure my Project???
 
Old January 27th, 2009, 12:41 AM
jomet
Guest
 
Posts: n/a
Default

if u want access to image in code. use <img> tag
like
<img src="Files/1.jpeg">
 
Old January 27th, 2009, 03:30 AM
Registered User
 
Join Date: Jan 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default thanks, and one left

many thanks Jomet
Alright i understood my problem about images, css and ...
I should put them in web directory, now i don't have any problem to load them in jsp and also set include and exclude for files
alright
now I want load one of them (e.g. xmlns.xml) from root/web/files.xmlns.xml into a JavaBean or a java class?
how i can find the path of xmlns.xml?
 
Old January 27th, 2009, 03:53 AM
jomet
Guest
 
Posts: n/a
Default

try with
getServletContext().getRealPath()





Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to set context in web.xml or context.xml. dchicks Apache Tomcat 1 March 7th, 2008 07:59 AM
Application Context in C#.net dineshpdn Visual Studio 2005 0 October 10th, 2007 06:01 AM
A Chat Application using Context and Sessions kotaiah J2EE 0 October 10th, 2006 09:56 PM
How to create context help in web application? Alexds ASP.NET 2.0 Basics 1 February 1st, 2006 06:23 PM
set up asp.net web application-dev on remote serve ak VS.NET 2002/2003 1 March 5th, 2004 01:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.