MyEclipse Forums
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
rss245b
Post subject: Navigation - Path Information Sought  PostPosted: Jun 29, 2012 - 07:29 AM
Registered Member
Registered Member


Joined: May 03, 2010
Posts: 45

I recently tried to include an applicationconext.xml file located in the src folder
but have no idea how to specify the include for that folder.
I have been able to place such an applicationcontext.xml file in the webroot folder, one of the default folders by using relative path. e.g relative to the /webroot/WEB-INF where web.xml
is loaded from.
so webroot folder relative to WEB-INF folder is :
<import resource="../applicationcontext.xml'/>
So how would I specify the path either relative to or absolute for the src folderfor example???

This should be simple but it is not. It would really help to better understand the path settings across project folders.
 
 View user's profile Send private message  
Reply with quote Back to top
support-swapna
Post subject:   PostPosted: Jun 29, 2012 - 10:10 AM



Joined: Nov 11, 2010
Posts: 2488

rss245b,

Relative paths are relative to the current working directory, while absolute paths are relative to the root of the filesystem. In this case you will have to specify it as relative path.

If you are looking for a more detailed insight, then I suggest you cross post to development related forums for a better understanding on the workings.

Hope it helps.

_________________
Swapna
MyEclipse Support
 
 View user's profile Send private message  
Reply with quote Back to top
rss245b
Post subject: Navigation - Path Information Sought  PostPosted: Jul 02, 2012 - 04:18 PM
Registered Member
Registered Member


Joined: May 03, 2010
Posts: 45

I guess I was expecting information based on the defaults in place perhaps as a formula of
<Path to workspace>\ProjectName\WebRoot would be set up as absolute(within war file path) "/application.xml" assuming the Context Root folder is the key to all of this Assuming my Context Root is /MyProject1 and assuming the standard default setup on MyEclipse what folder does this context root point to? /src? no /MyProject1 ? no
So where does this apply? Give me a standard path assuming the Context Root mentioned and how would I describe absolute path given standard configuration
to the classes folder where message.properties bundle files should go?
This is the kind of detailed information I am seeking to better understand the absolute paths set up by a default configured MyEclipse web project
the relative path "../application.xml" is the WebRoot folder meaning
everything starts from WEB-INF folder but what is the absolute path to the WEB-INF folder then?
As this is not the standard path setup for Eclipse proper how might the file tree or
Project path configuration in standard Jee Eclipse or Eclipse be realized?
 
 View user's profile Send private message  
Reply with quote Back to top
support-tony
Post subject:   PostPosted: Jul 03, 2012 - 06:14 AM



Joined: Mar 09, 2011
Posts: 915

Rob,

Eclipse, or MyEclipse, doesn't determine the output paths, though, obviously, you can define the output path and context root folder for a web application. If you right-click on the project and select Properties, then MyEclipse->Web, you will see the Web-root folder (where MyEclipse expects to find the application binaries and resources to deploy to the web server) and the Web Context-root (used in the URL to address the application). In the Java Build Path page of the properties, you will see source folders defined and a default output folder (individual source folders may also override this default, though that's unusual). The output folder defines where class files will be put and where resource files will be copied. Your application.xml file (did you mean applicationContext.xml?) that is in the src folder, will be copied to the output folder (by default, this is WebRoot/WEB-INF/classes) so that it will be on the application's java classpath at runtime, after deployment. Every time you change a resource, the new version will be copied to the output folder.

Almost all of this is standard web development behavior, so it might be a good idea to read up on Web development, if you are not too familiar with it. MyEclipse simply provides the tools to make Web development easier and has some useful defaults when defining new Web projects. MyEclipse doesn't dictate any particular application structure and will use your definitions (which are often defaulted).

I hope this helps.

_________________
Tony
MyEclipse Support
 
 View user's profile Send private message  
Reply with quote Back to top
rss245b
Post subject: Navigation - Path Information Sought  PostPosted: Jul 03, 2012 - 08:24 PM
Registered Member
Registered Member


Joined: May 03, 2010
Posts: 45

What you just wrote helps a lot!
I now have a better idea where to place the properties files - Before I was keeping them
in WEB-INF folder where I should have kept them in the src folder as you suggest now the
question remains so my import tag should indicate
<import resource "classes/application.xml" /> or
<import resource "./classes/application.xml" /> should work in the Dispatcher-servlet.xml
file if I place the application.xml file in the src folder???
 
 View user's profile Send private message  
Reply with quote Back to top
support-tony
Post subject:   PostPosted: Jul 04, 2012 - 05:59 AM



Joined: Mar 09, 2011
Posts: 915

Rob,

We try to help, even with questions that are not directly related to MyEclipse functionality, if they don't involve much investigation and arise out of using MyEclipse, but we are not a general web development support site. I suggest you try such sites for general development questions; there are many of them.

In this case, I suggest trying a few different paths to see which works. I doubt that the "classes" directory should be part of the path, though.

_________________
Tony
MyEclipse Support
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits