Servlets :: How To Design A Shopping Website

Nov 23, 2014

I am working on a Project of Ecommerce Shopping WebSite in Java.

First I Decided to use Servets,JSP,Spring,hibernate etc.. from Scratch to design its Layouts and Functionality.

But After Reading this Thread [URL]...

I Found that there are already some Ecommerece Solution that are availabale in Java Like Magento.

Is it worth To use these Ecommerce Solution for Development Purpose of Premium Purpose.

I read that some of them are Open Source.

If a ShoppingCart Solution is OpenSource then Can We Use that to develop and Distribute for Premium Purpose?

View Replies


ADVERTISEMENT

Servlets :: Architecture Design For Shopping Database

Apr 2, 2015

I'm working on a consulting training project to create a eCommerce online shopping application. Nothing big, just something functional and simple. That's why I want to structure it with the easiest maintainability possible. I've already ironed out the the database entities and how they'll relate to one another and even managed to establish connection to the database from my java application class. NOW I need to configure a user session on the web.xml, from what I've learned so far in my consulting, I can easily use jsp and servlets to have httpsession objects receive and send the information needed to and from the database, but the question is, how many do I need for a client's session?

Would maintainability be easier if I divide each entity's class actions to different servlets(a customer servlet, order servlet, product servlet, etc...), or can a single servlet handle an entire session without any complication?

View Replies View Related

Servlets :: Shopping Cart - Not Add More Than One Item

Dec 30, 2014

I have following servlet to add items into cart -

import java.io.*;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.servlet.RequestDispatcher;

[Code]...

One item gets added to the cart successfully. When adding the second item it gives a Null Pointer Exception at line 53

cart.add(item);

View Replies View Related

Servlets :: How To Remove Item From Shopping Cart

Feb 20, 2014

I created a website using jsp and servlet. I made a shopping cart and got the items to display. But how can i remove the items from the cart? Next to each item is a remove button. When that is pressed the item selected needs to be removed and cart needs to refresh.

Here is the code to display the cart:

<table width='700' border='2'>
<tr>
<td>Qty</td>
<td>Name</td>
<td>Price</td>

[Code] .....

View Replies View Related

Servlets :: Shopping Cart Session Is Not Working Properly

Jan 4, 2015

I am adding my shopping cart in session like bellow in servlet

HttpSession session = request.getSession();
session.setMaxInactiveInterval(60*30); // 30 minutes
if (session.getAttribute("cart") == null){
session.setAttribute("cart", new ShoppingCart());
}
cart = session.getAttribute("cart");

I seems if more than one person accesses it from server, if they items in the shopping cart, all the product is added to a single session. I mean if i added 4 items first and other person adds 2 items, second person sees 6 products in his cart. Where am I going wrong?

View Replies View Related

Servlets :: Shopping Cart - Show Text Based On Which Page A User Is Coming From

May 30, 2014

I am making a shopping cart app in JSP and servlets to bring it all together. Finally.

I have a registration servlet (c1), a registration form jsp (c2), a login jsp (c3). c1 checks if a username is in the database or not.

If the username is not there, then register the user and send them to c3. I want c3 to display a "registration successful" message if a user has just registered successfully and is coming from c1. ELSE, take the user back to c2 with a message which tells them to choose a different username or password etc.

How do I implement the logic of showing a message depending on where a user is coming from ? The servlets and jsps are ready and I only need to add this logic for a custom message. Of course, I could make a JSP for Registration Successful and one for Registration Failure. But, that seems to be unnecessary.

View Replies View Related

Servlets :: How To Map Website URL

Nov 25, 2014

I have my mapping as below

<servlet>
<servlet-name>main</servlet-name>
<servlet-class>co.edureka.controllers.MainController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>main</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>

So that I can map the first request coming say www.xyz.net to my first page , it does the work but some of my css and images is not getting displayed .

So I did as below

<servlet>
<servlet-name>main</servlet-name>
<servlet-class>co.edureka.controllers.MainController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>main</servlet-name>
<url-pattern>/first</url-pattern>
</servlet-mapping>

By doing this my css and images get displayed and everything works fine.

But the problem is I want to display my first page as user puts the url.

I am putting my jsp pages in WEB-INF/jsps , I am not putting it directly under WEB-CONTENT directory.

View Replies View Related

Servlets :: Website Will Be Down For Maintenance Implementation

Jan 24, 2015

So we need to inform all active users of the website that "Website will be down after so and so time for maintenance". This is how I see the implementation.

User can be in any part of the application. So any time user request comes to server, it goes through the controllers. I can write a method (and call from each controller) that checks if message needs to be displayed. Put that into application context and display it. Along with that I will also have a flag that keeps track that if the message has already been displayed or not (to the user). If message has been displayed, no need to call that method again.

View Replies View Related

Servlets :: Website Loads Correctly Only After A Refresh?

Jan 16, 2015

find out why when I access the site for the first time, it loads a blank white page, but when I reload it, it forwards me to the home page as it should.

I doubt that the reason is nothing else than the code below (in the doGet method):

String email = (String) request.getSession().getAttribute("email");
String cookieValue = null;
System.out.println(email);
// first, checking the session
if (email != null) {
request.getRequestDispatcher("/homelogged").forward(request, response);

[code].....

I suppose it's something with the session... because after I reload it, it works. But! When I close the browser and start all over again, the main page is white-blank again... And after a reload it works.

The exception:

SEVERE: Servlet.service() for servlet [first] in context with path [/MYSITE] threw exception
java.lang.NullPointerException
at controller.Controller.doGet(Controller.java:42)
Line 42 of the Controller is "for (int i = 0; i < cookies.length; i++) {"

P.S. I cleared all the cookies, but the problem persists.Also, the first it loads, it prints in console:

"null
been here 4!"

But, if I reload further, it prints:

"null
been here 4!
been here 2!
No Email! Literally, doGet!"

View Replies View Related

Servlets :: Simple Web Application Design With JSP

Apr 13, 2014

I am trying to design properly a simple 1to50 game (yes, the one that is so popular among mobile apps), but as a web application that allows two player games. I tried to document myself on the technologies I could use and came to the decision that some kind of Java would be suitable. I know that HTML, HTML5, CSS, JavaScript are client side languages with what I can basically design the client application that runs on a web browser. I installed Tomcat web server, configured Java Servlet API, done some research on Servlets and JSP, but I still cannot really imagine how all of this can work. Servlets form the Controller, JSP files the Model? How can I make them communicate, how can Servlets "tell" JSP files what to dynamically generate? Can JSP files communicate with JavaScript? Is JavaScript even necessary?

I thought that this question is not basically about a specific thing regarding JSP or Servlets, more about design and general concept, that is why I put this question under beginning Java.

View Replies View Related

Servlets :: Create A Service To Embed Widgets On Any Foreign Website

Jan 22, 2015

Its required to create a service to embed widgets on any foreign website(server), using servlets where i'll pass encrypted widgetId and in turn i will get html for displaying it on screen. Also a refresh button with the embedded widget is to be provided so as to fetch updated computed data. The point is that user should copy some html/script code and place it on his website.

I am thinking of following approach.An empty span with id, followed by a js script to make ajax call to the server to get widget HTML.

View Replies View Related

Servlets :: How To Get Result When Website Initially Uploading Rather Than Pressing Button For Action

Oct 28, 2014

I am learning how to program in JAVA servlet+MySQL. Decided to make a simple program where it shows who is celebrating birthday today by retrieving data from database. At the moment I managed to get it working by loading a form.html and pressing the button in it which gets to the result.jsp and shows results there.

My plan was to get a list of people who are celebrating there birthdays initially when the website is loaded/being loaded, I mean when you enter URL into your web browser and you get it instantly in browser. Is there a way to do it the way I want (JAVA+servlet+MySQL) instead of pressing a button/link?

View Replies View Related

Code For Shopping List

Dec 2, 2014

Im new to java, the program works but I have a feeling its not the right way to do it.

public class ShoppingItem {
private String ItemName;
private double ItemPrice;
private int ItemQty;
public ShoppingItem()
{
ItemName = "Fruit";
ItemPrice = 100;
ItemQty = 1;

[code]....

View Replies View Related

Online Shopping Price Comparison

Jan 20, 2015

I want the code for comparing the price of product on different online shopping site ...

View Replies View Related

Shopping Cart Using Array Of Items

Nov 5, 2014

I am working on a project. It is a shopping cart java program that should be setup with an array size of 5 and increased at increments of 3 if you go over 5 items. When I go over 5 items in increases however it changes the item names to null. See output below.

Here is the actual assignment:

In this exercise you will complete a class that implements a shopping cart as an array of items. The file Item.java contains the definition of a class named Item that models an item one would purchase. An item has a name, price, and quantity (the quantity purchased). The file ShoppingCart.java implements the shopping cart as an array of Item objects.

1.Complete the ShoppingCart class by doing the following:

a.Declare an instance variable cart to be an array of Items and instantiate cart in the constructor to be an array holding 5 Items.
b.Fill in the code for the increaseSize method. Your code should be similar to that in the CDCollection class handout but instead of doubling the size just increase it by 3 elements.
c.Fill in the code for the addToCart method. This method should add the item to the cart and update the totalPrice instance variable (note this variable takes into account the quantity).
d. Add a getTotalPrice() method to return the totalPrice.
e..Compile your class.

2.Write a program that simulates shopping. The program should have a loop that continues as long as the user wants to shop. Each time through the loop read in the name, price, and quantity of the item the user wants to add to the cart. After adding an item to the cart, the cart contents should be printed along with a subtotal. After the loop, print a "Please pay ..." message with the total price of the items in the cart. Compile and run this class.

OUTPUT

Enter the name of the item: Apples
Enter the unit price: .5
Enter the quantity: 1

Shopping Cart

ItemUnit PriceQuantityTotal
Apples$0.501$0.50
Total Price: $0.50
Continue shoppping (y/n)?
y
Enter the name of the item: Oranges
Enter the unit price: .5
Enter the quantity: 1

[Code] .....

View Replies View Related

JSP :: Shopping Cart - Custom Tag And Image

Jan 4, 2015

I am developing shopping cart in which I am storing image in database and retrieving.

When I select any product category from menu. example, I selected Computer then all list of product related to computer will be return i.e productName, Price and image, By using JSON.

this is my json response and output in comment.

success : function(data) {
if (data.length != 0) {
var d = eval(data);
$("#productList").html("");
for ( var key in d) {

[Code] ....

Alternatively I created custom tag to resolve this.Custom tag is working fine in jsp but in java script it saying error raised Unterminated custom tag. I think I used this custom tag in javascript but i am not sure about this error,

custom tag code for image :
imgByte = product.getImage().getBytes(1, (int) product.getImage().length());
String encodeimage = new String(Base64.encodeBase64(imgByte));
out.println("<tr><td><img src="data:image/jpeg;base64," +encodeimage + ""/><tr> <td>");

MY Question
1 - How can I use Custom tag in javascript ? Or
2 - How can we extract image from json object, like I did in custom tag .

View Replies View Related

What Classes Can Be Used For Shopping Checkout System

Mar 15, 2015

I'm currently trying to build a project for a mock checkout system. Basically it has to allow for users to browse through a list of items and add and remove products to the shopping cart as well as keep track of everything, dynamically updating the total price of the items in the checkout. In addition I also have to allow for the use of multiple checkouts. I have the main gui built but just trying to ascertain the best manner in which to build everything behind it.

View Replies View Related

Program For Shopping Mall Management

Nov 4, 2014

My program is basically on mall management ,here have to give details to customer of mall on a screen so, they can easily get that particular shop exact location . Infact they can get offer details that is given by that shop . Customer can even get alternate options of shop for their demand for eg: if someone want sports wear then he/she may get many options of shop like PUMA,NIKE,REEBOK etc.

View Replies View Related

JSP :: Shopping Cart - Calculate Total Price

Sep 21, 2014

I am making a shopping cart web, but some problems I meet about how to calculate the total price

I use ajax in product list web and if I choose one product , it will send the Id that I read from MySql to servlet and use session to save it . and I click the button jump to the cart, the page cart.jsp will read information from session ,and find product information from mysql by id , now my question is where I calculate the total price, servlet or jsp?

View Replies View Related

Java ArrayList - Printing Shopping Cart Receipts Project

Oct 26, 2014

I'm new to the concept of ArrayList and I want to solve this problem in my code.

My main problem: I don't know how to sort itemA and itemB to appear only once then It will just add the total prices together.

This is the behavior of my code:

C:Documents and SettingsDrewDesktop>java ReceiptCode
Enter Company Name
ABC Co
Enter STREET ADDRESS
123 Main Street
Enter CITY, STATE, ZIP

[Code] ....

I don't know how to sort itemA and itemB to appear only once then It will just add the total prices together. Here is my sourcecode:

ReceiptCode.java
import java.util.Scanner;
import java.util.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;

[Code] ....

View Replies View Related

JSP :: Display Product Details From Database In A Gridview Format For Online Shopping System

Apr 12, 2015

I want to display product details such as product image, name, price in a one cell of a table tag on jsp page. There should be multiple rows and 3 cells per row in the required output.i have written the following code:

<form action="displayServlet" method="get">

<table >
<tr>
<%
statement4 = connection3.createStatement();
rs4 = statement4.executeQuery("SELECT * FROM product");

[code]....

This code displays all cells in only one row. I used colspan but its not working...I have attached the snapshot of above code output and required output

View Replies View Related

Add A Website Into One Of JFrame?

Feb 3, 2014

im working on a program, but i have question and its. How can i add a website into one of my "JFrame" i have made?

exampel i want to add google.com website into the fram called V2.

HERE IS MY CODE:

Java Code: package mittprogram;
import java.awt.Color;
import java.awt.Font;

[Code].....

View Replies View Related

JSP :: How To Have Unchanged URL In Website

Jul 28, 2014

Am currently developing a website in JSP. For security reasons I need to have an unchanged URL throughout my website. Is there any way to achieve it?

View Replies View Related

Java Application For PHP Website

Dec 29, 2014

I have a blog hosting service (like Wordpress) written in PHP and MySQL, I'm gonna make Java Application for it (Runs on Windows, Linux and ...).

My Questions:

1. Can I use Connector/J to connect to my website database (MySQL)?

2. Which one is better? 1.Connect to website database, 2.Use Socket programming.

View Replies View Related

How To Read Content From A Website To App

Nov 27, 2014

I am working on a little project to create an App that can read contents from a website and return it back to my app. What protocol to use for that. Just the reading/retrieving content from a website.

View Replies View Related

Logon To Website Using Java?

Feb 10, 2015

Is it possible to use java to log on to a website? I mean,Ii know how to connect to a website and send commands, but I am not sure how to tell the server that i want to login?

And then after you logged in is it possible to then do something? like, if you logged in to gmail.com you would be able to see your emails?

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved