文章列表
编写一个截取字符串的函数,输入为一个字符串和字节数,输出为按字节截取的字符串。 但是要保证汉字不被截半个,如"我ABC"4,应该截为"我AB",输入"我ABC汉DEF",6,应该输出为"我ABC"而不是"我ABC+汉的半个"。
public class parseCH {
public void splitIt(String splitStr, int bytes) {
int cutLength = 0;
int byteNum = bytes;
byte bt ...
- 2009-06-09 22:34
- 浏览 988
- 评论(0)
1.input.jsp
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title& ...
- 2009-05-04 21:07
- 浏览 850
- 评论(0)
1.Product.java and Product.hbm.xml
package com.v12.shop.model;
public class Product implements java.io.Serializable {
private Integer id;
private Category category;
private String name;
private Double price;
private String description;
public Pro ...
- 2009-05-04 20:59
- 浏览 1059
- 评论(0)
1.ProductDao.java and ProductDaoHibernate.java
package com.v12.shop.dao;
import java.util.List;
import com.v12.shop.model.Product;
public interface ProductDao {
public void add(Product p);
public void delete(Integer id);
public void update(Product p);
public Product qu ...
- 2009-05-04 20:42
- 浏览 1184
- 评论(0)
1.ProductAction.java
package com.v12.shop.web;
import com.opensymphony.xwork2.ActionSupport;
import com.v12.shop.dao.ProductDao;
import com.v12.shop.model.Product;
public class ProductAction extends ActionSupport{
private Product product;
private Integer id;
private ProductDao prod ...
- 2009-05-04 19:44
- 浏览 864
- 评论(0)
1.web.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
...
- 2009-05-04 19:00
- 浏览 657
- 评论(0)