Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
javab_20230928
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
javab_20230928
Commits
aca3e115
Commit
aca3e115
authored
Oct 17, 2023
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apache commons
parent
32adc303
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
pom.xml
PC24-Serwlety/pom.xml
+6
-1
Kalkulator.java
PC24-Serwlety/src/main/java/podstawy/Kalkulator.java
+3
-1
No files found.
PC24-Serwlety/pom.xml
View file @
aca3e115
...
@@ -32,7 +32,6 @@
...
@@ -32,7 +32,6 @@
<version>
3.0.1
</version>
<version>
3.0.1
</version>
<scope>
provided
</scope>
<scope>
provided
</scope>
</dependency>
</dependency>
<!-- stara klasyczna wersja - tylko dla starszych serwerów. Java EE 8 lub starsze: -->
<!-- stara klasyczna wersja - tylko dla starszych serwerów. Java EE 8 lub starsze: -->
<!-- <dependency>
<!-- <dependency>
<groupId>javax.servlet</groupId>
<groupId>javax.servlet</groupId>
...
@@ -40,6 +39,12 @@
...
@@ -40,6 +39,12 @@
<version>1.2</version>
<version>1.2</version>
</dependency>
</dependency>
-->
-->
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-lang3
</artifactId>
<version>
3.12.0
</version>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
PC24-Serwlety/src/main/java/podstawy/Kalkulator.java
View file @
aca3e115
...
@@ -3,6 +3,8 @@ package podstawy;
...
@@ -3,6 +3,8 @@ package podstawy;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.PrintWriter
;
import
java.io.PrintWriter
;
import
org.apache.commons.lang3.StringUtils
;
import
jakarta.servlet.ServletException
;
import
jakarta.servlet.ServletException
;
import
jakarta.servlet.annotation.WebServlet
;
import
jakarta.servlet.annotation.WebServlet
;
import
jakarta.servlet.http.HttpServlet
;
import
jakarta.servlet.http.HttpServlet
;
...
@@ -47,7 +49,7 @@ public class Kalkulator extends HttpServlet {
...
@@ -47,7 +49,7 @@ public class Kalkulator extends HttpServlet {
String
arg2
=
request
.
getParameter
(
"liczba2"
);
String
arg2
=
request
.
getParameter
(
"liczba2"
);
String
operacja
=
request
.
getParameter
(
"operacja"
);
String
operacja
=
request
.
getParameter
(
"operacja"
);
if
(
arg1
!=
null
&&
arg2
!=
null
)
{
if
(
StringUtils
.
isNoneBlank
(
arg1
,
arg2
,
operacja
)
)
{
long
liczba1
=
Long
.
parseLong
(
arg1
);
long
liczba1
=
Long
.
parseLong
(
arg1
);
long
liczba2
=
Long
.
parseLong
(
arg2
);
long
liczba2
=
Long
.
parseLong
(
arg2
);
long
wynik
=
oblicz
(
liczba1
,
liczba2
,
operacja
);
long
wynik
=
oblicz
(
liczba1
,
liczba2
,
operacja
);
...
...
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