How do I use Java online on my web server? - java

I just started learning Java, and I have no idea how it works. The programming language I learned before this was PHP.
My question is, how do I use Java on my website? I created a .java file and it showed up like this (it showed the script): http://cpcheats.co/java/learning/index.java
I'm guessing I need to upload java onto my web server. If I do, can you please tell me where to download it, and where to upload it? If I don't need to download Java, can you please tell me how to use it on my website? Thanks.

I'm guessing I need to upload java onto my web server.
Ok....
Go to a bookstore/library and buy/borrow a book on Java. Spend a weekend on it and when you have a programming question, please post it here and many of us here will try to help you.

Well, what you need first is to understand the basic concept of java, and of a java web application (java on the server). You need to follow a course and this is not the place to write a java getting started, because this already exist.
I suggest that you read this:
http://docs.oracle.com/javase/tutorial/getStarted/
http://docs.oracle.com/javaee/1.4/tutorial/doc/WebApp.html
After a couple of hours you should have a better understanding of what java is and what you can do with it.

Related

How to get logs and display them on a web using Java (basic Java)

I have logs that I want to show on a web browser. ( The source code is using Log4j for logging.) I know where the logs are created. I want to code in java to display them on a web.
Can you give me some tips on Java coding ? (what class or API do I use to read the logs and display them)
Simple solution: You can go ahead creating a Controller which can read from the log file and provide you insights as a huge String(JSON).
Solution you can try implementing on your own: http://logging.apache.org/chainsaw/2.x/ to give you a headstart. Try to make this(Without UI,of course) with your log file. Believe me, you can learn a lot if you do this.
Solution I'd prefer: I'd suggest you implement https://www.elastic.co/products/kibana to aid you from your application tier. This also has steep learning curve for you if you are newbie. Good luck!

Java- how to download and upload file?

I'm a newbie on java and I have a project for my class. I need to upload or download ( need both ) a .txt file when a button is pressed. The file should be uploaded and downloaded online. I can do this with anything that help me do this , it just need to work. I don't have any knowledge about ftp's etc. What I'm supposed to study?
Have a look at Java Servlets if no frameworks in use.
Here is a simple example
http://www.codejava.net/java-ee/servlet/multipartconfig-annotation-examples
You need to have a basic Java Servlets understandings for this.
Your question is pretty vague but here some steps/ideas that could help you in your homework :
You wants to download a file you could maybe seek here :
(it's assuming that you were given some GET url by your teacher) Get method.
-After having 'getted' the data you could write them in a file in a specific localisation (hard coded in a final variable or asked or
given in params depending on your level of skill).
-You wants to upload a file, using the same classes as in the link for the GET method you could use a POST method with the data to
upload.
Sorry it's pretty vague but i hope it at least helped you.

Is it Possible to Create temporary directory & store temporary images on Client Side?

I am new to Java & i am trying to make a Web Application which can access Client Images ,
so firstly i want to know that is it possible to create a folder in Clients temporary directory or in other drive and keep my temporary images their.
Please help me to understand the possibility of what i am trying to make.
Thanks in advance.
You need applets.
Here is some thread which gives some code of applet like one you need.
https://community.oracle.com/message/9960696#9960696
There are also some problems which author of this topic has and their resolutions.
Here is some tutorial on youtube just to start (I'm not sure if this is up to date): https://www.youtube.com/watch?v=mDDeoqKcnGc
And tutorial from Oracle's page: http://docs.oracle.com/javase/tutorial/deployment/applet/
Good luck
PS. Spring and java-ee has nothing to do with your problem since it is server side. You need client side solution. Applets or Flash or Silverlight or ...

How to interact with a .aspx using Java?

I'd like to write a java program that has the ability to input information onto an asp, and then read back the data that is returned from the asp.
Does anyone have any suggestions on how to go about doing this?
Is there an easier/more elegant solution than web scraping?
In order for Java code to work in ASP, it has to be compiled byte-code that can be read by the CLR. A quick Google search of "Java" + ".NET" yielded this: http://www.janetdev.org/
Another thing you could do is just learn C#. If you already know Java, there hardly is a learning curve.

Android: Call Python Script (via SL4A) from Java code

Is it possible to call/run a python script file from Java code on the Android platform using SL4A? Basically I have a full blown Java Android app and I have several Python scripts that scrape some information from various web pages. I would like to be able to call these python scripts with the web page and get the results back. Is this possible? If so, can anyone point me in the direction of an example or two?
Thank you,
Harry
run an SL4A script from my application?
http://code.google.com/p/android-scripting/wiki/FAQ#Can_I_run_an_SL4A_script_from_my_application?
Here you go, a solution on how to make Android applications using SL4A and Python. I have developed a functional Python application following this tutorial so I can vouch for it. I assume you can add the Python code and do your data exchange with JSON.
I personally have never tried to mix these two together, though I will probably try after seeing your post.
Also, if you have any problems/questions, related to starting that example, post them here, I might help.

Categories

Resources