ElaKiri Community
Downloads
Go Back   ElaKiri Community > Computers & Internet > Web Development
Reload this Page java web development 7 කොටස - JSTL
Reply
 
Thread Tools
(#1)
Old
J Sparrow's Avatar
J Sparrow J Sparrow is offline
Senior Member
J Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of light
 
Posts: 1,454
Join Date: Jan 2012
Location: 127.0.0.1
cool java web development 7 කොටස - JSTL - 09-19-2015, 11:22 PM

ඔන්න start කලා 7th java web development lesson එක.
මතක ඇතිනේ? කලින් lesson එකෙන් මම කිව්වා ඊළඟට කරන්නේ JSTL ගැන කියලා?

හරි! මොනවද මේ JSTL කියන්නේ?

බොලාට මතක ඇතිනේ අපි කලින් කරපු example වල scriplet use කලා?? මේ scriplets වෙලාවකට අපිට ඔනේ ඕනේ විදියට use කරන්න අමාරුයි.

උදාහරණයක් විදියට, අපිට loop එකක් run කරගන්න, database value එකක් access කරගන්න, XML data processing වලට, conditions check කරගන්න ගොඩක් වැදගත් වෙනවා.

ඔය මම උඩ කියපුවා ටික, scriplets වලින් කරන්න ගියෝතින් ගොඩාක් වෙලාවට නාගෙන තමයි නතර වෙන්නේ.
JSTL, java EE Web application වලම component එකක් හින්දා, වැඩි අමාරුවක් නැතුවම අපිට use කරගන්න පුළුවන්.

** මට බොලාට තේරුම් කරන්න ඕනේ මෙච්චරයි, JSTL කියන්නේ.., scriplets වලින් අපි කරපු දේවල්ම ඊට වඩා පහසුවෙන් කරගන්න උදව් වෙන component එකක්.

simple and easy! උඹලට පෙනෙයි ඉස්සරහට.



දැක්කනේ? ඔය තියෙන්නේ sample scriplet එකක්.

මේ තියෙන්නේ අපි කලින් කරපු project එකේ user.jsp page එක. පෙනවනේ just date and time readable විදියට print කරගන්න කාලා තියෙන කට්ට?



ඕනේ කර
අනිත් classes එහෙම import කරගන්න ඕනේ, එකින් එකට. ඒක මහ කරදරයක් බොලව්

JSTL අපිට classified කරන්න පුළුවන්, use වෙන functional ares අනූව.

1 - Core Tags
2 - Formatting tags
3 - SQL tags
4 - XML tags
5 - JSTL Functions

හරි, අපි එකින් එක tags අරගෙන examples කරලා බලමු. මම examples වලට සුපුරුදු project එකම තමයි use කරන්නේ

01 - Core Tags.

මුලින්ම බලමු මේ tag libs කොහොමද අපේ project එකට include කරගන්නේ කියලා. හරිම simple කොල්ලනේ!



දැක්කනේ? tag එකේ name එකෙන්ම පේනවා ඇති මේ import කරලා තියෙන්නේ core tag lib එක කියලා.

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

මේ එක එක classified tag area ඇතුලේ ඒකට අදාලව use කරන්න පුළුවන් tags ගොඩක් තියෙනවා. මම ඔක්කොම කියලා දෙන්නේ නෑ. ඕනේම කරන වැදගත්ම ටික කියලා දෙන්නම්.


(i) <c:out>
මොනවා හරි අපිට display කරගන්න තියෙන result set එකක් , value එකක් display කරගන්න තමයි <c:out> use වෙන්නේ
මේ තියෙන්නේ අපි backend එකෙන්, frontend එකට send කරපු username එක display කරගන්න <c:out> tage එක කරලා තියෙන විදිය.



මේ result එක,


(ii) <c:set>
නමින්ම තේරෙනවනේ? මොකක් හරි variable එකක් declair කරලා, ඒක jsp page එක ඇතුලේ ඕනේම තැනක access කරගන්න තමයි මේ tag එක use කරන්නේ.



මේ..?



මේ result එක,


කලින් වගේම තමයි.

(iii) <c:if>
සාමාන්‍යයෙන් if condition එකකින් වෙන්න ඕනේ දේ මෙයා කරලා දෙනවා!


ඔන්න result එක



(iv) <c:forEach>
loop එකක් එහෙම දාගන්න කියාපු tag එක බොලව්.



මේ result එක,



හරි! අදට මෙච්චරයි!
to be continued ආහ්! Keep in touch!
Reply With Quote
(#2)
Old
kmc madushan's Avatar
kmc madushan kmc madushan is offline
Senior Member
kmc madushan is a splendid one to beholdkmc madushan is a splendid one to beholdkmc madushan is a splendid one to beholdkmc madushan is a splendid one to beholdkmc madushan is a splendid one to beholdkmc madushan is a splendid one to beholdkmc madushan is a splendid one to beholdkmc madushan is a splendid one to beholdkmc madushan is a splendid one to beholdkmc madushan is a splendid one to beholdkmc madushan is a splendid one to behold
 
Posts: 25,038
Join Date: Feb 2011
Location: LK
09-19-2015, 11:25 PM

Reply With Quote
(#3)
Old
Geshi95's Avatar
Geshi95 Geshi95 is offline
Senior Member
Geshi95 is just really niceGeshi95 is just really niceGeshi95 is just really niceGeshi95 is just really niceGeshi95 is just really niceGeshi95 is just really niceGeshi95 is just really niceGeshi95 is just really niceGeshi95 is just really niceGeshi95 is just really nice
 
Posts: 785
Join Date: Jun 2015
Location: ගෙදර තමයි ඉතින්
09-20-2015, 12:06 AM

bumpppppppppp
Reply With Quote
(#4)
Old
J Sparrow's Avatar
J Sparrow J Sparrow is offline
Senior Member
J Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of light
 
Posts: 1,454
Join Date: Jan 2012
Location: 127.0.0.1
09-20-2015, 08:46 AM

Quote:
Originally Posted by kmc madushan View Post
Quote:
Originally Posted by Geshi95 View Post
bumpppppppppp
Thank you machanlaaaa
Reply With Quote
(#5)
Old
^Buddhika^ ^Buddhika^ is offline
Senior Member
^Buddhika^ is a splendid one to behold^Buddhika^ is a splendid one to behold^Buddhika^ is a splendid one to behold^Buddhika^ is a splendid one to behold^Buddhika^ is a splendid one to behold^Buddhika^ is a splendid one to behold^Buddhika^ is a splendid one to behold^Buddhika^ is a splendid one to behold^Buddhika^ is a splendid one to behold^Buddhika^ is a splendid one to behold^Buddhika^ is a splendid one to behold
 
Posts: 19,740
Join Date: Jun 2013
09-20-2015, 08:52 AM

good work machan keep it up
Reply With Quote
(#6)
Old
ranilplus's Avatar
ranilplus ranilplus is offline
Senior Member
ranilplus will become famous soon enough
 
Posts: 515
Join Date: Nov 2008
Location: Athugalpura
09-20-2015, 09:16 AM

bump
Reply With Quote
(#7)
Old
manarrow's Avatar
manarrow manarrow is offline
Senior Member
manarrow is a glorious beacon of lightmanarrow is a glorious beacon of lightmanarrow is a glorious beacon of lightmanarrow is a glorious beacon of lightmanarrow is a glorious beacon of lightmanarrow is a glorious beacon of lightmanarrow is a glorious beacon of lightmanarrow is a glorious beacon of lightmanarrow is a glorious beacon of lightmanarrow is a glorious beacon of lightmanarrow is a glorious beacon of light
 
Posts: 3,070
Join Date: Jan 2015
09-20-2015, 10:01 AM

adoo... bump yakoooooo
Reply With Quote
(#8)
Old
MihiCherub's Avatar
MihiCherub MihiCherub is offline
Senior Member
MihiCherub is a splendid one to beholdMihiCherub is a splendid one to beholdMihiCherub is a splendid one to beholdMihiCherub is a splendid one to beholdMihiCherub is a splendid one to beholdMihiCherub is a splendid one to beholdMihiCherub is a splendid one to beholdMihiCherub is a splendid one to beholdMihiCherub is a splendid one to beholdMihiCherub is a splendid one to beholdMihiCherub is a splendid one to behold
 
Posts: 12,444
Join Date: Sep 2009
Location: No:██████, Gampaha
Send a message via Skype™ to MihiCherub
09-20-2015, 10:05 AM

TFS
Reply With Quote
(#9)
Old
J Sparrow's Avatar
J Sparrow J Sparrow is offline
Senior Member
J Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of lightJ Sparrow is a glorious beacon of light
 
Posts: 1,454
Join Date: Jan 2012
Location: 127.0.0.1
09-20-2015, 10:20 AM

Quote:
Originally Posted by ^Buddhika^ View Post
good work machan keep it up
Quote:
Originally Posted by ranilplus View Post
bump
Quote:
Originally Posted by manarrow View Post
adoo... bump yakoooooo
Quote:
Originally Posted by MihiCherub View Post
TFS
thank you kollaneeeee
Reply With Quote
(#10)
Old
TakaTakas's Avatar
TakaTakas TakaTakas is offline
Senior Member
TakaTakas is just really niceTakaTakas is just really niceTakaTakas is just really niceTakaTakas is just really niceTakaTakas is just really niceTakaTakas is just really niceTakaTakas is just really niceTakaTakas is just really niceTakaTakas is just really niceTakaTakas is just really nice
 
Posts: 2,869
Join Date: Nov 2014
Location: ගෙදර
09-20-2015, 11:37 AM

ගොඩක් ස්තූතියි.අලුතෙන් ත්‍රෙඩ් එකක් දානකොට මේ සීරීස් එකේ පරණ ලින්ක් සේරම දාපන් මචං මගහැරණ ඒව අල්ලගන්න.
Reply With Quote
Reply

Bookmarks

Tags
java, java course, jsparrow, jstl, web development

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright © 2006 - 2011 ElaKiri™ Beta2.Evo vBulletin, vBa iBproArcade Subdreamer I-Magic MKv

Page generated in 0.02758 seconds with 9 queries