Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
java_dzienna_15_09
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Patryk Czarnik
java_dzienna_15_09
Commits
c4a07b10
Commit
c4a07b10
authored
Sep 28, 2022
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
poprawki w info
parent
139f0d36
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
Info.java
PC25-Serwlety/src/main/java/techniczne/Info.java
+3
-3
index.html
PC25-Serwlety/src/main/webapp/index.html
+5
-4
No files found.
PC25-Serwlety/src/main/java/techniczne/Info.java
View file @
c4a07b10
...
...
@@ -15,7 +15,7 @@ import javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse
;
// Można spróbować z takimi parametrami:
// http://localhost:8080/PC2
4
-Serwlety/Info?x=Ala&y=Ola&x=Ela&x=Ula&z=Asia
// http://localhost:8080/PC2
5
-Serwlety/Info?x=Ala&y=Ola&x=Ela&x=Ula&z=Asia
@WebServlet
(
"/Info"
)
// mogłby być też wpis w web.xml
public
class
Info
extends
HttpServlet
{
...
...
@@ -52,8 +52,8 @@ public class Info extends HttpServlet {
out
.
println
(
"x jako tablica: "
+
Arrays
.
toString
(
wartosciX
));
out
.
println
(
"Wszystkie parametry:"
);
for
(
Map
.
Entry
e
:
request
.
getParameterMap
().
entrySet
())
{
String
[]
v
=
(
String
[])
e
.
getValue
();
for
(
Map
.
Entry
<
String
,
String
[]>
e
:
request
.
getParameterMap
().
entrySet
())
{
String
[]
v
=
e
.
getValue
();
out
.
println
(
" * "
+
e
.
getKey
()
+
" : "
+
Arrays
.
toString
(
v
));
}
out
.
println
();
...
...
PC25-Serwlety/src/main/webapp/index.html
View file @
c4a07b10
...
...
@@ -15,6 +15,7 @@
<li><a
href=
"Hello"
>
serwlet Hello
</a></li>
<li><a
href=
"Ping"
>
Ping
</a></li>
<li><a
href=
"Info"
>
Info
</a>
- informacje techniczne o zapytaniu
</li>
<li><a
href=
"Info?x=Ala&y=Ola&x=Ela&x=Ula&z=Asia"
>
Info z prametrami
</a></li>
</ul>
<h3>
Pierwsze parametry
</h3>
...
...
@@ -28,10 +29,10 @@
<h3>
Kalkulator
</h3>
<ul>
<li><a
href=
"Kalulator1"
>
Kalkulator1
</a>
- tylko dodawanie
</li>
<li><a
href=
"Kalulator2"
>
Kalkulator2
</a>
- wiele działań, GET
</li>
<li><a
href=
"Kalulator3"
>
Kalkulator3
</a>
- formularz typu POST
</li>
<li><a
href=
"Kalulator4"
>
Kalkulator4
</a>
- zrefaktoryzowany POST
</li>
<li><a
href=
"Kal
k
ulator1"
>
Kalkulator1
</a>
- tylko dodawanie
</li>
<li><a
href=
"Kal
k
ulator2"
>
Kalkulator2
</a>
- wiele działań, GET
</li>
<li><a
href=
"Kal
k
ulator3"
>
Kalkulator3
</a>
- formularz typu POST
</li>
<li><a
href=
"Kal
k
ulator4"
>
Kalkulator4
</a>
- zrefaktoryzowany POST
</li>
</ul>
</body>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment