Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
alx_java2b_20250412
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
alx_java2b_20250412
Commits
deb643fc
Commit
deb643fc
authored
Apr 27, 2025
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
arkusz stylu CSS
parent
95d0f5e7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
3 deletions
+34
-3
Kalkulator.java
PC22-Serwlety/src/main/java/serwlety/Kalkulator.java
+4
-3
index.html
PC22-Serwlety/src/main/webapp/index.html
+1
-0
przyklad.jsp
PC22-Serwlety/src/main/webapp/przyklad.jsp
+1
-0
styl.css
PC22-Serwlety/src/main/webapp/styl.css
+28
-0
No files found.
PC22-Serwlety/src/main/java/serwlety/Kalkulator.java
View file @
deb643fc
...
...
@@ -23,13 +23,14 @@ public class Kalkulator extends HttpServlet {
<html>
<head>
<title>Rozmowa z serwletem</title>
<link rel="
stylesheet
" type="
text
/
css
" href="
styl
.
css
">
</head>
<body>
<h1>Rozmowa z serwletem</h1>
"""
);
out
.
append
(
"""
<form>
<form
class='kalkulator'
>
Podaj pierwszą liczbę: <input type='number' name='liczba1'><br>
Podaj drugą liczbę: <input type='number' name='liczba2'><br>
Podaj znak działania:
...
...
@@ -58,9 +59,9 @@ public class Kalkulator extends HttpServlet {
case
"%"
->
x
%
y
;
default
->
0
;
};
out
.
append
(
"<div>Wynik: "
+
wynik
+
"</div>"
);
out
.
append
(
"<div
class='wynik'
>Wynik: "
+
wynik
+
"</div>"
);
}
catch
(
Exception
e
)
{
out
.
append
(
"<div>Błąd: "
+
e
+
"</div>"
);
out
.
append
(
"<div
class='error'
>Błąd: "
+
e
+
"</div>"
);
}
}
...
...
PC22-Serwlety/src/main/webapp/index.html
View file @
deb643fc
...
...
@@ -2,6 +2,7 @@
<html>
<head>
<meta
charset=
"UTF-8"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"styl.css"
>
<title>
Aplikacja serwletowa
</title>
</head>
<body>
...
...
PC22-Serwlety/src/main/webapp/przyklad.jsp
View file @
deb643fc
...
...
@@ -6,6 +6,7 @@
<html>
<head>
<meta
charset=
"UTF-8"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"styl.css"
>
<title>
Przykład pliku JSP
</title>
</head>
<body>
...
...
PC22-Serwlety/src/main/webapp/styl.css
0 → 100644
View file @
deb643fc
@charset
"UTF-8"
;
body
{
background-color
:
#FFFFDD
;
}
.kalkulator
{
background-color
:
#CCEEFF
;
border
:
solid
2px
blue
;
margin
:
1em
2em
;
padding
:
1em
;
}
.wynik
{
background-color
:
#C8FFD0
;
border
:
solid
2px
green
;
margin
:
1em
2em
;
padding
:
1em
;
}
.error
{
background-color
:
white
;
color
:
red
;
border
:
solid
2px
red
;
margin
:
1em
2em
;
padding
:
1em
;
}
\ No newline at end of file
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