Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
2
20240528-BJava
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
20240528-BJava
Commits
fdfd13e3
Commit
fdfd13e3
authored
Jun 12, 2024
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WebSklep - Poprawka konfiguracji
parent
c48e2a06
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
157 additions
and
54 deletions
+157
-54
pom.xml
PC24-SklepWeb/pom.xml
+21
-11
HelloServlet.java
...src/main/java/pl/alx/kjava/pc24sklepweb/HelloServlet.java
+0
-29
index.html
PC24-SklepWeb/src/main/webapp/index.html
+39
-0
index.jsp
PC24-SklepWeb/src/main/webapp/index.jsp
+0
-14
styl.css
PC24-SklepWeb/src/main/webapp/styl.css
+97
-0
No files found.
PC24-SklepWeb/pom.xml
View file @
fdfd13e3
...
...
@@ -12,9 +12,7 @@
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<maven.compiler.target>
11
</maven.compiler.target>
<maven.compiler.source>
11
</maven.compiler.source>
<junit.version>
5.10.0
</junit.version>
<maven.compiler.release>
21
</maven.compiler.release>
</properties>
<dependencies>
...
...
@@ -25,25 +23,37 @@
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
org.junit.jupiter
</groupId>
<artifactId>
junit-jupiter-api
</artifactId>
<version>
${junit.version}
</version>
<scope>
test
</scope>
<groupId>
jakarta.servlet.jsp.jstl
</groupId>
<artifactId>
jakarta.servlet.jsp.jstl-api
</artifactId>
<version>
3.0.0
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
org.glassfish.web
</groupId>
<artifactId>
jakarta.servlet.jsp.jstl
</artifactId>
<version>
3.0.1
</version>
<!-- jbc Maven pozwala też podawać zakresy wersji, ale wtedy mamy 'niestabilne buildy'
<version>[3.0.0, 4)</version>-->
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
org.
junit.jupiter
</groupId>
<artifactId>
junit-jupiter-engine
</artifactId>
<version>
${junit.version}
</version>
<scope>
test
</scope>
<groupId>
org.
postgresql
</groupId>
<artifactId>
postgresql
</artifactId>
<version>
42.7.3
</version>
<scope>
runtime
</scope>
</dependency>
</dependencies>
<build>
<finalName>
${project.artifactId}
</finalName>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-war-plugin
</artifactId>
<version>
3.4.0
</version>
<configuration>
<failOnMissingWebXml>
false
</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
...
...
PC24-SklepWeb/src/main/java/pl/alx/kjava/pc24sklepweb/HelloServlet.java
deleted
100644 → 0
View file @
c48e2a06
package
pl
.
alx
.
kjava
.
pc24sklepweb
;
import
java.io.*
;
import
jakarta.servlet.http.*
;
import
jakarta.servlet.annotation.*
;
@WebServlet
(
name
=
"helloServlet"
,
value
=
"/hello-servlet"
)
public
class
HelloServlet
extends
HttpServlet
{
private
String
message
;
public
void
init
()
{
message
=
"Hello World!"
;
}
public
void
doGet
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
response
.
setContentType
(
"text/html"
);
// Hello
PrintWriter
out
=
response
.
getWriter
();
out
.
println
(
"<html><body>"
);
out
.
println
(
"<h1>"
+
message
+
"</h1>"
);
out
.
println
(
"</body></html>"
);
}
public
void
destroy
()
{
}
}
\ No newline at end of file
PC24-SklepWeb/src/main/webapp/index.html
0 → 100644
View file @
fdfd13e3
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"UTF-8"
>
<title>
Sklep - spis treści
</title>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"styl.css"
>
</head>
<body>
<h1>
Sklep Web
</h1>
<h2>
Lista produktów w różnych wersjach
</h2>
<h3>
Wersje niedoskonałe, nie do naśladowania.
</h3>
<ul>
<li><a
href=
"products0"
>
wersja 0
</a>
- samodzielny prosty serwlet
</li>
<li><a
href=
"products1"
>
wersja 1
</a>
- serwlet oparty o klasy DAO
</li>
<li><a
href=
"products2"
>
wersja 2
</a>
- serwlet oparty o klasy DAO z HTMLem
</li>
<li><a
href=
"products3.jsp"
>
wersja 3
</a>
- JSP ze skryptletami
</li>
<li><a
href=
"products4.jsp"
>
wersja 4
</a>
- JSP z tagami SQL
</li>
</ul>
<h3>
Wersje przyzwoite ;-)
</h3>
<ul>
<li><a
href=
"products5.jsp"
>
wersja 5
</a>
- JSP oparty o klasę bean
</li>
<li><a
href=
"products6.jsp"
>
wersja 6
</a>
- wyszukiwanie wg ceny - bean
</li>
<li><a
href=
"products7.jsp"
>
wersja 7
</a>
- fotki
</li>
<li><a
href=
"products8.jsp"
>
wersja 8
</a>
- koszyk
</li>
<li><a
href=
"products9.jsp"
>
wersja 9
</a>
- edycja produktów
</li>
</ul>
<h3>
Dodatkowe strony
</h3>
<ul>
<li><a
href=
"photo?productId=2"
>
Foto
</a>
- przykładowe zdjęcie
</li>
<li><a
href=
"photo_upload.jsp?productId=2"
>
Zmień zdjęcie
</a>
nr 2
</li>
<li><a
href=
"edit_product?productId=1"
>
Edytuj produkt nr 1
</a></li>
<li><a
href=
"edit_product"
>
Dodaj nowy produkt
</a></li>
</ul>
</body>
</html>
PC24-SklepWeb/src/main/webapp/index.jsp
deleted
100644 → 0
View file @
c48e2a06
<
%@
page
contentType=
"text/html; charset=UTF-8"
pageEncoding=
"UTF-8"
%
>
<!DOCTYPE html>
<html>
<head>
<title>
JSP - Hello World
</title>
</head>
<body>
<h1><
%=
"
Hello
World
!"
%
>
</h1>
<br/>
<a
href=
"hello-servlet"
>
Hello Servlet
</a>
</body>
</html>
\ No newline at end of file
PC24-SklepWeb/src/main/webapp/styl.css
0 → 100644
View file @
fdfd13e3
body
{
background-color
:
#FFFFDD
;
font-family
:
'Arial'
,
sans-serif
;
}
/* komentarz w CSS */
h4
{
text-align
:
center
;
}
h2
,
h3
,
h4
{
margin-top
:
0
;
}
.product
{
border
:
solid
2px
blue
;
margin
:
1em
auto
1em
50px
;
padding
:
1em
;
background-color
:
white
;
width
:
800px
;
min-height
:
230px
;
clear
:
right
;
}
.koszyk
{
position
:
fixed
;
right
:
0
;
top
:
0
;
width
:
300px
;
height
:
400px
;
background-color
:
white
;
border
:
outset
3px
green
;
}
#wyszukiwarka
{
background-color
:
#AAEEFF
;
width
:
800px
;
border
:
2px
black
solid
;
margin
:
1em
400px
1em
50px
;
padding
:
1em
;
}
.error
{
background-color
:
#FFFFFF
;
border
:
6px
double
red
;
margin
:
20px
;
padding
:
10px
;
color
:
red
;
}
.photo
{
display
:
block
;
float
:
right
;
max-width
:
300px
;
max-height
:
200px
;
margin
:
5px
;
}
.description
{
font-size
:
smaller
;
font-style
:
italic
;
}
div
.action
{
font-size
:
smaller
;
font-family
:
'Arial'
,
sans-serif
;
font-weight
:
bold
;
background-color
:
#DDDDDD
;
border
:
2px
#444466
outset
;
padding
:
6px
;
margin
:
4px
auto
4px
4px
;
max-width
:
200px
;
}
.action
:hover
{
background-color
:
#EEEEEE
;
border
:
2px
#4455CC
outset
;
}
.action
:active
{
background-color
:
#EEEEEE
;
border
:
2px
#CC4455
inset
;
}
.action
a
{
display
:
inline-block
;
color
:
inherit
;
text-decoration
:
none
;
width
:
100%
;
}
.action
a
:hover
{
color
:
#0000CC
;
}
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