Where to place custom web.xml in Alfresco SDK 3.1 - alfresco

I need to customize the web.xml and have it inside my custom jar. I have tried placing the web.xml in path "/project/src/main/resources/META-INF/resources/WEB-INF/web.xml". But after deploying the jar, changes are not reflected.
Sample changes: I tried changing the session timeout in the custom web.xml.
Alfresco version 5.2.5
sdk : 3.1
I doubt that am placing the xml in wrong path. Can someone please help me figure out what am doing wrong?
Thanks in advance!!!!!

Related

when i publish asp.net core 3.1 css and boostrap code not worikng

when i publish my project to host the css and boostrap codes not working
in local host is working but in host not
Error
css and js links
Usually when we encounter a 404 error, it is because the resource is not found.
Troubleshooting Steps
1. Follow the steps like my picture to get the error path.
2. Try to find the file in your root path of webapp. If you can find it, try to access it by broswer.
3. If not, try to cpoy the file from project, and paste it under wwwroot path. After deployed, the structure of folder should like below.
4. If your file exist, you can access it. So you just need to modify your path in your code.
For more details, you can refer this post.
How to use Bootstrap 4 in ASP.NET Core

How to disable the default Servlet in Karaf?

I am new to Karaf and I am trying to get the default servlet to stop listening:
I managed to stop all the other things which I do not need by stopping their respective bundles, but for the default servlet I am unable to figure out how to stop it.
Currently it replys:
No services have been found.
Question: where can I disable the default servlet for the root dir?
Edit: We would like to have whiteboard serve an angular site and its ressources dirctly from /. Currenlty ResourceServlet default tries to find javascript files in its bundle ressoures (not a chance...). How do we get the default Servlet to stop bothering us? :)
It is not possible to disable the default servlet. Instead a new Servlet has to be registered under the / path. This servlet will have precedence.

CSS is not linking up and not working with Spring Boot application

This is the the picture of my project.
I have my css file in static/css folder and I am trying to link it with my index.jsp page but it's not working.
NB : Hard refresh, cache clear everything is done and I have tried more than 10 times. :( is there any other way to link up css with spring boot application?
In the Spring-boot documentation you can read where Spring-boot reads static resources by default.
By default Spring Boot will serve static content from a directory
called /static (or /public or /resources or /META-INF/resources) in
the classpath or from the root of the ServletContext. It uses the
ResourceHttpRequestHandler from Spring MVC so you can modify that
behavior by adding your own WebMvcConfigurerAdapter and overriding the
addResourceHandlers method.
If you change the location of your static files to the default one you should be able to reach them by /css/style.css
P.S. here you can find a simple good structured example.
For me now I just put my CSS, JS, images in src/main/resources/static folder and the link is like :
/css/style.css or /js/custom.js
is working fine for spring boot application.
The solution to your problem is very simple, just add to your application.properties file (your configuration file) the next 2 lines of code:
spring.resources.chain.strategy.content.enabled=true
spring.resources.chain.strategy.content.paths=/**
this will bust the cache in your browser, and when you'll make changes regarding to static content (like: css files, js files, html files), it will take place.
Spring Boot CSS Showing up blank / not loading after trying everything
Good Luck.

How to handle path on azure for XmlDocumentationProvider

I am using azure for deployment of my new Web API's, I am new with deployment on IIS and azure.
I have added my Web API's on azure as web application, and it's working fine, till I added documentation for each API's functions. After adding description I uncomment line below from HelpPageConfig.cs.
config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath("~/App_Data/XmlDocument.xml")));
It's working finr locally, and I am able to see all descriptions, but when I published it on azure, I am getting error saying,
Could not find a part of the path 'D:\home\site\wwwroot\App_Data\XmlDocument.xml'.
site url : http://mejodo.azurewebsites.net/
Do I need to change path ?
File is already created in my system on D:\home\site\wwwroot\App_Data directory.
What changes I need to do to make it work ?
I had the same issue. For me the file was generated. Please follow the below steps.
Click on show all files in solution explorer.
Check whether you have a file in App_Data folder
If you have the file, right click and include the same in your project.
Now build and publish to Azure.
I hope this will work. Thanks
In my case XmlDocument.xml had to be added in Visual Studio to the App_Data folder within the solution using 'add existing item'.
Just add to your project new folder "App_Data" with XmlDocument.xml and publish
When you say that you have Web API's on azure as web application, do you mean that they are applications under the site ? If yes, then I think you are missing the application name in the path to the XML file.
Try going to mejodo.scm.azurewebsites.net > debug console > powershell to see the exact folder structure....
You must verify that the line in the HelpPageConfig.cs file in the Area>HelpPage>App_Start folder.
that is in the register method, this line is
config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath("~/App_Data/XmlDocument.xml")));
this uncommented
then you must verify that in the project configuration, in the build XML documentation file, this is the same path as the above mentioned line.
When you publish the xml file goes in the bin folder, so change 'D:\home\site\wwwroot\App_Data\XmlDocument.xml'.
to
'D:\home\site\wwwroot\bin\XmlDocument.xml'.
and it should work.

Relative path to log4j.xml in Spring MVC Project using Tomcat

Im trying to configure log4j with a relative path to put the .log-Files to. Files are correctly getting generated when I specify a absolute path but are not generated AT ALL when i use something else. I tried the following
{CATALINA_HOME}
./filepath
${webapp.root} And setting the listeners and all that stuff, as described here HowTo configure....
I am working on a Mac with the Spring Source Tools and the project I created with the Spring Source Tools put the log4j.xml into src/main/resources and NOT into the WEB-INF folder as stated in most of the tutorials. I tried variant 3 (webapp.root...) and it actually finds the log4j.xml where I declare it (I put it into WEB-INF and it works) but still no logging to a file when I use ${webapp.root}.
How do you solve that problem? This is horrible, I cant push this stuff to our repo with an absolute path to my user-dir??
Thank you in advance!!
In appenders in src/main/resources/log4j.xml
we use
<param name="file" value="${catalina.home}/logs/catalina.out"/>
Also check permissions? - hope that helps

Resources