Questions tagged [getresource]

283 questions
0
votes
2 answers

How do I get a resource using Class, ClassLoader, and URL

I am writing a simple JSF application and am trying to get a resource (database.properties file) using Class, ClassLoader, and URL that is not working. url is null and I don't know why. I have done a lot of research but without success. Code: Class…
mitchj
  • 623
  • 4
  • 9
  • 16
0
votes
1 answer

Adding string resource to detail part of Master/Detail template

I can't seem to find a good answer here or elsewhere for this, so here goes. I created a Master/Detail android application, so there are two packages is…
ahetman
  • 1,274
  • 11
  • 17
0
votes
3 answers

getPackageName() returns null

I have a method in my android app that returns the drawable id according to it's name, this method works so well in the normal cases, but when running it from a separate thread it returns Null, even when running this thread on the UIThread. This…
MRefaat
  • 515
  • 2
  • 8
  • 22
0
votes
4 answers

GetResource shows nothing

I have a structure like this: http://gyazo.com/3deb54c430da3b3bff50c29f6f6e3947 and a code shown below: [[$std_head]] [[getResourceField]] [[!getResources? &showHidden=`1` &parents=`5` &includeContent=`1` &includeTVs=`1` &processTVs=`1`…
0
votes
1 answer

Modx getResources: display all resources' ids

I need to display all resources' ids as page content, so I used: [[!getResources? &parents=`0` &tpl=`myTpl`]] and in myTpl chunk: [[*id]], But it only displays the current resource's id five times like this: 63, 63, 63, 63, 63, 5 is the number of…
Sylvain Le Bihan
  • 163
  • 1
  • 2
  • 13
0
votes
1 answer

No Player Exception With Jar

I was trying to use MP3s instead of wavs and it works fine in NetBeans, but when I build it and try to run the jar there's no sound and I get the NoPlayerException. background = ImageIO.read(getClass().getResourceAsStream("/background1.png")); …
user2680420
0
votes
1 answer

Trying to read a resource file from within a jar

I have read every single question and answer regarding this topic and I have tried a multitude of the suggested solutions, none of which are working, currently I am trying to use the URL resource method but url always returns null. Here is my…
JoGotta
  • 215
  • 2
  • 13
0
votes
2 answers

Does ServletContext.getRealPath() work with web fragments?

I use web fragments (servlet 3 spec) and thus can load e.g. META-INF/resources/access.xml file which is in a library in /WEB-INF/lib/ of my WAR via ServletContext.getResourceAsStream("access.xml"). Doing the same with…
Ginkgochris
  • 455
  • 4
  • 25
0
votes
1 answer

getResource not working

im trying to load a image from src folder the file: /src/Imagens/user_login.png but the getResource doesnt work :( i tryed to solve, but look the images First Try: Second Try, removing the getClass for the Class real name: Third Try, lets add a…
user2582318
  • 1,607
  • 5
  • 29
  • 47
0
votes
1 answer

Make a png in a jar file android

I'm trying to use a png file in my jar using getClass().getResourceAsStream("mypngfile.png") I tried many things found on the internet but nothing helped. I think the issue is that the png is not included in my jar. I'm using a full android build…
Ravit D
  • 907
  • 9
  • 27
0
votes
1 answer

Multi-Language Alert From String Resources

I have an alert. The code works. I have multiple language folders for strings. res/values/strings.xml & res/values-es/strings.xml etc. This works fine for the UI but the alert title, button titles & alert msg, I would like in other languages…
0
votes
2 answers

Adding .txt file as a resource Java

I have a .txt file and a image in a file called res. I added in the file to my path as well. I did the code bellow and it works in my Eclipse IDE just fine. When exporting a jar and running it, it does nothing. Running the jar with cmd says the…
SolidCloudinc
  • 329
  • 10
  • 27
0
votes
1 answer

Loading a file (externally)

Got a little problem loading a file! (Not a image just really a file like .txt and stuff) It loads fine in Netbeans with File myfile = new File("a/b/myfile.abc"); The problem is the compiled jar gets a exception and doesn't find the file. I…
Slashking
  • 1
  • 4
0
votes
2 answers

ModX getResources - Chunks in the tpl are displaying parent's content

I have this getResourcesCall [[!getResources? &tpl=GRTpl&includeContent=1&includeTVs=1&parents=[[*id]]]] In GRTpl I am including [[+content]] tags, but they only display the parent's content, not the content of the children. What gives!? UPDATE: I…
symlink
  • 11,984
  • 7
  • 29
  • 50
0
votes
4 answers

ModX getResources displays child resources as well as parent level resources

I have getResources call: [[!getResources? &parents=`[[*id]]` &limit=`15` &tpl=`contentsectiontpl` &sortdir=`ASC` &sortby=`menuindex` &includeContent=`1`]] In a parent resource. I wish to only display the child resources of this parent, but the…