Skip to content

Commit d9a2cb8

Browse files
committed
add the original cookbook app
1 parent d3ad30d commit d9a2cb8

File tree

84 files changed

+6326
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+6326
-0
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!/target/struts-cookbook.war

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
target/
2+
.idea/

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM docker.io/tomcat:9.0.87-jre21-temurin-jammy
2+
COPY target/struts-cookbook.war /usr/local/tomcat/webapps/
3+

mise.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[tools]
2+
maven = '3.9.9'
3+
java = 'zulu-21.40.17'

pom.xml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?xml version="1.0"?>
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+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
21+
22+
<modelVersion>4.0.0</modelVersion>
23+
<groupId>org.apache.struts</groupId>
24+
<artifactId>struts-cookbook</artifactId>
25+
<packaging>war</packaging>
26+
<name>Struts Apps - Cookbook</name>
27+
<version>1.0.0</version>
28+
29+
<dependencies>
30+
<dependency>
31+
<groupId>org.apache.struts</groupId>
32+
<artifactId>struts-taglib</artifactId>
33+
<version>1.3.10</version>
34+
</dependency>
35+
<dependency>
36+
<groupId>javax.servlet</groupId>
37+
<artifactId>servlet-api</artifactId>
38+
<version>2.3</version>
39+
<scope>provided</scope>
40+
</dependency>
41+
</dependencies>
42+
43+
<build>
44+
<finalName>${project.artifactId}</finalName>
45+
<resources>
46+
<resource>
47+
<directory>src/main/java</directory>
48+
<includes>
49+
<include>**/*.properties</include>
50+
</includes>
51+
</resource>
52+
</resources>
53+
<plugins>
54+
<plugin>
55+
<groupId>org.apache.maven.plugins</groupId>
56+
<artifactId>maven-war-plugin</artifactId>
57+
<version>3.4.0</version>
58+
</plugin>
59+
</plugins>
60+
</build>
61+
</project>

scripts/start.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
3+
set -eu
4+
5+
SCRIPT_DIR=$(realpath "$(dirname $BASH_SOURCE)")
6+
PROJECT_BASE_DIR=$(realpath "$SCRIPT_DIR/..")
7+
8+
APP_NAME=cookbook
9+
CONTAINER_NAME=springing-struts1-$APP_NAME
10+
DOCKER=$( (command -v podman &> /dev/null) && echo podman || echo docker )
11+
12+
main() {
13+
build && start
14+
}
15+
16+
build() {
17+
mvn clean package -U
18+
}
19+
20+
start() {
21+
$DOCKER build -t $CONTAINER_NAME . \
22+
&& $DOCKER rm -f $CONTAINER_NAME \
23+
&& $DOCKER run -d \
24+
-p 8080:8080 \
25+
-p 5005:5005 \
26+
--name $CONTAINER_NAME \
27+
--env DEBUG_PORT=5005 \
28+
$CONTAINER_NAME \
29+
&& $DOCKER logs -f $CONTAINER_NAME
30+
}
31+
32+
(cd "$PROJECT_BASE_DIR" \
33+
&& eval "$(mise env)" \
34+
&& main
35+
)
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
# -- Standard Errors --
17+
errors.header=<ul>
18+
errors.prefix=<li class="error">
19+
errors.suffix=</li>
20+
errors.footer=</ul>
21+
22+
# -- Struts Validator Error Messages --
23+
errors.required={0} is required.
24+
errors.minlength={0} can not be less than {1} characters.
25+
errors.maxlength={0} can not be greater than {1} characters.
26+
errors.invalid={0} is invalid.
27+
errors.byte={0} must be a byte.
28+
errors.short={0} must be a short.
29+
errors.integer={0} must be an integer.
30+
errors.long={0} must be a long.
31+
errors.float={0} must be a float.
32+
errors.double={0} must be a double.
33+
errors.date={0} is not a date.
34+
errors.range={0} is not in the range {1} through {2}.
35+
errors.creditcard={0} is an invalid credit card number.
36+
errors.email={0} is an invalid e-mail address.
37+
38+
# -- other --
39+
errors.cancel=Operation cancelled.
40+
errors.detail={0}
41+
errors.general=The process did not complete. Details should follow.
42+
errors.token=Request could not be completed. Operation is not in sequence.
43+
errors.twofields=The '{0}' field must have the same value as the '{1}' field.
44+
errors.name.required=Name is required.
45+
errors.secret.required=Please tell me a secret (it doesn't have to be true).
46+
47+
# -- formatting --
48+
format.date=M/d/yyyy h:mm a z
49+
format.currency=$#,##0.00;$(#,##0.00)
50+
51+
# -- buttons --
52+
button.submit=Submit
53+
button.cancel=Cancel
54+
button.confirm=Confirm
55+
button.reset=Reset
56+
button.save=Save
57+
58+
# -- messages --
59+
message.detail={0}
60+
message.example.simple=This is a simple message.
61+
message.example.replaceable=This is <strong>{0}</strong> message with <strong>{1}</strong> parameters.
62+
message.welcome=Welcome to the examples page.
63+
64+
# -- prompts --
65+
prompt.name=Name
66+
prompt.secret=Secret phrase
67+
68+
prompt.byte=Byte
69+
prompt.creditCard=Credit Card
70+
prompt.date=Date
71+
prompt.double=Double
72+
prompt.email=Email
73+
prompt.float=Float
74+
prompt.integer=Integer
75+
prompt.long=Long
76+
prompt.mask=Mask
77+
prompt.min=Min. Length
78+
prompt.max=Max. Length
79+
prompt.range=Range
80+
prompt.required=Required
81+
prompt.short=Short
82+
prompt.password=Password
83+
prompt.password2=Password confirmation
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
message.welcome=Willkommen zur Beispielseite.
17+
18+
# -- formatting --
19+
format.currency=$#.##0,00;$(#.##0,00)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
message.welcome=Welcome to the examples page, eh!
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
message.welcome=Welcome to the examples page. Would you care for a cuppa?

0 commit comments

Comments
 (0)