• 大小: 24.97MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-06-15
  • 语言: Java
  • 标签: JSP  MYSQL  

资源简介

JSP+mysql开发的类似淘宝的购物网站

资源截图

代码片段和文件信息

package com.parknshop.action;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.parknshop.service.CustomerService;

public class AjaxAction extends ActionSupport{
private String id;
private String username;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
private String email;
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
private CustomerService customerService;
public CustomerService getCustomerService() {
return customerService;
}
public void setCustomerService(CustomerService customerService) {
this.customerService = customerService;
}
public String testUserNameExist() throws Exception {

HttpServletResponse response = ServletActionContext.getResponse();  
response.setContentType(“text/xml;charset=UTF-8“);
response.setHeader(“Cache-Control“ “no-cache“);
String xml = “l version=\“1.0\“ encoding=\“UTF-8\“?>“;
if(getUsername().length()<2){
xml += “The username is too short“;
}else if(getUsername().length()>20){
xml += “The username is too long“;
}else {
if (getCustomerService().getCustomerInfo(getUsername())!=null) {  
xml += “This username already exists“;
} else {
xml += “OK“;
}
}
response.getWriter().write(xml);
return null;  
}
public String testEmailExist() throws Exception{
HttpServletResponse response = ServletActionContext.getResponse();  
response.setContentType(“text/xml;charset=UTF-8“);
response.setHeader(“Cache-Control“ “no-cache“);
String xml1 = “l version=\“1.0\“ encoding=\“UTF-8\“?>“;
if(getCustomerService().getInfoByEmail(getEmail())!=null){
xml1 += “The mailbox has been registered!“;
} else {
xml1 += “OK“;
}

response.getWriter().write(xml1);
return null;  
}
public String findEmail(){
if(getCustomerService().getInfoByEmail(getEmail())!=null){
ActionContext cxt = ActionContext.getContext();
cxt.put(“findInfo“ “Success!You can get new password from the Email!“);
}else {
ActionContext cxt = ActionContext.getContext();
cxt.put(“findInfo“ “Error !The email is not exist!“);
}
return “success“;
}
public String selectCountry(){
HttpServletResponse response = ServletActionContext.getResponse();  
response.setContentType(“text/xml;charset=UTF-8“);
response.setHeader(“Cache-Control“ “no-cache“);
String xml_start= “l version=\“1.0\“ encoding=\“UTF-8\“?>“;
    xml_start += ““;
St

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    .......      6789  2014-04-16 10:46  ParkNShop_DEMO3\.classpath

    .......       545  2014-04-15 14:20  ParkNShop_DEMO3\.myhibernatedata

    .......       318  2014-04-20 19:27  ParkNShop_DEMO3\.mymetadata

    .......       240  2014-04-15 14:20  ParkNShop_DEMO3\.mystrutsdata

    .......      2251  2014-04-16 10:46  ParkNShop_DEMO3\.project

    .......       500  2014-04-15 14:20  ParkNShop_DEMO3\.settings\.jsdtscope

    .......       395  2014-04-16 10:46  ParkNShop_DEMO3\.settings\org.eclipse.jdt.core.prefs

    .......       483  2014-04-16 10:46  ParkNShop_DEMO3\.settings\org.eclipse.wst.common.component

    .......       252  2014-04-16 10:46  ParkNShop_DEMO3\.settings\org.eclipse.wst.common.project.facet.core.xml

    .......        49  2014-04-16 10:46  ParkNShop_DEMO3\.settings\org.eclipse.wst.jsdt.ui.superType.container

    .......         6  2014-04-16 10:46  ParkNShop_DEMO3\.settings\org.eclipse.wst.jsdt.ui.superType.name

    .......       474  2014-04-15 14:20  ParkNShop_DEMO3\.springBeans

    .......      5169  2014-04-15 14:20  ParkNShop_DEMO3\src\com\parknshop\action\AjaxAction.java

    .......      1087  2014-04-15 14:20  ParkNShop_DEMO3\src\com\parknshop\action\ApplyAdAction.java

    .......       203  2014-04-15 14:20  ParkNShop_DEMO3\src\com\parknshop\action\BackGroundAction.java

    .......      1437  2014-04-15 14:20  ParkNShop_DEMO3\src\com\parknshop\action\CommentAction.java

    .......      8649  2014-04-15 14:20  ParkNShop_DEMO3\src\com\parknshop\action\CountProfitAction.java

    .......      3272  2014-04-15 14:20  ParkNShop_DEMO3\src\com\parknshop\action\CountProfitTableAction.java

    .......       746  2014-04-15 14:20  ParkNShop_DEMO3\src\com\parknshop\action\CreateIncomeAction.java

    .......      1785  2014-04-15 14:20  ParkNShop_DEMO3\src\com\parknshop\action\CreateProductModifyAction.java

    .......      1295  2014-04-15 14:20  ParkNShop_DEMO3\src\com\parknshop\action\CreateProductRegisterAction.java

    .......       806  2014-04-15 14:20  ParkNShop_DEMO3\src\com\parknshop\action\CreateShopGoodsAction.java

    .......      2402  2014-04-15 14:20  ParkNShop_DEMO3\src\com\parknshop\action\CreateShopModifyAction.java

    .......      1566  2014-04-15 14:20  ParkNShop_DEMO3\src\com\parknshop\action\CreateShopOwnerModifyPageAction.java

    .......       649  2014-04-15 14:20  ParkNShop_DEMO3\src\com\parknshop\action\CreateShopRegisterAction.java

    .......       845  2014-04-15 14:20  ParkNShop_DEMO3\src\com\parknshop\action\CustomerHomepageAction.java

    .......      3889  2014-04-15 14:20  ParkNShop_DEMO3\src\com\parknshop\action\CustomerUpdateAction.java

    .......      1336  2014-04-15 14:20  ParkNShop_DEMO3\src\com\parknshop\action\DeleteProductAction.java

    .......       596  2014-04-15 14:20  ParkNShop_DEMO3\src\com\parknshop\action\DeleteShopAction.java

    .......       818  2014-04-15 14:20  ParkNShop_DEMO3\src\com\parknshop\action\DetailAction.java

............此处省略1020个文件信息

评论

共有 条评论