migue abre

Greenhorn
+ Follow
since Jun 26, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by migue abre

Rob Spoor wrote:I've done something like this but with data coming from other modules and even shared libraries, not the parent modules. The trick is where to put the resources. Anything you put in src/main/resources/public or src/main/resources/static will be available from the browser, with the actual path relative to these folders. So put something in one of these folders in the parent module, and your child modules should be able to get access to them. (The same thing holds for templates, in src/main/resources/templates.)

Now, if you don't want them to be accessible from the browser, just put them somewhere else under /src/main/resources. You can use Class and ClassLoader to get access to these resources, but also Spring (Boot)'s own resource loading.


Note that the above can only work if the child module has a runtime dependency on the parent module. That is often not the case though. You can introduce a new module with only this content instead.




You are the man!!! Thank you for your response that’s exactly what I needed it to do. I’m very very  appreciative .
1 year ago
I have a multi module application where I have a parent application and then several child applications. I would like to reference javacscript from the parent module, but I can't seem to get it correctly.
has someone else done this in the past. I can't seem to get the correct syntax to get this to work.  I can reference java classes from the parent module but I cant reference other files? Any ideas.

This is my project set up.  Any help would be most appreciative.




1 year ago

William Brogden wrote:I think Tomcat only looks at the first layer of directories under webapps for a WEB-INF directory so it does not think your learn/learn2 etc is a web application.

Bill


thank you thats what i suspected but i wanted to get a second opinion.
Miguel
8 years ago
Hello guys I was wondering if anyone can help me with this issue.
if i have a directory structure of webapps/learn/WEB-INF/
my messagebroker seems to be available.
however if i do something like
webapps/learn/learn2/learn3/WEB-INF/
everything brakes. all my jars are still in the WEB-INF/lib folder and i have a web.xml there as well but yet im not able to get the broker up and running. why is that?
has anyone else ever experienced this problem?
any tips would be appreciated.
Thanks
Miguel
8 years ago
I'm such an idiot your last post gave me the final clue. I'm placing my files under the ROOT directory when they should be placed under the webapps directory. this was my problem all along. gosh what an idiot I'm.
Thanks for your help.
Miguel
8 years ago

Bear Bibeault wrote:Apparently your Tomcat structure is messed up because somehow your app and the root app are mixed up. How did you set up the folder structure of your web app.


well i hope im answering this question correctly but basically my application is set up as follows
TomcatInstall/webapps/ROOT/Learn/WEB-INF/lib has all my jars
TomcatInstall/webapps/ROOT/Learn/.classpath
is this what you are asking me?
Miguel
8 years ago

Bear Bibeault wrote:Please read AvoidRedHerrings.

I said WEB-INF/lib not WEB-INF.




thanks for the article and i apologize i was not clear to begin with sometimes frustuation gets the best of me. Im sure you understand.
Anywho. i have the Jars in WEB-INF/lib already and im working with Tomcat 5.5. im not sure why the application is not working as it supposed to. the funny thing is that if i move the files from my
WEB-INF/lib to the ROOT/WEB-INF/lib the application works...? I'm just not sure why this could be?

thanks
Miguel
8 years ago

Bear Bibeault wrote:The jar files need to be placed in the WEB-INF/lib folder of the web app. Not web-inf. Case counts.


sorry i should have mentioned that i just didnt capitalize here. everything is onthe WEB-INF as you stated. Any other suggestions?
Miguel
8 years ago
hello guys im a noob to tomcat, and pretty new to java. I just deployed an application onto my linux server all done through eclipse IDE. however when i put all the files on the Tomcat it dosent see them in other words. i have to put all my jar files under the root of the tomcat install in order for my application to see them? i dont get it. ive been reading that every application needs to have its own web.xml and web-inf directory. wich my has. however the only way my application works is if i litterally put all my jar files in the root/web-inf folder? can someone give me a hint on what i might be doing wrong. why dosent the application default to webapps/learn/web-inf which is where mine is located. I would appreciate any help.
Thanks
Miguel
8 years ago