Relative Path and FileWriter
I have the following code and it works fine when running standalone. I have to add that entries.xml and my Java file are in the same package.
String filename = this.getClass().getResource(".").getPath() + "entries.xml";
FileWriter writer = new FileWriter(filename, false);But when I run this inside Tomcat, getResource(".) is returning me my tomcat path instead of where my Java class is located. How can I fix this to work in both places and use relative paths?
Thanks in advance.
Moving to another forum. I think this is an incorrec forum for this question.
Similar Messages
-
SWFLoader loded swf and relative path issue
Hi,
Before explaining the problem, let me describe the usecase.
I have dashboard flex application hosted on Host1.
I have another flex application which acts as plugin to dashboard and is hosted on Host2.
I am using proxy to load plugin into dashboard using SWFLoader. With proxy SWFLoader in dashboard thinks that the plugin is coming from same host.
For plugin to load I specify SWFLoader source something like - source="Proxy/Host2WebappDir/plugin.swf.
Everything is fine upto this point. plugin.swf get loads successfully without any issue.
Now the problem -
If plugin.swf made some request - the url path of that requrest is expected to be relative - i.e. if it make request say getIndianStates.xml, I am expecting the request should look for resource at "Proxy/Host2WebappDir/getIndianStates.xml". Instead it tries to look for getIndianStates.xml into dashboard hosting directory on Host1.
Can this issue be resolved without making any modification in source of plugin.swf.
Thanks in advance,
Prithveesingh Zankat.I don’t know if any way to fix this without changing the URL the plugin wants to load. Now if the plugin stores that URL in a publicly accessible variable, you might be able to access it from the main SWF and change it. But it would be better to have the plugin detect relative paths and make sure they are relative to the SWF. The SWFLoader component uses a LoaderUtil class to do that for SWFs it loads, but loads that don’t use SWFLoader need similar fix ups.
-
I have a question on paths and templates
I have a question on how I should structure my site
At my root directory on my server I have this set up.
index.html
/pages
page1.html (all of these were created from my own template)
page2.html
page3.html
and so on....
/webReadyGraphics
/css
/library
/templates
genericTemplate.dwt
Each folder has their own respective files in it.
The problem I'm bumping into is relative and absolute paths in my DW templates/assest. I will do my best to explain.
I've create a menu with text that links to various pages. An example would be a home button which always returns you to the index.html. I turned that home button into an asset. I've placed that asset into my genericTemplate.dwt. The link attached to the home button is a relative path and looks something like ../index.html.
I have used my genericTemplate to create all my pages, even index.html. So on my index page is my home button which tries to link to a parent directory ../index.html. I decided to use absolute paths instead which is great on my local machine but when I go to upload to my server won't this be a problem? As browsers will be looking for a local absolute path?
How should I structure my website? I've been thinking about putting all my pages at the root directory but that just gets mess looking.
I hope I explained that well. My understanding of web theory is a bit novice.
Thanks!
-DweininHow do I do that? The pages which have the asset (button) have different paths to get to the index.html... some paths would be ../index others would be ../../index.html
I don't know how to explain this. I have 1 button. that button is on 15 webpages. Those pages are located at various directories from within my website. So all their paths would be different but I only have 1 button. So how do I put a relative path in there?
I can put all the pages in 1 location so the button path would be the same. That's not a problem BUT! I also have that button on my index.html page which is at the root of my site.
All of my pages would be located at root/pages/______.html. The button would have a relative path of ../index.html
The index is located at root/index.html and that SAME button would have an incorrect path of ../index.html and return an error saying page not found.
I want to keep the button an asset since I will likely be changing it's destination in the future or may want it to link a different page. So I made the button an asset so that I when I do want to change it I only have to do it once and it updates across all my pages.
Does that make sense? Should I just put all my pages at the root? Is that normal to do? My root would start to look pretty mess with 15-20+ html pages.
-Drew -
Only Use Absolute Paths, Disable Relative Paths
Hi All,
I am trying to work out how to disable Relative Paths in
Dreamweaver 8. We are wanting to create some eBay templates in
dreamweaver. Once these are created we want to copy and paste the
code into the eBay description. However when using relative paths,
this breaks the page when it is uploaded to eBay. Obviously because
it is looking for ../../images/logo.gif etc.
What it saves as currently: src="../../images/logo.gif"
What I want it to save as: src="
http://mysitehere.com/images/logo.gif"
So how can I completely disable relative paths and have
Absolute Paths in its place.
Regards,
JoelYou can't.
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"Joel.Theodore" <[email protected]> wrote in
message
news:e5po0g$4ec$[email protected]..
> Hi All,
>
> I am trying to work out how to disable Relative Paths in
Dreamweaver 8.
> We
> are wanting to create some eBay templates in
dreamweaver. Once these are
> created we want to copy and paste the code into the eBay
description.
> However
> when using relative paths, this breaks the page when it
is uploaded to
> eBay.
> Obviously because it is looking for
../../images/logo.gif etc.
>
> What it saves as currently: src="../../images/logo.gif"
> What I want it to save as: src="<a target=_blank
> class=ftalternatingbarlinklarge
> href="
http://mysitehere.com/images/logo.gif"
>
> So">
http://mysitehere.com/images/logo.gif"
>
> So</a> how can I completely disable relative paths
and have Absolute Paths
> in
> its place.
>
> Regards,
>
> Joel
> -
I have a use case where I need to use different download directories with different firefox profiles.I need to use this profiles in multiple linux machines.
I need to have a relative path to my download directory with respect to the profile folder.
Ex: I have a selenium test which opens a website and downloads it to my machine.I want this downloaded file to go into some specific folder relative to this profile folder.How do I do this??That is not a practically empty xinitrc - that file only needs one line: exec WM. Other things are entirely optional, and some of them very useful, but I'd encourage you to stick with the simplest xinitrc that will do what you require.
Is slim involved? Probably. That is the source of many problems. But to start narrowing this down, I have 3 suggestions:
1) temporarily (at least) change your inittab to default to runlevel 3 ... actually, is it currently set to 5 or 3? if it is currently 3 that would explain why slim doesn't start.
2) at a tty in runlevel 3 use "xinit" instead of "startx". Startx is fine most of the time, but it is essentially just a complex wrapper for xinit. That complexity can often iadd useful functionality, but it *always* makes troubleshooting more difficult. So for now just use a vanilla 'xinit'.
3) remove dbus-launch from your exec line in xinitrc. This is done by console-kit so it is redundant and potentially problematic. Further BOTH of these are taken care of by slim, so I'd even suggest getting both a jump start on being ready for slim and simplifying troubleshooting by removing both of them. Just make that line "exec openbox-session"
Edit: adding one more:
4) temporarily switch out openbox-session for openbox. I suspect the reason feh's setting of the background is getting overridden is due to a script or setting in openbox's autostart settings - many of these are only invoked when "openbox-session" is called, while "openbox" starts *just* the window manager itself.
Last edited by Trilby (2012-10-03 17:30:36) -
Problem with include and relative path in jsp
Precompile jsp with wlappc in 9.2, I got the error "The include file was not found" when the jsp use <%@ include file="../includes/dataEntry/code_error.html" %>
This code used to work with 8.1. I notice that someone has report the same problem with 9.0 and you have patch for it. Is it fix in 9.2 or do I require a patch as well?
Thanks,
KhuemyWhen you precompile, can you say "Keepgenerated=TRUE". It might help you track
down the difference with the URL. You should only get a 404 error when the
resource is not found at runtime, which is independant of when you compile. The
difference should be in how the URL is compiled.
Chris
ali wrote:
> I am using WLS 6.0 SP1, when I use relative path in <jsp:forward> in my JSPs
> it forwards ok if I am using directly JSPs but if I am using pre-compiled
> JSPs (and have proper servlet-mappings
> in my web.xml), I get 404 error with the relative-path, if I change it to
> absolute path with pre-compiled JSPs it forwards ok , then.
> any ideas why this is so?
> thanks,
-
Problem with jsessionid and relative paths
I'm having an issue with jsessionid in a J2EE application running on an all Oracle platform (Oracle DB, 9ias, etc.). Most of the time sessions are tracked with cookies, but occasionally the jsessionid appears on the URL (on first login with a new browser window I think?).
Anyway, sometimes the session id is very large (100 chars +) and includes special characters, specifically a backslash. This is causing problems with relative paths in the page.
Is this normal behavior or is there a problem with my app server/JVM setup? Has anyone else seen this? Thanks for any advice.Hi Stefan,
The issue was logged as CR238704. You can either contact [email protected] or
just pass me your email Id and I'll send the patch to you.
-- Nagesh
<Stefan Krause> wrote in message news:[email protected]..
> The problem I have is that the application is very old and at the same
> time very big (so we're doing the transition step by step) and there are
> lots of variables (and even methods in JSP pages - no comment) shared
> between the JSP pages!
> So for us jsp:include isn't an option...
>
> Is there a way to report bugs when you've got only the free development
> license? -
XML data source and relative path
Hi,
I'm developing my reports in a Windows environment and deploying it on a Linux. My problem is, I cannot seem to specify a relative path for my XML datasource. Since, my deployement is in Linux, I cannot have the standard "C:\myreport\def.xml".
Is there a way to use a relative path? I've tried creating a environment variable but it gives me the following error.
ERR 63001: Invalid stream in the Data Definition URL file:///%reports/data.xml null
-JohnI guess you must be missing some "/" in the values youre passing. Remember that it's also case sensitive. Here's what I did in my report
The data definition has this value :
file:///&<P_XML_CFG_PATH>ReconReports.xsd
P_XML_CFG_PATH = //reports/dtd/
For the Datasource
file:///&<P_XML_PATH>&<P_XML_DATAFILE>
And the value would be something like
P_XML_PATH = /reports/data/xml/
P_XML_DATAFILE = <actual filename> -
Native package for Mac and relative path
Hi,
I done a small application with Javafx that start an Embedded Jetty. All works fine in Windows also with native package. Instead in Mac it works only before native packaging. Seems that the problem is how relative path are considered.
The tree of the content is this:
myfile.jar
webapp (folder)
libs (folder)
Look at this code:
String webAppDir = "webapp";
File f = new File(webAppDir);
log.debug("Path webapp folder: " + f.getAbsolutePath());
if (!f.exists())
throw new Exception("The folder " + f.getAbsolutePath() + " doesn't exist");
if (!f.canRead())
WebAppContext context = new WebAppContext();
context.setContextPath("/myapp");
context.setResourceBase("webapp");
context.setDescriptor("WEB-INF" + File.separator + "web.xml");
context.setSessionHandler(new SessionHandler(sessionManager));
throw new Exception("La cartella " + f.getAbsolutePath() + " non è leggibile");
The problem is that before the packaging in Mac the relative path is that where the main .jar is located an so the code works because the webapp folder is found. Instead after the bundle the path became /Users/MyUser/webapp and of course the folder is not found because it is bundled inside the file.app near the libs folder.
Someone can explain me if this behaviour is due to JavaFx packager and how I can solve the problem in a elegant way?
Thanks very muchSome good soul has any idea?
Thanks -
I have a website which has error catching in it and from time
to time I have this error come through when using cfinclude.
Could not find the included template
project56/images1/page1.html. Note: If you wish to use an absolute
template path (e.g. TEMPLATE="/mypath/index.cfm") with CFINCLUDE
then you must create a mapping for the path using the ColdFusion
Administrator. Using relative paths (e.g. TEMPLATE="index.cfm" or
TEMPLATE="../index.cfm") does not require the creation of any
special mappings. It is therefore recommended that you use relative
paths with CFINCLUDE whenever possible.
Why would this error occur for a few visiters and not for all
when browsing my website?
If I have to put some sort of mapping into CF Administrator
what should I put as a mapping and why should this help?
Thanks in advance for your help.
Simon.The only thing I can think of is are you sure the page the
'affected' users are clicking from are in a parent folder of the
'project56' folder? The error occurs when the CFINCLUDE is looking
in the wrong folder or when you try to include URL variables in the
include statement.
if you INCLUDE project56/images1/page1.html it will work, but
if you INCLUDE project56/images1/page1.html?user=123 then you get
an error because the INCLUDE looks for the actual text of what's
between the quotation marks...it will not pass variables.
I'd check the folder structure on where they are clicking
from. In your error page, just have the referring page
output. -
Rewrite URL in SMP and Relative Path
Hi,
some one have an example how to use Relative Path properties?
I have read this guide (Defining Back-End Connections - REST API Application Development - SAP Library) but is not very clear for me.
Thanks and kind Regards,
Elia.When you precompile, can you say "Keepgenerated=TRUE". It might help you track
down the difference with the URL. You should only get a 404 error when the
resource is not found at runtime, which is independant of when you compile. The
difference should be in how the URL is compiled.
Chris
ali wrote:
> I am using WLS 6.0 SP1, when I use relative path in <jsp:forward> in my JSPs
> it forwards ok if I am using directly JSPs but if I am using pre-compiled
> JSPs (and have proper servlet-mappings
> in my web.xml), I get 404 error with the relative-path, if I change it to
> absolute path with pre-compiled JSPs it forwards ok , then.
> any ideas why this is so?
> thanks,
-
Relationship of codebase and code (relative path)..
in tomcat installed directory, under ROOT directory, i have jsp folder and web-inf folder. all my jsp in /jsp/*.jsp and all my classes in /web-inf/classes/myservlets/*.class.
I am trying to include applets for java plug-in and
code like this
<jsp:plugin type="applet'
codebase="jsp"
code="..\web-inf\classes\myservlets\MyTestApplets.class"
width="475"
height="350">
this didn't work.
Any idea about relative path about codebase and code? By the way, I am working on 2000
Thanks.you can try to use absolute path begins with "http" in the codebase
-
Relative paths of servlets and JSPs
I am trying to deploy my application in Weblogic 6.0 sp2.
I have put my JSPs and servlets in a WAR file.
I have mapped one of the servlets to "GuiController" in the web.xml file.
I assume that this means if any part of my URL has "GuiController" this servlet
would be invoked.
In the JSP (which is in the same WAR file) I would like to specify this servlet
as the form action.
as follows :
<form name="test" method="get" action="GuiController">
I would like to give the relative path so that I don't have to hard code the web
app name. But this does not work.
It works if I specify :
<form name="test" method="get" action="/edcs/GuiController">
where edcs is my web app name
Any suggestions on how I can achieve this without hardcoding the web app name
Thanks
Pratima
You have to deploy the web application as the default web application for
the server. The console is broken in this regard so you have to edit the
config.xml by hand.
Peace,
Cameron Purdy
Tangosol Inc.
<< Tangosol Server: How Weblogic applications are customized >>
<< Download now from http://www.tangosol.com/download.jsp >>
"Pratima Nambiar" <[email protected]> wrote in message
news:[email protected]...
>
> I am trying to deploy my application in Weblogic 6.0 sp2.
> I have put my JSPs and servlets in a WAR file.
> I have mapped one of the servlets to "GuiController" in the web.xml file.
> I assume that this means if any part of my URL has "GuiController" this
servlet
> would be invoked.
> In the JSP (which is in the same WAR file) I would like to specify this
servlet
> as the form action.
> as follows :
> <form name="test" method="get" action="GuiController">
>
> I would like to give the relative path so that I don't have to hard code
the web
> app name. But this does not work.
> It works if I specify :
>
> <form name="test" method="get" action="/edcs/GuiController">
> where edcs is my web app name
>
> Any suggestions on how I can achieve this without hardcoding the web app
name
> ?
>
> Thanks
> Pratima
>
>
>
-
Evaluation Paths and Reports relating om
Hi,
How can we create external object types in om.
How can we create the Evaluation Paths and what is relevance of table T7771 and T 777E.
what are the reports specific to Om .External objects we just need to Assign
Ex-Cost Centre and Holder of the psotion
Cost Centre we assign
and hodler of the position will get when we hire an employe
regarding Evaluation path Check the tcode PPSC
and give the Evaluation path which u want to see by assigning the various paths between different objects
RHXEXI00 --> Existing Organizational Units
RHXSTR01--> Organizational Structure with Positions
RHXSTR02 --> Organizational Structure with Persons
RHXEXI02 --> Existing Jobs
RHXEXI03 --> Existing Positions
Check the reports u can go to SAP East Acess and OM reports to view std reprots
Edited by: Sikindar on Feb 18, 2009 1:22 PM -
Relative paths not used in the same way for flv and mp3
When I load an mp3 using the
Sound component, with the relative path "medias/test.mp3",
it works.
When I try to load a flv using the
VideoDisplay component, with the relative path
"medias/test.flv", it doesn't work!
VideoDisplay seems to build the path to the flv
from the directory where the .swf is, not from where the
webpage is...
Webpage is : /blabla/index.html
Swf path is: /blabla/swf/main.swf
Medias path: /blabla/medias/...
Is there a way to tell the VideoDisplay component to load a
relative path starting at the level where the webpage is?
Thanks in advance!"[email protected]" <[email protected]>
wrote in message
news:gdilgt$qku$[email protected]..
> When I load an mp3 using the
Sound component, with the relative
> path
> "medias/test.mp3", it works.
>
> When I try to load a flv using the
VideoDisplay component, with the
> relative path "medias/test.flv", it doesn't work!
>
> VideoDisplay seems to build the path to the flv
from the directory
> where
> the .swf is, not from where the webpage is...
>
> Webpage is : /blabla/index.html
> Swf path is: /blabla/swf/main.swf
> Medias path: /blabla/medias/...
>
> Is there a way to tell the VideoDisplay component to
load a relative path
> starting at the level where the webpage is?
Relative paths are_always_ relative to the swf, regardless of
the media
type. Note that media is actually _already_ plural ;-).
So try:
"./medias/test.flv"
or possibly
"../medias/test.flv"
Maybe you are looking for
-
Photo sync: Is there a limit?
I've been trying to sync photos from a folder on my Windows computer for about two hours now. I've updated both the iPad and the iTunes to their latest version. I have 339 photos in this album, and only about 50-100 of them sync. I can't get all 339.
-
INSERT Loading Type not working correctly?
Hi, I'm using ver. 9.2.0.2.8 for the owb client, and ver. 9.2.0.2 for the repository. I'm currently encountering this problem when using the INSERT loading type for loading data into one of my staging tables. It's a simple simple mapping really: I ha
-
Just Bought A Touch, But Newer Version Out Soon?
I just picked up an ipod touch a couple of days ago. My question is what happens to me if the new version of the touch comes out in September/October? Obviously newer tech & features would make me want the new one instead. Since I just bought it, is
-
F4 help in table control. - Urgent Please
Hi all, Iam using F4 help in table control. when the user selects the data in F4 values 4 more fields that are displayed in the F4 has to be updated in the table control What function modules should I use to capture the f4 values and keep in the curr
-
Finder still loading slow after clean install
I wiped my disks and did a clean install of Mavericks on my mac pro and mbp. Finder is still very slow. I copied my current HDs to othe drives, the reased my main drives, loaded the OS and did a migrate. I thought Maveriks was supposed to run better