Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
javab_20230617
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_20230617
Commits
6bfd981e
Commit
6bfd981e
authored
Jul 01, 2023
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JSP2 - beany
parent
bf5e6d85
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
38 deletions
+61
-38
.gitignore
PC23-Servlety/.gitignore
+1
-0
pom.xml
PC23-Servlety/pom.xml
+42
-38
przyklad2.jsp
PC23-Servlety/src/main/webapp/przyklad2.jsp
+18
-0
No files found.
PC23-Servlety/.gitignore
View file @
6bfd981e
...
...
@@ -8,6 +8,7 @@ target/
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
.idea/webContexts.xml
*.iws
*.iml
*.ipr
...
...
PC23-Servlety/pom.xml
View file @
6bfd981e
...
...
@@ -2,47 +2,50 @@
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
pl.alx.kjava
</groupId>
<artifactId>
PC23-Servlety
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<name>
PC23-Servlety
</name>
<packaging>
war
</packaging>
<groupId>
pl.alx.kjava
</groupId>
<artifactId>
PC23-Servlety
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<name>
PC23-Servlety
</name>
<packaging>
war
</packaging>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<maven.compiler.target>
17
</maven.compiler.target>
<maven.compiler.source>
17
</maven.compiler.source>
<junit.version>
5.9.2
</junit.version>
</properties>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<maven.compiler.target>
17
</maven.compiler.target>
<maven.compiler.source>
17
</maven.compiler.source>
<junit.version>
5.9.2
</junit.version>
</properties>
<dependencies>
<dependency>
<groupId>
jakarta.servlet
</groupId>
<artifactId>
jakarta.servlet-api
</artifactId>
<version>
5.0.0
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
org.junit.jupiter
</groupId>
<artifactId>
junit-jupiter-api
</artifactId>
<version>
${junit.version}
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.junit.jupiter
</groupId>
<artifactId>
junit-jupiter-engine
</artifactId>
<version>
${junit.version}
</version>
<scope>
test
</scope>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>
jakarta.servlet
</groupId>
<artifactId>
jakarta.servlet-api
</artifactId>
<version>
5.0.0
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
jakarta.servlet.jsp.jstl
</groupId>
<artifactId>
jakarta.servlet.jsp.jstl-api
</artifactId>
<version>
3.0.0
</version>
<build>
</dependency>
<!-- stara klasyczna wersja - tylko dla starszych serwerów -->
<!-- <dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
-->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-war-plugin
</artifactId>
<version>
3.3.2
</version>
</plugin>
</plugins>
</build>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-war-plugin
</artifactId>
<version>
3.3.2
</version>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
PC23-Servlety/src/main/webapp/przyklad2.jsp
View file @
6bfd981e
<
%@
page
contentType=
"text/html;charset=UTF-8"
language=
"java"
%
>
<
%@
taglib
prefix=
"c"
uri=
"jakarta.tags.core"
%
>
<html>
<head>
<title>
Przyklad 2 JSP
</title>
...
...
@@ -35,5 +36,22 @@
Gdy
wpiszemy
co
ś
z
nawiasami
na
ko
ń
cu
,
to
jest
to
wywo
ł
anie
metody
,
--
%
>
<
%
--
Biblioteka
tag
ó
w
("
taglib
")
to
jest
zestaw
polece
ń
zapisywanych
w
formie
znacznik
ó
w
w
obr
ę
bie
JSP
.
Te
znaczniki
zawsze
s
ą
poprzedzane
prefiksem
,
np
.
<
c:if
>
....
Tagliby można definiować samodzielnie, ale w 98% przypadków używa się zestawu nazywanego JSTL
"Java Standard Tag Library"
--%>
<h3>
Taglibs
</h3>
<ul>
<c:forEach
var=
"i"
items=
"5,10,15"
>
<li>
${i}
<c:choose>
<c:when
test=
"${i % 2 == 0}"
>
parzyste
</c:when>
<c:otherwise>
nieparzyste
</c:otherwise>
</c:choose>
</li>
</c:forEach>
</ul>
</body>
</html>
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