can't see website after deploying a .war file to tomcat - java

I have created a java web application and created the file thymeleaf.war to deploy it on a tomcat server.
I access the tomcat manager using www.lux-systems.com/manager/html and have uploaded the thymeleaf.war file on this page.
Now i can see /thymeleaf in the application list, but when i click on that link (www.lux-systems.com/thymeleaf) I only see the directory listing instead of the web-page I want to see.
The problem is that I can't find the url to the working web page, and I am wondering why www.lux-systems.com/thymeleaf is only showing the directory listing.

Related

Downloading file using Tomcat

I am trying to do a little project where I download a file through the browser. I want to use Tomcat for that.
I installed and ran Tomcat, on addresss http://localhost:8080/ I have main Tomcat site. I placed file test.txt into webapps/test/ and I am trying to enter http://localhost:8080/test/test.txt, but it does not work. All I see is Error 404, requested resource is not available. What do I I need to do? Create some application not only directory in webapps? Or should I set some mapping from URL to file?

Tomcat Web Application Manager Not Listing Deployed App

I uploaded myapp.war file to server using Tomcat Web Application Manager
It upload myapp.war file but does not list in List of application.
myapp.war file and myapp (unzipped folder) is inside wepapps folder but also not listed in Application list. It only shows the default applications only.
Then i tried to upload again the same file and got error file already exists.
Why is it not listing the app though it is deployed?
Had the same issue. Even though tomcat manager says app is deployed successfully, you might be able to find the relevant issues in the catalina log.
<tomcat_home>/logs/catalina.xxxx-xx-xx.log

Upload WAR file to an FTP server

I've just finished a web project, working with Struts2, and now I want to add this project to my FTP site. The site runs smoothly on Tomcat 8, but I am not sure how to deploy it to an actual site.
How do I add this .WAR file that has .jsp and .xml files to a website? I've tried to just put it in a directory and launch it with fileZilla, and it doesn't work.
What should I do to launch my Struts2 project to my FTP site?
In FileZilla put your user name and password.
In left side will show your machine file
On right side put path of your webapp folder, It will come in mail when you buy any server from hosting providers or ask them.
Upload your .WAR file in webapp folder.
Restart Tomcat.
I assume you need to deploy it again on your FTP site. You need to deploy it into your webapps folder of your server. You may look at this link. This might help you :)

Tomcat 404 for a folder in webapps

I have a folder called attachments in my webapps folder in my Apache Tomcat directory, in which I need to save some files and images. When I'm giving the local path i.e. in C:/ the files needed are being saved in the correct location.
However I need to load these images from the server at runtime so I'm trying to access the image by the localhost url /attachments/img.png. The image is not being found (404 error).
I tried opening Tomcat's manager to see if attachments is listed. It is there however when I click it a 404 error is being thrown too. Other deployed web applications are being found.
What could be the cause of this?
You cannot just create a folder in $CATALINA_HOME/webapps like this and access it from web browser.
webapps folder is supposed to be home for all web applications with proper J2EE web app like directory structure e.g. WEB-INF/web.xml, WEB-INF/classes, WEB-INF/lib, META-INF etc.
Read more about Web Application Directory Stricture

new File not found in Webcontent. Need to refresh

Hello i have a java backend running on tomcat. java creates a .txt File that is saved locally in the Webcontent Folder. But the file is not found on the client side, altought it exists on the Webserver. After a refresh of my java workspace the file is found. Is there a way to tell tomcat to refresh / redeploy using java?
greetings!
Tomcat does not see your WebContents folder, but a copy create by the Tomcat server connector. Refreshing updates the copy.
What generates the .txt file? A separate program or code embedded in your web application?
There are a number of cases where the app would have to generate the file to be immediately available to the browser. For example, an image upload window. When the server creates the file from within WTP, it will have to also create the file at the published location where Tomcat is expected to pick it up. Open the server properties, tomcat arguments, catalina root parameter to find out where this location is. When the application is deployed this functionality will need to be disabled, of course.

Categories

Resources