File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes shoping cart Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "shoping cart" Watch "shoping cart" New topic
Author

shoping cart

maheshm morem
Greenhorn

Joined: Sep 23, 2010
Posts: 26
hi, i want to make shoping cart how to make it , what i have to use it ?
shivani vidit
Greenhorn

Joined: Oct 11, 2007
Posts: 14
You can use HttpSession api in servlet/jsp to develop shopping cart.
maheshm morem
Greenhorn

Joined: Sep 23, 2010
Posts: 26
sir , i am new in this , i dont now how to do it . can you elobrate me please ?
shivani vidit
Greenhorn

Joined: Oct 11, 2007
Posts: 14
you can develop servlet or jsp. javax.servlet.http package provides you HttpsSession interface, whose object can be retrived from HttpRequest

you can refer the follwing link for more details....
http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/Servlet-Tutorial-Session-Tracking.html
maheshm morem
Greenhorn

Joined: Sep 23, 2010
Posts: 26
<%@page language="java" import="java.sql.*, java.io.*" %>
<html>
<body>

<%
Connection connection = null;
ResultSet rs = null;
Statement st = null;
try {

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
connection = DriverManager.getConnection("jdbcdbc:mm1", "root", "mahesh");
st=connection.createStatement();
InputStream sImage;
rs = st.executeQuery("select * from save_image");
while(rs.next())
{

byte[] bytearray = new byte[1048576];
int size=0;
sImage = rs.getBinaryStream(1);
response.reset();
response.setContentType("image/jpeg");
while((size=sImage.read(bytearray))!= -1 ){
response.getOutputStream().write(bytearray,0,size);
}

}
}

catch (Exception ex) {
out.println("Found some error : "+ex);
}
finally {
// close all the connections.
//connection.close();
//psmnt.close();
}

%>
</body>
</html>
maheshm morem
Greenhorn

Joined: Sep 23, 2010
Posts: 26
sorry bymistically i past it on this , i want to past somwhere else ,
thank you sir , i got idea about shoping cart, but problem is that i used that the session program after the login of user and set the attribute name and password to it ,and after that i forword to html page it working, and my html pages display but when i forword to jsp page it doesnt work. where i have to make session ?
thank you.
mahesh more
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: shoping cart