Practical
Practical
Practical
PRACTICAL FILE
Submitted by Submitted to
SAGAR BHAYANA
02296403113
I-456 (I-6)
EXPERIMENT NO.1
E-Commerce
Features
4. Improved Sales Using E-Commerce, orders for the products can be generated
any time, any where without any human intervention. By this way, dependencies to
buy a product reduce at large and sales increases.
SAGAR BHAYANA
02296403113
I-456 (I-6)
5. Support E-Commerce provides various ways to provide pre sales and post
sales assistance to provide better services to customers.
Business Models
Website following B2B business model sells its product to an intermediate buyer
who then sells the product to the final customer. As an example, a wholesaler
places an order from a company's website and after receiving the consignment,
sells the end product to final customer who comes to buy the product at
wholesaler's retail outlet.
SAGAR BHAYANA
02296403113
I-456 (I-6)
Business - to - Consumer(B2C)
Website following B2C business model sells its product directly to a customer. A
customer can view products shown on the website of business organization. The
customer can choose a product and order the same. Website will send a notification
to the business organization via email and organization will dispatch the
product/goods to the customer.
SAGAR BHAYANA
02296403113
I-456 (I-6)
Consumer - to - Consumer (C2C)
Website following C2C business model helps consumer to sell their assets like
residential property, cars, motorcycles etc. or rent a room by publishing their
information on the website. Website may or may not charge the consumer for its
services. Another consumer may opt to buy the product of the first customer by
viewing the post/advertisement on the website.
SAGAR BHAYANA
02296403113
I-456 (I-6)
Business - to - Government (B2G)
B2G model is a variant of B2B model. Such websites are used by government to
trade and exchange information with various business organizations. Such websites
are accredited by the government and provide a medium to businesses to submit
application forms to the government.
SAGAR BHAYANA
02296403113
I-456 (I-6)
Government - to - Citizen (G2C)
M-Commerce
Buying and selling products and services through mobile devices are the new
trend. A housewife can purchase her kitchen appliances from the comfort of her
SAGAR BHAYANA
02296403113
I-456 (I-6)
living room, a busy person can order lunch from office, one can use mobile
platforms to sell goods and services all with a few clicks.
What is M-Commerce?
Lets look at some of the points that you need to remember as a business, while
engaging in m-commerce
Before you sell your products or services via m-commerce, you need to decide
what type of outlets or stores suit your business best. Let us suppose you have
created ringtones you can sell them either at specific third-party outlets or to
independent aggregators who charge you a commission for the service.
You can also sell your ringtones on mobile stores or app stores such as Android
marketplace or App store (Apple). These stores are frequently visited by many
SAGAR BHAYANA
02296403113
I-456 (I-6)
buyers and hence ideal for making sales easily and efficiently. Finally, you can
also sell via your own mobile store by creating a mobile website specifically for
sales or as by setting-up an m-commerce page on your main website.
Once you have decided where to sell, the next step is to set up your merchant
account. For instance, you can use third-party services such as PayPal. This is ideal
for small businesses or also large companies. A third-party application makes it
really easy for you as well as your customers to make the payments, but then they
do charge commission on the transaction.
You can also set-up your own billing and payment gateway, but make sure that you
make it really easy for users. Mobile users do not use keyboards or a mouse so
make sure that the design of your m-commerce site is intuitive, with easy
navigation tools and the right display sizes. Basically, make your m-commerce site
optimized for Smartphone users.
Benefits of M-Commerce
The major benefit of engaging in m-commerce is the sheer size of potential sales.
The probability of your potential customers owning a Smartphone is very high, so
you can safely assume that you will get much more positive response from mobile
devices than your website. M-commerce is recommended for every business
irrespective of its type, scale, and size.
SAGAR BHAYANA
02296403113
I-456 (I-6)
EXPERIMENT NO.2
This steady increase is why the Internet is fast becoming the new economy.
Some people have termed it the equalizer because for the first time in history,
anyone can sell anything from anywhere in the world. The Internet has created a
global economy for both rural and urban entrepreneurs. The only boundaries are
set by lack of connectivity to broadband. As more and more Americans gain access
to broadband, the more lucrative e-selling online becomes.
1. Decide on a business.
Whether you are launching a traditional business or an E-business, you will need a
business plan. A business plan identifies your business, its goals and objectives.
Too often, people decide to eliminate this crucial step in the business start-up
stage. Creating a business plan allows you to think about your present and future
needs.
The domain name will be the URL (universal resource locator) which is the web
address or location on the Internet for your Web site. Selecting a domain name is
SAGAR BHAYANA
02296403113
I-456 (I-6)
very important. Spend time in your selection process. Select a name that closely
identifies your product or service and one that will be easy for customers to
remember. Keep in mind, your name is your first impression.
4.Select Meta-Tags.
Meta-tags are the keywords, title, and description you select to describe your web
site so that search engines can direct people to your Web site. Heres how it works.
Once a URL is submitted to a search engine, the search engine will crawl your
site with a type of scanning software known as a spider. The spiders read the
information contained in the meta-tags, along with the content of the Web pages
themselves, and uses that information to determine a sites position within search
results.
There are three options available for Web site design: design it yourself; hire a web
designer; or utilize the one stop method where the Web host designs the Web
page from templates. If you choose to design the Web site yourself, take advantage
of online tutorials and classes at universities.
Now that you have a Web site, you need a place for the site to reside, called an ISP
(Internet service provider) to host it. You can either own or operate your own Web
server, an option that requires significant financial investment and a high-level of
technical proficiency, or you can use a hosting service, which is essentially
renting
space on a server maintained by someone else.
Customer satisfaction is important. Your Web site should be easy for customers to
navigate and when they are ready to make a purchase it should be easy, safe and
convenient.
SAGAR BHAYANA
02296403113
I-456 (I-6)
Buyer beware, couldnt be truer, when it comes to Internet shopping. Sites that
are not secure may have less traffic because people are weary of identity theft. To
ensure that your customers transactions are safe and secure, you will need
to provide security. Although, it comes with a price, it may put dollars in your
pocket in the long run. Consider contracting with a credit card verification
company.
Your Web store will need to communicate with its customers. So create a page
providing contact information. That information should include a telephone
number, e-mail, physical address, and mailing address. Once you have received an
order, you will need to acknowledge receipt and send notification of shipment to
the customer. Tracking customer orders is also a valued option.
Build it and they will come! Have you ever wondered why so many people
advertise their Web sites on television? Submit your URL to the search engines.
Most people purchase from using an online search engine. Submit your URL to the
big search engines: Google, Yahoo! MSN, Alta Vista, Excite, WebCrawler, Lycos,
and HotBot.
SAGAR BHAYANA
02296403113
I-456 (I-6)
EXPERIMENT NO.3
import java.util.HashMap;
public class Cart {
HashMap<String, Integer> cartItems;
public Cart(){
cartItems = new HashMap<>();
}
public HashMap getCartItems(){
return cartItems;
}
public void addToCart(String itemId, int price){
cartItems.put(itemId, price);
}
}
public class Addtocart extends HttpServlet {
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
HttpSession session = request.getSession();
cart shoppingCart;
shoppingCart = (cart) session.getAttribute("cart");
if(shoppingCart == null){
shoppingCart = new cart();
session.setAttribute("cart", shoppingCart);
}
String name = request.getParameter("name");
Integer price = Integer.parseInt(request.getParameter("price"));
shoppingCart.addToCart(name, price);
session.setAttribute("cart", shoppingCart);
try (PrintWriter out = response.getWriter()) {
/* TODO output your page here. You may use following sample code.
out.println("<!DOCTYPE html>");
out.println("<html>");
SAGAR BHAYANA
02296403113
I-456 (I-6)
out.println("<head>");
out.println("<title>result</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>Pizza successfully added to cart </h1>");
out.println("<form action='index.html'>Add more pizza item<input type='submit'
value='go'></form>");
out.println("<hr>");
out.println("<h2>Cart</h2>");
HashMap<String, Integer> items = shoppingCart.getCartItems();
out.println("<table border='1px'>");
}
}
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
String name = request.getParameter("name");
HttpSession session = request.getSession();
cart shoppingCart;
shoppingCart = (cart) session.getAttribute("cart");
shoppingCart.deleteFromCart(name);
session.setAttribute("cart", shoppingCart);
shoppingCart = (cart) session.getAttribute("cart");
try (PrintWriter out = response.getWriter()) {
/* TODO output your page here. You may use following sample code. */
out.println("<!DOCTYPE html>");
out.println("<html>");
out.println("<head>");
out.println("<title>Servlet deleteItem</title>");
out.println("</head>");
out.println("<body>");
HashMap<String, Integer> items = shoppingCart.getCartItems();
out.println("<table border='1px'>");
SAGAR BHAYANA
02296403113
I-456 (I-6)
out.println("<form action='deleteItem'><input type='hidden' name='name'
value='"+key+"'><tr><td>"+key+" - </td><td>"+"$"+items.get(key)+"</td><td><input
type='submit' value='delete'></td></tr></form>");
}
out.println("<table>");
out.println("</body>");
out.println("</html>");
}}
EXPERIMENT NO.4
<html>
<head>
<%!
String timestamp;
} else {
SAGAR BHAYANA
02296403113
I-456 (I-6)
}
} else {
} else {
} else {
} else {
SAGAR BHAYANA
02296403113
I-456 (I-6)
}
return timestamp;
MessageDigest md;
try {
md = MessageDigest.getInstance("SHA");
md.update(toBeHashed.getBytes());
digestValue = md.digest();
String c = Integer.toHexString(digestValue[i]);
sb.append(c);
SAGAR BHAYANA
02296403113
I-456 (I-6)
return sb.toString();
%>
<%
merchantid = "yourMerchantId";
curr = "EUR";
amount = "3000";
testStringHashed = calcSHA1(testString);
SAGAR BHAYANA
02296403113
I-456 (I-6)
%>
</head>
<body bgcolor="#FFFFFF">
</form>
<font face=verdana>
<p>
SAGAR BHAYANA
02296403113
I-456 (I-6)
<ul>
<li>In the example I use the date/time as the order id - you may have your own scheme.
</ul>
</font>
</body>
</html>
2. RESPONSE.JSP
<%!
MessageDigest md;
try {
md = MessageDigest.getInstance("SHA");
md.update(toBeHashed.getBytes());
digestValue = md.digest();
String c = Integer.toHexString(digestValue[i]);
sb.append(c);
return sb.toString();
testStringHashed = calcSHA1(testString);
SAGAR BHAYANA
02296403113
I-456 (I-6)
if (sha1hash.compareTo(testStringHashed) != 0) {
%>
There has been an error validating the response from our payment provider.
<%
} else {
if (result.compareTo("00") == 0) {
%>
Thank You - Your payment has been accepted. If you have any enquiries
<br><br>
<%
} else {
%>
We're sorry - there has been a problem processing your order. Please call
SAGAR BHAYANA
02296403113
I-456 (I-6)
01 xxxxxx and quote your order number as: <% =order_id %>
<br>
Your credit card has not been charged. To continue browsing please
<%
%>
EXPERIMENT NO.4
import sun.misc.BASE64Encoder;
sig.initVerify(keyPair.getPublic());
SAGAR BHAYANA
02296403113
I-456 (I-6)
sig.update(data);
System.out.println(sig.verify(signatureBytes));
}
}
SAGAR BHAYANA
02296403113
I-456 (I-6)