How to ¿connect? a website and a Java App - java

This is just an introductory question for a problem that I'd be required to solve in the following weeks.
I have a website and a Java WebApp, both currently unrelated.
Website is BootStrap and Java App runs under Apache Tomcat.
The website is in one domain, and its core file is index.htm
The App is in other domain, and core is index.jsp, enclosed in a .war file
We will redesign the site , leave BootStrap and move to WordPress.
BUT, and this what I don't know how to do it, from the WordPress site I'd be required to LOGIN into Java App.
That is to create the typical user/pass miniform.
The web works at port 80, Java at 8080.... Any way, not being an expert is hard for me to imagine how to invoque Java Login from HTML, as the website is not going to be included inside the project.
I'm sure this is quite basic... Thank you!

It's a nice question you have.
I think the best solution is install a plugin in your wordpress project: **https://wordpress.org/plugins/json-api-auth**
with this plugin you can get a rest api login and then you only need to consume this api from your java application.

Related

Java/JSP : Making a executable Java working as webapp

I have a standard java project working local made by another person i know.
It's about data retrieving.
I need to develop a web app supposed to do the same thing but accessible by anyone via browser.
I CAN'T edit the code for that purpose, at least some implementation details. A kind of black box.
Can you suggest me the best approach to make a webapp based on a local executable app through JSP & servlet ecc?
Maybe you can try something like webswing.
What is Webswing ? Webswing is a web server that allows to run any swing application inside your web browser using only pure HTML5.
The best days of swing framework are gone. Desktop applications lost
popularity and everything is forced to be online and mobile. But what
about existing application? Using applet technology proved to be
insecure, rewriting the application to web technology is too
expensive. This is where Webswing can help you. With Webswing, your
application is securely running on server and user's browser only
displays the application window. All this without changing single line
of source code.

Adding e-commerce functionality and blog feature in local java application

I am a student working on college project. A newbie in web development.
I developed a local java application for book management system for a bookstore using JSP/Servlets in eclipse and tomcat server. It has registration screen, login screen etc. I have included session management.
Now, I am asked to include following features in the same project.
Requirement-
Add: a) E-commerce functionality to it (Online Store, Shopping Kart, Payment Gateway). You may integrate the open source code available easily.
b) Add a blog feature (again you may integrate available codes)
I am not sure how we can include these features in local application.
Could you please help?
You've got 3 architectural options to choose from:
1. integrate an open source library into your own server
2. run an open source server next to your Tomcat
3. use a hosted solution and integrate with it
(3) I'm not sure what are the exercise restrictions, but #3 is the easiest by far. You can use Shopify, Magento or even Wix to easily create a store. Wix also have blogs available. The integration should be as easy as adding a link from your JSP to that hosted solution.
(2) If that's not acceptable, you can run use an open source e-commerce/blog solution that you will run next to your Tomcat. OpenCart is the leading solution here.
(1) Now, if you really really need to integrate the source code into your own Tomcat, you're left with small libraries and code fragments available online. I must admit I recommend none of them as the headache of integrating them is usually greater than the good of using them.

Google API in Java application without a web server

I am working on a small Java Swing based application, and want to add a decorative feature in it to sync files with Google Drive. But, all the documentation / discussions about Google API's that I see talks about putting this code into a web application. Also, the credentials of the client on https://cloud.google.com/console require the origin URL, without which the API will not work.
I know I can either embed a Jetty or take the hard way of sending and receiving HTTP requests. But either would be an overkill for this petty application that I am making. So, I was wondering if there is a way to include a Jar file that just lets me login and then access the folders on the Google drive.
Do you know of one? Is this possible with the existing API's? Thanks for your help!
If you have a look at the detailed installation instructions then there is a section for general purpose java applications. That is your case.
The following are the jars from the dependencies folder required for general purpose Java 5 applications (or a newer compatible version of each dependency):
google-api-client-1.17.0-rc.jar
google-oauth-client-1.17.0-rc.jar
google-http-client-1.17.0-rc.jar
commons-logging-1.1.1.jar
gson-2.1.jar httpclient-4.0.3.jar
httpcore-4.0.1.jar
jackson-core-2.1.3.jar
jsr305-1.3.9.jar
protobuf-java-2.2.0.jar
xpp3-1.1.4c.jar
You can use the GooglePromptReceiver to ask the end user to paste the authorization code from the browser to your application. You can find examples in the samples. The cmdline samples apply to your case.

Starting web programming in Java

I've been programming in PHP and ASP.NET for a while now. When doing PHP, I've always used XAMPP to test my websites. I'm wondering (since I'm learning Java) if there are equivalent services around?
Furthermore, I know this is sort of an open question, but how would you make a basic page in Java, just a basic 'Hello World' web page.
You can actually still use XAMPP. You just need to install tomcat. Here is a great screen cast on how to do it: http://www.youtube.com/watch?v=TUV_jPdq7fc.
If your a mac user you can try MAMP (whcih I prefer) and follow http://blog.mirotin.net/22/tomcat-on-mamp-the-simple-way. To get Tomcat going.
You might want to learn about programming in JSP and Servelets. JSP s are kinda like php in that they emit html out.
Also the server would be tomcat.
It would be best if you download Eclipse for EE developers. You can also try Netbeans. a sample servelet
You may read about servlets which is the basis for web applications in Java. There are many web frameworks built on top of them.
I always recommend Grails to anyone getting started with java/the web. It's more important to grasp the patterns, lifecycle, and working with requests and responses than learning the actual language. Learning Grails has got me from hobbyist developer to IT employee working with ATG - one of the most obscenely challenging web frameworks there are.
Grails includes everything you need to get started: local server, scaffolding (that's your ticket to Hello World), database access, dependency injection, the list goes on. It's built on top of Spring, Hibernate, Sitemesh, etc, which are all well-known and excellent frameworks that are being used in production.
Grails is written with Groovy, a language written on top of the JVM not far from Java.
Happy coding!
i seems to be new to the platform nd new to java but would like to suggest what i have gained till now that for developing a java page we can have any of the two servers downloaded(Weblogic or tomcat). weblogic is fully implementation of classes whereas tomcat has partial implementation. Then for the next step that we require is a source file(java file),and html file and a xml file and these all needs to be placed in a root directory as like the source file,html file and a folder named WEB-INF to be placed parallel.
Inside WEB-INF folder needs to create classes folder where our java class file will be kept.
then needs to create a .war file and deploy it over weblogic to get our desired page display.
thanks......

Newbie using Google App Engine

I've just started using Google App Engine and I have a few questions about it. I hope you can help me:
Once my Java web application is running on Google App Engine. What if one day I decide to run it on my own server. Which programs/services would I need? Is it difficult to configure?
I have a Javascript code that I would like to store on Google Application Engine, so that external webpages can run it directly. Is it possible? Otherwise could I deploy a Java application on Google App which returns this Javascript code? How could an external site ask on "execution time" for this code and run it?
THANKS!!
AppScale supports Java and allows users to deploy and host their own Google App Engine applications
Of course you can, although GAE is not meant to be used as a CDN.
Have a look to Static Files and Resource Files documentation.
It depends on what services you actually use. Take a look at AppScale, it will facilitate running your application on your own servers. I would also suggest looking at TyphoonAE (Python only), to see another software 'stack' providing similar services.
See the section on static files and resources in the docs.

Categories