訪問tomcat時只輸入ip就可以訪問系統的方法
1.在tomcat的service.xml中把端口改成802.把自己的項目名稱改成ROOT,覆蓋tomcat的原ROOT項目,就可以了
posted @ 2013-05-13 11:28 楊軍威 閱讀(186) | 評論 (0) | 編輯 收藏
java學習
posted @ 2013-05-13 11:28 楊軍威 閱讀(186) | 評論 (0) | 編輯 收藏
posted @ 2013-05-12 09:22 楊軍威 閱讀(2279) | 評論 (0) | 編輯 收藏
posted @ 2013-05-07 10:13 楊軍威 閱讀(187) | 評論 (0) | 編輯 收藏
public class Animal {
private int id;
private String name;
private boolean sex;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public boolean isSex() {
return sex;
}
public void setSex(boolean sex) {
this.sex = sex;
}
}
public class Bird extends Animal {
private int height;
public int getHeight() {
return height;
}
public void setHeight(int height) {
this.height = height;
}
}
public class Pig extends Animal {
private int weight;
public int getWeight() {
return weight;
}
public void setWeight(int weight) {
this.weight = weight;
}
}
posted @ 2013-05-07 09:46 楊軍威 閱讀(307) | 評論 (0) | 編輯 收藏
public class Animal {
private int id;
private String name;
private boolean sex;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public boolean isSex() {
return sex;
}
public void setSex(boolean sex) {
this.sex = sex;
}
}
public class Bird extends Animal {
private int height;
public int getHeight() {
return height;
}
public void setHeight(int height) {
this.height = height;
}
}
public class Pig extends Animal {
private int weight;
public int getWeight() {
return weight;
}
public void setWeight(int weight) {
this.weight = weight;
}
}
posted @ 2013-05-07 09:37 楊軍威 閱讀(409) | 評論 (0) | 編輯 收藏
public class Animal {
private int id;
private String name;
private boolean sex;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public boolean isSex() {
return sex;
}
public void setSex(boolean sex) {
this.sex = sex;
}
}
public class Bird extends Animal {
private int height;
public int getHeight() {
return height;
}
public void setHeight(int height) {
this.height = height;
}
}
public class Pig extends Animal {
private int weight;
public int getWeight() {
return weight;
}
public void setWeight(int weight) {
this.weight = weight;
}
}
posted @ 2013-05-06 22:51 楊軍威 閱讀(220) | 評論 (0) | 編輯 收藏
public class CollectionMapping {
private int id;
private String name;
private Set setValue;
private List listValue;
private String[] arrayValue;
private Map mapValue;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Set getSetValue() {
return setValue;
}
public void setSetValue(Set setValue) {
this.setValue = setValue;
}
public List getListValue() {
return listValue;
}
public void setListValue(List listValue) {
this.listValue = listValue;
}
public String[] getArrayValue() {
return arrayValue;
}
public void setArrayValue(String[] arrayValue) {
this.arrayValue = arrayValue;
}
public Map getMapValue() {
return mapValue;
}
public void setMapValue(Map mapValue) {
this.mapValue = mapValue;
}
}
posted @ 2013-05-06 22:22 楊軍威 閱讀(188) | 評論 (0) | 編輯 收藏
public class Contact {
private String email;
private String address;
private String zipCode;
private String contactTel;
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getZipCode() {
return zipCode;
}
public void setZipCode(String zipCode) {
this.zipCode = zipCode;
}
public String getContactTel() {
return contactTel;
}
public void setContactTel(String contactTel) {
this.contactTel = contactTel;
}
}
public class User {
private int id;
private String name;
private Contact contact;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Contact getContact() {
return contact;
}
public void setContact(Contact contact) {
this.contact = contact;
}
}
posted @ 2013-05-06 22:10 楊軍威 閱讀(551) | 評論 (0) | 編輯 收藏
posted @ 2013-05-06 21:32 楊軍威 閱讀(183) | 評論 (0) | 編輯 收藏
<?xml version="1.0" encoding="UTF-8"?>
<config>
<action name="user" className="com.kaishengit.web.UserAction">
<result name="success" type="forward">suc.jsp</result>
<result name="error" type="redirect">404.jsp</result>
</action>
<action name="book" className="com.kaishengit.web.BookAction">
<result name="success">book.jsp</result>
<result name="error" type="redirect">bookerror.jsp</result>
</action>
<action name="person" className="com.kaishengit.web.PersonAction" method="del">
<result name="ok">suc.jsp</result>
</action>
</config>
package com.kaishengit.test;
import java.io.File;
import java.net.URL;
import java.util.List;
import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
public class Dom4jTest {
public void readXML() {
//拿到src文件夾里的xml配置文件
URL url = getClass().getResource("/");
System.out.println(url);
String filePath = url.getFile() + "struts.xml";
try {
//創建讀取配置文件的對象
SAXReader reader = new SAXReader();
//開始讀取配置文件
Document doc = reader.read(new File(filePath));
//拿到根節點
Element root = doc.getRootElement();
//拿到根節點下的action接點數組
List<Element> actions = root.elements("action");
for(Element action : actions) {
String name = action.attributeValue("name");
String className = action.attributeValue("className");
String method = action.attributeValue("method");
System.out.println("name="+name);
System.out.println("className="+className);
System.out.println("method="+method);
List<Element> results = action.elements("result");
for(Element result : results) {
String resultName = result.attributeValue("name");
String resultType = result.attributeValue("type");
String pageName = result.getText();
System.out.println("name:" + resultName + "\tresultType:" + resultType + "\tpageName:" + pageName);
}
System.out.println("----------------------");
}
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
Dom4jTest d = new Dom4jTest();
d.readXML();
}
}
posted @ 2013-05-06 21:08 楊軍威 閱讀(1353) | 評論 (0) | 編輯 收藏