Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions spring-boot-xml/naive-spring-boot/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/mvnw text eol=lf
*.cmd text eol=crlf
33 changes: 33 additions & 0 deletions spring-boot-xml/naive-spring-boot/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
39 changes: 39 additions & 0 deletions spring-boot-xml/naive-spring-boot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<h1>Sample java spring boot with xml</h1>
<p>This project is a Spring Boot application that serves a simple REST API endpoint returning XML responses.</p>

<h2>How to Run</h2>
<p>Ensure you have Java 17 installed. Then, follow these steps:</p>
<ol>
<li>Clone the repository </li>
<li>Navigate into the project directory</li>
<li>Build the project: <code>mvn clean install</code></li>
<li>Run the application: <code>mvn spring-boot:run</code></li>
</ol>

<h2>API Endpoints</h2>
<h3>Get User (Returns XML)</h3>
<p>Endpoint: <code>GET /api/user</code></p>

<h3>Testing with Curl</h3>
<p>To make a request using <code>curl</code>, use the following command:</p>
<pre>
<code>curl -X GET -H "Accept: application/xml" http://localhost:8080/api/user</code>
</pre>

<h2>Expected XML Response</h2>
<pre>
<code>
&lt;User&gt;
&lt;name&gt;John Doe&lt;/name&gt;
&lt;age&gt;30&lt;/age&gt;
&lt;phone&gt;0101233333&lt;/phone&gt;
&lt;/User&gt;
</code>
</pre>

<h2>Dependencies</h2>
<ul>
<li>Spring Boot</li>
<li>Spring Web</li>
<li>JAXB for XML serialization</li>
</ul>
259 changes: 259 additions & 0 deletions spring-boot-xml/naive-spring-boot/mvnw

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading