forked from onlyliuxin/coding2017
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
03857fb
commit fb798cf
Showing
8 changed files
with
67 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
|
||
apply plugin: 'java' | ||
apply plugin: 'eclipse' | ||
|
||
jar { | ||
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }} | ||
manifest { | ||
attributes 'Main-Class' : 'com.coding.Main' | ||
attributes 'Main-Class' : 'com.Main' | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
compile 'junit:junit:4.12' | ||
compile 'dom4j:dom4j:1.6.1' | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file renamed
BIN
+16 KB
.../com/coderising/array/.ArrayUtil.java.swp → ...om/coderising/litestruts/.Struts.java.swp
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
group11/1178243325/DataStructure/src/main/java/com/coderising/litestruts/XmlUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.coderising.litestruts; | ||
|
||
import java.io.*; | ||
import java.util.*; | ||
import org.dom4j.Attribute; | ||
import org.dom4j.Document; | ||
import org.dom4j.Element; | ||
import org.dom4j.io.SAXReader; | ||
import org.dom4j.io.XMLWriter; | ||
public class XmlUtil { | ||
|
||
public static String parseXML(String filePath, String actionName) { | ||
try { | ||
File file = new File(filePath); | ||
SAXReader reader = new SAXReader(); | ||
Document doc = reader.read(file); | ||
Element root = doc.getRootElement(); | ||
for (Iterator iter = root.elementIterator("action"); iter.hasNext();) { | ||
Element element = (Element)iter.next(); | ||
Attribute nameAttr = element.attribute("name"); | ||
if (nameAttr.getValue().equals(actionName)) { | ||
Attribute classAttr = element.attribute("class"); | ||
return classAttr.getValue(); | ||
} | ||
} | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
System.out.println("parse error"); | ||
} | ||
return null; | ||
} | ||
|
||
} |
58 changes: 0 additions & 58 deletions
58
group11/1178243325/DataStructure/src/main/java/com/coding/Main.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<struts> | ||
<action name="login" class="com.coderising.action.LoginAction"> | ||
<result name="success">/jsp/homepage.jsp</result> | ||
<result name="fail">/jsp/showLogin.jsp</result> | ||
</action> | ||
<action name="logout" class="com.coderising.action.LogoutAction"> | ||
<result name="success">/jsp/welcome.jsp</result> | ||
<result name="error">/jsp/error.jsp</result> | ||
</action> | ||
</struts> |