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

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.

Related

How to ¿connect? a website and a Java App

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.

Hosting a web application on AWS using java, maven, spring and mySQL

My son has done a university project which is a web app using Java 8, Maven, Spring boot, Spring hibernate, Spring data and MySQL. I am helping him try to find a free or very cheap hosting solution, and was told AWS is one option. Is this correct? The application is small (15 tables) and the data is a few megs.
If AWS is the way to go, am I supposed to setup a virtual / instance and install all software and upload all code to the virtual? He is using Windows 10 to develop the application. Which instance should be used? There are various "Microsoft Windows Server" options.
A guide on how to do this and have it running on the web would be appreciated.
That isn't an entire guide, but a starting point to check on your options.
All depends on for how long you intend to have the application running.
If you only want to have a demonstration of the APP in School you could really use the AWS Free tier for new users.
If you intend to have it running for more than a year or scale it up, you will either have to refactor it as Micro services based architecture or a payment will be required, though it isn't really that much at all.
I sugges you have a look here:
https://aws.amazon.com/free/
https://aws.amazon.com/answers/web-applications/aws-web-app-deployment-java/
https://aws.amazon.com/elasticbeanstalk/pricing/

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.

Edit files (read/edit/save) in java based web application via webdav

im searching for informations how to implement a service in our servlet based java web application which can handle online editing (reading / editing / saving) of some common file types like the programs of the office suite via webdav.
We have a tomcat 7 running and using webdav already for mounting folders on client computers (implemented by an colleague) which works fine.
Now im having the request to research ways to implement this online editing features (for example open a .doc file in our webapp, edit the file in word and save it automaticly in our webapp) and couldn't find that many informations/howtos about this topic.
From what i could find so far i could see that using this webdav feature some response header values needs to be set and a own servlet needs to be implemented.
But im still not sure where to start and if im right...
Does anybody knows any good resoures for this? (documentations, simple webapp example, ...whatever)?
You should use Milton, its intended for exactly the purpose you describe. Its pretty simple to implement, you create annotatated methods which make the information in your web application available via webdav. This includes file and folder browsing, as well as uploading, downloading and locking (required for MS Office)
There are tutorials on the milton website which guide you through the implementation process.
Here's a simple hello world implementation from the first tutorial:
https://github.com/miltonio/milton2/blob/master/examples/tuts-anno1/src/main/java/com/helloworld/HelloWorldController.java
Milton comes with a free community edition which supports DAV level 1 only. That will work with most 3rd party webdav clients like Bitkinex, Cyberduck, etc. But for compatibility with operating system webdav clients, including Win7, MacOS, MS Office, you need the enterprise edition which is available on a commercial license.
Please see the milton site for details - http://milton.io
(I'm the author)

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......

Categories