post method does not support this url
This is Get product servlet class of Shoping site example of Http Session.
I want to add selected product in the cart thorough this class i want to delegate control to add product servlet. but I am receiving one error that is post method does not supported by this url.
package com.prakhar.servlet;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
public class GetProductsServlet extends HttpServlet
{
public void init()throws ServletException
{
productsdao=new ProductsDAO();
}
public void doGet(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException
{
HttpSession hs=req.getSession(false);
if(hs==null)
{
RequestDispatcher rd=req.getRequestDispatcher("Login.html");
rd.forward(req, res);
return;
}
String uname=(String)hs.getAttribute("UserName");
res.setContentType("text/html");
PrintWriter out=res.getWriter();
out.println("<html><head>");
out.println("<title>Shoping Cart Example</title>");
out.println("</head><body>");
out.println("<table width='100%' height='90%' border='1'>");
out.println("<tr align='center'>");
out.println("<td height='39' colspan='2'><strong><font size='5'>MyShoppingSite</font></strong></td>");
out.println("</tr>");
out.println("<tr>");
out.println("<td width='18%' height='500' valign='top'><p> </p>");
out.println("<blockquote><p>");
out.println("<a href='"+res.encodeURL("getProducts")+"'>");
out.println("View Products</a></p><p>");
out.println("<a href='"+res.encodeURL("getCart")+"'>");
out.println("View Cart Detail</a></p><p>");
out.println("<a href='"+res.encodeURL("logout")+"'>");
out.println("Logout</a></p>");
out.println("</blockquote></td>");
out.println("<td width='82%' align='left' valign='top'><p>");
out.println("<font size='6'>Welcome , "+uname+"</font></p>");
out.println("<form method="post" action='"+res.encodeURL("addProducts")+"'>");
System.out.println(res.encodeURL("GetProductsServlet"));
out.println("<table width='100%' border='1'>");
out.println("<tr>");
out.println("<th width='8%'>Check</th>");
out.println("<th width='24%'>Product Code</th>");
out.println("<th width='28%'>Product Name</th>");
out.println("<th width='20%'>Available Quantity</th>");
out.println("<th width='20%'>Required Quantity</th>");
out.println("</tr>");
Collection products=productsdao.getProducts();
System.out.println("GetProductsServlet"+products);
if(products==null)
{
out.println("<tr><td colspan=5 align=center>");
out.println("No Products Available");
out.println("</td></tr>");
}
else
{
Iterator i=products.iterator();
System.out.println("Iterator"+i);
while(i.hasNext())
{
Product p=(Product)i.next();
out.println("<tr>");
out.println("<td align='center'>");
out.println("<input type='checkbox' name='products' value='"+p.getCode()+"'/>");
System.out.println("GetProductServlet p.getCode()"+p.getCode());
out.println("<input type='hidden' name='"+p.getCode()+"Name' value='"+p.getName()+"'/></td>");
out.println("<td>"+p.getCode()+"</td>");
out.println("<td>"+p.getName()+"</td>");
out.println("<td>"+p.getQty()+"</td>");
out.println("<td>");
out.println("<input type='text' name='"+p.getCode()+"'/>");
out.println("</td></tr>");
}
}
out.println("</table>");
out.println("<br/><center>");
out.println("<input type=submit value='Add Product to Cart'/>");
out.println("</center>");
out.println("</form>");
out.println("</td></tr>");
out.println("<tr align='center'>");
out.println("<td colspan='2'>");
out.println("<em>©Copyrights 2005-09</em></td");
out.println("</tr>");
out.println("</table>");
out.println("</body></html>");
out.flush();
out.close();
}
ProductsDAO productsdao=new ProductsDAO();
}
View Answers
Related Tutorials/Questions & Answers:
post method does not support this urlpost method does not
support this url This is Get product servlet.... but I am receiving one error that is
post method does not supported by this
url...;");
out.println("<form
method="
post" action='"+res.encodeURL("addProducts")+"'>
Object does not support proprty or methodObject
does not
support proprty or method Hi I have been given some... on a network machine it returns a error which say's Object does'nt
support this property or
method. It seems to have a problem with this type of line
Advertisements
HTTPClient Post method HTTPClient
Post method HTTPClient
Post method
HI friends,
I am trying a JAVA API for this i want a Java HTTPClient program.
i tried but i am unable to complete. can any one plz help me..........
Plz, PLz help me out
Post Method of the Form In JSP
There is no need to use
POST method in the form. This
method doesn't
append the
URL...
Post Method of the Form In JSP
... of the
post
method of the form in JSP. The HTTP
post method sends data
What is the difference between GET and POST method? Method in PHP, as
POST method never shows the assigned values into the
URL. Where...What is the difference between GET and
POST method? In PHP, both GET and
POST method serves the same feature to get the data in variable. Still
postpost method in PHP Write an example of the
post method in PHP... values in the
url will be hidden
in
post
post is the
method in php
PHP
Post method POST AND GET METHOD - JSP-ServletPOST AND GET METHOD I AM LITTLE BIT CONFUSED IN GET() AND
POST() METHODS.
PLZ GIVE ME BREIF INTRODUCTION ABOUT THESE ??:) Hi Friend,
Please visit the following links:
http://www.roseindia.net/jsp
HTML Post Radio Button;
HTML
Post attribute used in
method, when a user is not able to
see the data in the
URL of browser.
Post method is used for sending, updating
and sending a mail. The
Post method is not so effective
method of hiding a data
Does Java support multiple inheritance?Does Java
support multiple inheritance? Hi,
Does Java
support multiple inheritance?
thanks
hi,
Please visit the following link:
http://www.roseindia.net/java/language/inheritance.shtml
Hope
Does Java support multiple Inheritance?Does Java
support multiple Inheritance? Hi,
I am beginner in Java... example.
Does Java
support multiple Inheritance?
Thanks
Hi,
Good... inheritance.
Check: why java
does not
support multiple inheritance
Check
Does Java support multiple Inheritance?Does Java
support multiple Inheritance? Hi,
I am beginner in Java... example.
Does Java
support multiple Inheritance?
Thanks
Hi,
Good... inheritance.
Check: why java
does not
support multiple inheritance
Check
Does Java support multiple Inheritance?Does Java
support multiple Inheritance? Hi,
I am beginner in Java... example.
Does Java
support multiple Inheritance?
Thanks
Hi,
Good... inheritance.
Check: why java
does not
support multiple inheritance
Check
POST METHOD
POST METHOD
... the data from the server. In
POST
the data will not get appended in the
URL but sent... to server is
post which is defined in the
form attribute
method.
As soon
How to work with POST method in jsp page How to work with
POST method in jsp page...
POST method
instead of GET
method in jsp page. GET is default
method for sending..._TO_REPLACE_2
Difference between GET and
POST
GET:
1.
URL GET and POST Method of HTTP
GET and
POST Method of HTTP
.... In get
method the data we send get appended to the
URL so whatever you
will send..._TO_REPLACE_1
POST
The
Post method is more powerful request. By using
Post
we can request
What is a pointer and does Java support pointers? What is a pointer and
does Java
support pointers? Hi,
What is a pointer and
does Java
support pointers?
Thanks
Hi,
Pointer... to memory leaks and reliability issues hence Java doesn't
support the usage of pointers
PHP HTML forms and Post Method CodePHP HTML forms and
Post Method Code
PHP html function
With the given PHP HTML... HTML Code
<HTML><BODY>
<FORM
METHOD=?
POST... to create html
forms and display data using PHP
Post Method in PHP
Java Servlet : Difference between GET and POST; will differentiate the GET and
POST method of
servlet.
GET - It is HTTP
method, asks to get thing at the requested
URL.
POST - It is HTTP
method, asks...
of the HTTP request So you can use
POST in such case because
POST method
provides
postpost what is
post
vxvxcvxcv
Please visit the following link:
Post in PHP
POST or GET in the
URl which takes more execution time for processing.In the
POST method no information is given to ULR that's why
POST is faster then GET
method...
POST or GET hello,
Which will execute faster on php
POST or GET
Difference between GET and POST or a
POST is different too. If you use a GET, the
method that is called is doGet... if there is no GET or
POST data. If you use a
POST, the
method called is doPost...Difference between GET and
POST Difference between GET and
POST get and postget and post what is php and get
PHP get and
post method JavaScript location.replace() method
JavaScript location.replace()
method
JavaScript
method location.replace(
URL) immediately redirects to the
specified
URL location. After calling replace()
method ,you cannot
go
get method get
method how to use get
method:
secure
method is
post method and most of use
post method why use a get
method To delete postTo delete post How can I delete my old
post answer. I've posted 2 same answers by mistake
JSP Get URL the
method getRequestURL that gives you the
URL of the current
JSP page.
<%=request.getRequestURL()%> : The
method is used to obtain the
URL of the current...
JSP Get
URL
Java Method Return Value the value within the body of
method. The
method declared void
does not return any... Java
Method Return Value
Java
method Return Value return to the code when
post backpost back I am developing a C# asp.net application.
I have a webform which contains 2 dropdowns and a textbox with
type="password".
On "SelectedIndexChanged" event of the first dropdown, there is a postback,
in order to fill
php $_GET and $_POST functions for changes. One GET request is for one
URL and since GET
method
does not change... of data at a time, whereas $_
POST does not have
such kind of limitations, we can... $_GET variable we can see the values in address
bar, on the contrary $_
POST does Creating URL using <c:url>="JSTLCreatingURL.jsp"
method="
post">
<table>
<tr><...Creating
URL using <c:url>
... by creating it or by or by using the
existing one. If the browser doesn't
support The $_POST Function submit with
method="post". When you
send data using
POST method...;/form>
Fetching form data sent via
POST method
You can fetch data... to use
POST method :
Example :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
method method how and where, we can define methods ?
can u explain me with full programme and using comments
JQuery url validationjQuery
url Validation :
jQuery "required url" is the
method to validate or check
url if the
element is empty (text input) or wrong
url type entered .We can validate
our
url in another type by writing the "
url methodmethod can you tell me how to write an abstract
method called ucapan() for B2 class
class A2{
void hello(){
system.out.println("hello from A2");
}}
class B2 extends A2{
void hello(){
system.out.println("hello from B2
URL Encoding and URL DecodingURL Encoding and
URL Decoding What is
URL Encoding and
URL Decoding ?
URL encoding is the
method of replacing all the spaces and other extra characters into their corresponding Hex Characters and Decoding
<c: url> in JSTL;/head>
<body>
<form
method="
POST">
<center>... it or by or by using the
existing one. If the browser doesn't
support the cookies then the container will
automatically use the
URL rewriting. In servlets while the
url