GWT Upload file - java

I use this http://code.google.com/p/gwtupload/ to upload files to my app. But I have problem when I want save file out of my app in other folder in Tomcat. (for example my app's name is MyApp but I want save files in folder Data on the same Tomcat server). Can someone know why I can't do that ?

Is it what you are looking for ??
Tomcat home directory or Catalina directory is stored at the Java System Property environment. If the Java web application is deployed into Tomcat web server, we can get the Tomcat directory with the following command
System.getProperty("catalina.base");

Related

uploading files to the folder located outside tomcat server

I am developing an application in android which communicates with tomcat to make use of rest api.
I also need to donwload some files to the android application (client) from server. These files are stored in a folder located outside tomcat directory on the server.To dowload the files I'm configuring my tomcat simply using :
<Context docBase="C:\Images" path="/Images" />
I don't think I can make use of servlets to upload download files since my front-end is the android application. Please let me know if anyone has any suggestions.

Deployment Options Play Framework v1.4

I am trying to deploy a web application to Tomcat v.6.0. I know I need to be able to deploy a single file--the WAR file. The problem is, the command that the Play documentation instructs to run, produces a directory, and not a single file.
The command:
play war myapp -o myapp.war
produces a directory called myapp.war with another directory WEB-INF which contains the directories of application, classes, framework, lib, etc.,
I am trying to deploy this to my private JVM instance of my web server. I have tried compressing the myapp.war directory, uploading that, unpacking it, etc,. but that does not do anything. I get a blank screen when I check my site.
I've heard I can run Play as a stand alone server like I do locally but I have Java and Play installed. My remote host may likely not have this installed on whatever instance is serving up pages from the public_html directory. If I were to put my application directly into the public_html directory, how can I terminal into and issue the "Play run" command to get it started?
This is the first time I've deployed a web application to a web server.
With this command Play produces an exploded .war file, so you don't have to zip/unzip it.
Check what Tomcat documentation says here about the deployment of an exploded .war files.
Also, a blank screen may be the sign of some problems with your application startup, so you have to check Tomcat logfiles like catalina.out or localhost.log to see if there are some exceptions.

Uploading java website made in struts2 using war file

I have made a website in java and struts2 ,now I want to host it live but I am unable to host it. I tried by uploading WAR file and extracting it in cpanel but still not working. I have account on hostbudget.com and I have bought their server.
Can anyone help me how can I upload my Java project since its my first time, I took suggestions from many friends of mine but none of them has clear idea of this.
cpanel doesn't support java by default. It only supports PHP by default.
See this link. How to deploy java web application (WAR) through my GoDaddy's cPanel?
WHM cpanel https://documentation.cpanel.net/display/EA/Introduction+to+Tomcat
Steps to deploy java web application in cpanel:
Select your public_html directory.
Click Upload.
Click Choose File
Browse your WAR file.
Change the file extension from .war to .zip
Select the .zip file and click Extract.
Before that you must install servlets in WHM cpanel. If you need any help to install then the server vendors will guide you.
Some of them told me that enter the following text in .htaccess file inside your public_html directory
SetHandler jakarta-servlet
SetEnv JK_WORKER_NAME ajp13
It's not needed. Since without this my app working.

How to start tomcat server outside netbeans IDE

I have created an application in Java EE, I have learned how to deploy it in the tomcat server using the manager app or by copying the war file to the webapps folder. Now I can start the tomcat server only from the Netbeans IDE.
I want to know how to start the apache tomcat server without using the IDE and run my web application from the war file deployed. If I'm headed in the wrong direction please correct me. I'm asking this to gain knowledge of how to deploy the .war file in another server system without using the IDE only the tomcat server.
The shell scripts located in "CATALINA_HOME/bin" are the most bare-bones way of getting Tomcat up and running. The two scripts capable of starting Tomcat in this directory are named "catalina" and "startup", with extensions that vary by platform.
In your tomcat installation directory, there would be a startup.bat/sh file which will start the server for you. Moreover you can see the conf folder as well if you want to change any configurations. Whatever war you copy to the webapps folder will be automatically deployed

how to host java website which is developed in red hat 5 using notepad and not using Eclipse or any IDE

During my college time i have developed a java website in red hat 5 ,
On tomcat server with mysql as DB.
I havent use any IDE (Eclipse,NetBeans etc) for it.
I have developed it using notepad.
I have no clue of deploying any java website.
I tried importing my java website in the eclipse but it was giving lots of errors.
If anyone can help me that will be great !!
Please get my project folder on below link:
https://jumpshare.com/b/ppGP9oibkrTvVLtw9YxW
I had this directory in my Tomcat folder.
Please help.
If you just want to run the web app on your local server :
Install Tomacat.
Copy the ty154 folder to the web app folder
Start tomcat. If your code was working, then it will show up at something like the following url
http://localhost:8080/ty154/
If you just want to run the web app on a tomcat hosted server by uploading your web app folder :
Copy the ty154 folder to the web app folder.
Assuming that your hosting url is
http://neer.hosting.com/
then goto the following url
http://neer.hosting.com/ty154/
For some of the hostings you might have to restart your tomcat server.
Deploying using war files :
Also some of the hostings have some special ways to deploy. They might ask you to upload your WAR file. Here are the commands for generating the WAR file.
cd /to/your/folder/location
jar -cvf my_web_app.war *
Mostly uploading the WAR file to the web app folder on the remote hosting should suffice. Only thing is that you might have to restart your tomcat server.
NOTE : Some of the free hosting have their own steps for deployment. Refer to their deployment help documents. It will help you better.

Categories