FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

解决了一些困扰了我很久的心理问题 · amakerlee/JavaSecurityLearning@e88fa35 · GitHub

Repository navigation

Commit e88fa35

Browse files
committed
解决了一些困扰了我很久的心理问题
1 parent d782849 commit e88fa35

46 files changed

Lines changed: 974 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.
19+
-->
20+
<!-- $Id: pom.xml 642118 2008-03-28 08:04:16Z reinhard $ -->
21+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
22+
23+
<modelVersion>4.0.0</modelVersion>
24+
<packaging>war</packaging>
25+
26+
<name>S2-001</name>
27+
<groupId>org.example</groupId>
28+
<artifactId>S2-001</artifactId>
29+
<version>1.0-SNAPSHOT</version>
30+
31+
<build>
32+
<plugins>
33+
<plugin>
34+
<groupId>org.mortbay.jetty</groupId>
35+
<artifactId>maven-jetty-plugin</artifactId>
36+
<version>6.1.7</version>
37+
<configuration>
38+
<connectors>
39+
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
40+
<port>8888</port>
41+
<maxIdleTime>30000</maxIdleTime>
42+
</connector>
43+
</connectors>
44+
<webAppSourceDirectory>${project.build.directory}/${pom.artifactId}-${pom.version}</webAppSourceDirectory>
45+
<contextPath>/</contextPath>
46+
</configuration>
47+
</plugin>
48+
<plugin>
49+
<groupId>org.apache.maven.plugins</groupId>
50+
<artifactId>maven-compiler-plugin</artifactId>
51+
<configuration>
52+
<source>6</source>
53+
<target>6</target>
54+
</configuration>
55+
</plugin>
56+
</plugins>
57+
</build>
58+
59+
<dependencies>
60+
<!--dependency>
61+
<groupId>org.example</groupId>
62+
<artifactId>[the artifact id of the block to be mounted]</artifactId>
63+
<version>1.0-SNAPSHOT</version>
64+
</dependency-->
65+
<dependency>
66+
<groupId>org.apache.struts</groupId>
67+
<artifactId>struts2-core</artifactId>
68+
<version>2.0.8</version>
69+
</dependency>
70+
</dependencies>
71+
72+
</project>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package com.drunkbaby.action;
2+
3+
import com.opensymphony.xwork2.ActionSupport;
4+
5+
public class LoginAction extends ActionSupport{
6+
private String username = null;
7+
private String password = null;
8+
9+
public String getUsername() {
10+
return this.username;
11+
}
12+
13+
public String getPassword() {
14+
return this.password;
15+
}
16+
17+
public void setUsername(String username) {
18+
this.username = username;
19+
}
20+
21+
public void setPassword(String password) {
22+
this.password = password;
23+
}
24+
25+
public String execute() throws Exception {
26+
if ((this.username.isEmpty()) || (this.password.isEmpty())) {
27+
return "error";
28+
}
29+
if ((this.username.equalsIgnoreCase("admin"))
30+
&& (this.password.equals("admin"))) {
31+
return "success";
32+
}
33+
return "error";
34+
}
35+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!DOCTYPE struts PUBLIC
4+
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
5+
"http://struts.apache.org/dtds/struts-2.0.dtd">
6+
7+
<struts>
8+
<package name="S2-001" extends="struts-default">
9+
<action name="login" class="com.drunkbaby.action.LoginAction">
10+
<result name="success">welcome.jsp</result>
11+
<result name="error">index.jsp</result>
12+
</action>
13+
</package>
14+
</struts>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one or more
4+
contributor license agreements. See the NOTICE file distributed with
5+
this work for additional information regarding copyright ownership.
6+
The ASF licenses this file to You under the Apache License, Version 2.0
7+
(the "License"); you may not use this file except in compliance with
8+
the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
-->
18+
<!-- @version $Id: applicationContext.xml 561608 2007-08-01 00:33:12Z vgritsenko $ -->
19+
<beans xmlns="http://www.springframework.org/schema/beans"
20+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
21+
xmlns:util="http://www.springframework.org/schema/util"
22+
xmlns:configurator="http://cocoon.apache.org/schema/configurator"
23+
xmlns:avalon="http://cocoon.apache.org/schema/avalon"
24+
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
25+
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
26+
http://cocoon.apache.org/schema/configurator http://cocoon.apache.org/schema/configurator/cocoon-configurator-1.0.1.xsd
27+
http://cocoon.apache.org/schema/avalon http://cocoon.apache.org/schema/avalon/cocoon-avalon-1.0.xsd">
28+
29+
<!-- Activate Cocoon Spring Configurator -->
30+
<configurator:settings/>
31+
32+
<!-- Configure Log4j -->
33+
<bean name="org.apache.cocoon.spring.configurator.log4j"
34+
class="org.apache.cocoon.spring.configurator.log4j.Log4JConfigurator"
35+
scope="singleton">
36+
<property name="settings" ref="org.apache.cocoon.configuration.Settings"/>
37+
<property name="resource" value="/WEB-INF/log4j.xml"/>
38+
</bean>
39+
40+
<!-- Activate Avalon Bridge -->
41+
<avalon:bridge/>
42+
43+
</beans>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one or more
4+
contributor license agreements. See the NOTICE file distributed with
5+
this work for additional information regarding copyright ownership.
6+
The ASF licenses this file to You under the Apache License, Version 2.0
7+
(the "License"); you may not use this file except in compliance with
8+
the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
-->
18+
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
19+
20+
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
21+
<!--
22+
- This is a sample configuration for log4j.
23+
- It simply just logs everything into a single log file.
24+
- Note, that you can use properties for value substitution.
25+
-->
26+
<appender name="CORE" class="org.apache.log4j.FileAppender">
27+
<param name="File" value="${org.apache.cocoon.work.directory}/cocoon-logs/log4j.log" />
28+
<param name="Append" value="false" />
29+
<layout class="org.apache.log4j.PatternLayout">
30+
<param name="ConversionPattern" value="%d %-5p %t %c - %m%n"/>
31+
</layout>
32+
</appender>
33+
34+
<root>
35+
<priority value="${org.apache.cocoon.log4j.loglevel}"/>
36+
<appender-ref ref="CORE"/>
37+
</root>
38+
</log4j:configuration>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one or more
4+
contributor license agreements. See the NOTICE file distributed with
5+
this work for additional information regarding copyright ownership.
6+
The ASF licenses this file to You under the Apache License, Version 2.0
7+
(the "License"); you may not use this file except in compliance with
8+
the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
-->
18+
19+
<!--
20+
- This is the Cocoon web-app configurations file
21+
-
22+
- $Id$
23+
-->
24+
<web-app>
25+
<display-name>S2-001 Example</display-name>
26+
<filter>
27+
<filter-name>struts2</filter-name>
28+
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
29+
</filter>
30+
<filter-mapping>
31+
<filter-name>struts2</filter-name>
32+
<url-pattern>/*</url-pattern>
33+
</filter-mapping>
34+
<welcome-file-list>
35+
<welcome-file>index.jsp</welcome-file>
36+
</welcome-file-list>
37+
</web-app>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<%@ page language="java" contentType="text/html; charset=UTF-8"
2+
pageEncoding="UTF-8"%>
3+
<%@ taglib prefix="s" uri="/struts-tags" %>
4+
5+
<html>
6+
<head>
7+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
8+
<title>S2-001</title>
9+
</head>
10+
<body>
11+
<h2>S2-001 Demo</h2>
12+
<s:form action="login">
13+
<s:textfield name="username" label="username" />
14+
<s:textfield name="password" label="password" />
15+
<s:submit></s:submit>
16+
</s:form>
17+
</body>
18+
</html>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<%@ page language="java" contentType="text/html; charset=UTF-8"
2+
pageEncoding="UTF-8"%>
3+
<%@ taglib prefix="s" uri="/struts-tags" %>
4+
5+
<html>
6+
<head>
7+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
8+
<title>S2-001</title>
9+
</head>
10+
<body>
11+
<p>Hello <s:property value="username"></s:property></p>
12+
</body>
13+
</html>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Manifest-Version: 1.0
2+
Created-By: IntelliJ IDEA
3+
Built-By: VanHurts
4+
Build-Jdk: version 1.8.0_65
5+
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one or more
4+
contributor license agreements. See the NOTICE file distributed with
5+
this work for additional information regarding copyright ownership.
6+
The ASF licenses this file to You under the Apache License, Version 2.0
7+
(the "License"); you may not use this file except in compliance with
8+
the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
-->
18+
<!-- @version $Id: applicationContext.xml 561608 2007-08-01 00:33:12Z vgritsenko $ -->
19+
<beans xmlns="http://www.springframework.org/schema/beans"
20+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
21+
xmlns:util="http://www.springframework.org/schema/util"
22+
xmlns:configurator="http://cocoon.apache.org/schema/configurator"
23+
xmlns:avalon="http://cocoon.apache.org/schema/avalon"
24+
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
25+
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
26+
http://cocoon.apache.org/schema/configurator http://cocoon.apache.org/schema/configurator/cocoon-configurator-1.0.1.xsd
27+
http://cocoon.apache.org/schema/avalon http://cocoon.apache.org/schema/avalon/cocoon-avalon-1.0.xsd">
28+
29+
<!-- Activate Cocoon Spring Configurator -->
30+
<configurator:settings/>
31+
32+
<!-- Configure Log4j -->
33+
<bean name="org.apache.cocoon.spring.configurator.log4j"
34+
class="org.apache.cocoon.spring.configurator.log4j.Log4JConfigurator"
35+
scope="singleton">
36+
<property name="settings" ref="org.apache.cocoon.configuration.Settings"/>
37+
<property name="resource" value="/WEB-INF/log4j.xml"/>
38+
</bean>
39+
40+
<!-- Activate Avalon Bridge -->
41+
<avalon:bridge/>
42+
43+
</beans>

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL