What are the steps to upload a java web application - java

After a lot of work i manage to finish a java web aplication with netbeans using primefaces/glassfish server (it is a e-shop that we developed for a school project). I use xampp (mySql) in order to fiddle around with a database that i use in the web app.
My problem is that i have no idea on how to upload this to a server. What am i supposed to install on it ?, i dont even know what os to use :/ . Im really bad at the "internet part" of this project and since this was my last school year i can not reach for my professor to ask him for help.
I know my question is vague but please help me to finish this project because it would help me a lot to find a job in the future.
I should also mention that i use a mysql-connector-java-5.1.38-bin.jar .If im not wrong this allows me to send data throw a TCP connection right? My main problem is that im missing the Full picture ,I know how to write basic code in java , i know how to build the xhtml pages and how to bind them to the java code behind but other than that i dont get how the rest of this works.
Any help is greatly appreciated.
Edit: as i said im bad at this. if you just post a generic link on "how to set up a Javaweb" i will not be able to follow . Im asking here ,on this forum because i want human answer. I need someone to post a 4-5 line explanation and like 8 bulletins on what to do like
*install linux
*Build and export your project.
*install glassfish standalone.
etc
The thinks google returns to me are like 400 pages of glassfish documentation and really hard to follow guides on how to do what i want. Of course i could waste the next month or so just reading and trying to figure out how everything comes together (witch i inevitably have to do)but i feel like im only 15 clicks away. I just want a practical answer.

You need an application server to "upload" the code. Use tomcat, its simple and has plenty of documentation available.
If you are using XAMPP, you may be familiar with Apache Server, which runs , among other things PHP. For Java, you need application server to run the server side code.
It doesnt matter which OS you want to use, Java runs on all. You just need to download and install tomcat for the OS you want to run it on.
Please refer to http://tomcat.apache.org/
I must point out that there are many more Application servers which are available. Tomcat is one of the most popular for learning purpose.

Related

What does one do regarding applets now that Chrome doesn't support Java?

Without thinking, I created an entire program in Java and began designing a website to use this applet. All it does is create image in a certain way but there is a bit more code (classifications and default values/images) that I just felt was easiest to do with Java. Now I have a Java app and HTML CSS and JavaScript that I can't seem to do much with.
I have thought of 2 ideas (below) but I don't know what the general alternative is to applets nowadays.
I have a spare PC I may use and just alter my applet to run the back-end of a server-based site instead, but I am hesitant to use my own IP and bandwidth for something like this. Also, this app doesn't even need access to the internet so this just seems like way overkill.
I could just release the .jar, but I plan on expanding the available options. I also told people that this website was coming. I'd like to be able to just update the website.
I don't really plan on writing my program in another language. This took me time to make. If there is no way to work Java into my site, I may just abandon the project altogether.
I am mainly concerned with Chrome for this problem.
Edit: I would like to use GitHub as my host, just in case this helps at all.
You can run anything you want on the server, including java programs. So
you could run the image creation program in the server and present the
resulting image using a standard img tag.

Running A Java Eclipse Project on a Cloud-based Server with external Libraries

I hope this is the right place to post this question. The web applications stack exchange did not look suitable based on the other questions asked on there so I guessed this might be the best place to put this question.
I have a java eclipse project that works as I would like it which takes in an image locally from the adjacent file path and performs the required action on this image before returning a double value at the end after all the calculations. To do these calculations I use the OpenCV library which is essential to the core functionality of the application.
The issue I am having is to deploy this application so that the the application when it receives a request will take in an image (preferably as a .jpg but this can be changed if absolutely essential) and then after the application has carried out the required task send back the resulting number. In future this will be sent and received by an Android app which will just take the photo, compress it and send it away before receiving and displaying the answer but for now I'm just trying to get my project onto an accessible server.
I have tried to use Heroku and followed their tutorials and instructions which encourages the use of Maven but I could not properly insert the dependencies for my project as it used an external jar. I spent a lot of time checking through the various solutions online to this issue but a lot of them felt like workarounds which only worked in some cases and none were working for me. I am open to using this again if there is an elegant solution that is simple to follow.
The main sections of this question that I am asking is for the simplest way to take my working eclipse project which uses an external library, modify it to take in an image via server request and then send back a number result. I also would like a suggestion as to which cloud-based service would be suitable for this project and allow me simply to put my code on their service and allow a test user to run this code whenever I want with reasonable availability.
Sorry for the long-winded explanation and I hope I have provided enough information. I have been trying to work out how to do these things with the help of tutorials and suggestions for a few weeks now but have no previous experience with making a web server as everything I have created has been a local program.
Thanks for your help and suggestions

Netbeans Restfull tutorial test runs but result are different and can not test properly

I read the nebeans tutorial for RESTfull service (http://netbeans.org/kb/docs/websvc/rest.html) and tried to implement it. But when i'm run the test I'm not getting the screen what they say. I found that some say it is a bug on netbeans whilst some say it is bug on browser.I read some related question on this site but could not get much help
Suppose to appear as previous one
but appear as following one....
Note that navigation is not appears.
I'm unable to get the test it further.
I'm using netbeans 7.1 bundle
Can any one help me out. Thank you.
p.s : This page opens as reading a file( file:///home/xxx/xxx )
In that link you can notice the caution
Caution: For later versions of Firefox, you need to generate the test client in another Java web application than the service project.
I got the same error in firefox and chrome, then I tried test-resbeans.html in IE and its working fine as mentioned.
That tutorial dose't work on that way. When we test the restfull test we need to brows and give that restfull service. Then it will work on any browser.(I guess to test it need a service).

Looking for some information in getting Java to communicate with a website

I was wondering if one could write a Java application and put it on a website and then have it running so that when a user used your website it could interact with some html/javascript page which would communicate with the Java program.
So basically, the html5 would be used to display the java program but all the logic and everything else would be server side in Java.
I don't want to use a java applet since it requires users getting a security warning and most browsers do not autorun a java application. I just think it would look cleaner and work nicer.
Does anyone know anything about this and could give me a little abstract just to point me in the right direction so I can learn more?
Thanks
It's somewhat difficult to tell from your question but you might find GWT useful. You code everything in Java, and the client-side portion gets compiled into html/javascript which communicates to the server portion with AJAX. http://code.google.com/webtoolkit/
I think you should start by developing a simple Java web app using html, jsp and servlet. Try the Google App Engine for deployment as it is free for hosting.
http://www.servletworld.com/servlet-tutorials/simple-servlet-example.html

Best method of creating desktop shortcuts in a web app?

I'd like to have our ASP.NET web app create a desktop shortcut to our site on the user's (windows) desktop. With their permission of course. Like a button that they click and answer 'yes its ok', and then they get a link on the desktop or start menu that takes them to our site.
This may not seem like a great idea, and I could see how it could be annoying, but i have 2 great reasons for doing this. 1) Other people are doing it 2) Management wants it.
My question is, which technology would you guys recommend? I've heard this can be done via Java or Silverlight. Obviously our app is written in C#, but if it were much better/easier in Java we'd be willing to go that route.
So is one better for this task? And has anyone seen any examples?
EDIT:
Ok, assuming I wanted to go the route of Trusted XBAP or Signed Applet, can any point me in the right direction? I have no Silverlight or Java experience, but I'm willing to learn if someone can point me at a good tutorial.
If I've understood correctly what you're trying to do then no, you can't get your webapp to create a shortcut on the user's desktop. A couple of ways round it might be;
Host a batch file/script/installer on your site and try and get users to download it and run it locally.
Get the users to install a browser plugin that can do this. You may have to create this browser plugin yourself.
Browsers generally try to prevent websites having access to the local system for security reasons.

Categories

Resources