ServletConfig and ServletContext

  Рет қаралды 178,927

Telusko

Telusko

Күн бұрын

Practical implementation of ServletConfig and ServletContext
They both are interface.
ServletConfig and ServletContext both are used to get initial value of servlet or an application.
The values are stored in key value pair.
context-param and context-name tags are used to store the values.
In ServletContext values are shared by all the servlets
Whereas in ServletConfig values each servlet can have independent values.
In this video we will see :
- Example of ServletConfig and ServletContext
- web.xml
- context param tag
- context name tag
- Using servlet context
- creating object of servlet context
- Fetching value using servlet context object
- getInitParameter to fetch value
- Using servlet config
- create servlet level value
- create object of servlet config
- fetching value through servlet config object
Editing Monitors :
amzn.to/2RfKWgL
amzn.to/2Q665JW
amzn.to/2OUP21a.
Check out our website: www.telusko.com
Follow Telusko on Twitter: / navinreddy20
Follow on Facebook:
Telusko : / teluskolearn. .
Navin Reddy : / navintelusko
Follow Navin Reddy on Instagram: / navinreddy20
Subscribe to our other channel:
Navin Reddy : kzfaq.info/love/xmk...
Telusko Hindi :
kzfaq.info/love/itz...
Donation:
PayPal Id : navinreddy20
Patreon : navinreddy20
www.telusko.com/contactus

Пікірлер: 106
@wilsoncardoso150
@wilsoncardoso150 6 жыл бұрын
I just came here to say thank you so much for sharing and explaining the knowledge that you have, you explain with so much patient and passion that I was able to understand completely. Keep up the good work.
@samuelsodagudi
@samuelsodagudi 6 жыл бұрын
hi, @4:10 you have missed to type [response.setContentType("text/html");] , thats the reason your is displaying in browser. Always like to watch your videos. Keep on uploading the latest updates. Thank you Naveen Sir.
@nooobgammer
@nooobgammer 5 жыл бұрын
Yep bro
@arjunrao503
@arjunrao503 3 жыл бұрын
Its working
@AlphaGamingWorld
@AlphaGamingWorld 3 жыл бұрын
I didn't did anything you told and I can use html tags in print writer and they are working. I don't know why. Maybe because I am using println instead of print.
@mohammedzaid3829
@mohammedzaid3829 2 жыл бұрын
@@AlphaGamingWorld it basically depends on browser,,some browser take br tag as plain whereas some take it as tag(gives new line )>>which is your case,,for safer side setcontenttype is used
@memezthug1507
@memezthug1507 15 күн бұрын
Where to add this bro After out.print("hi")?
@rajashekarreddy2461
@rajashekarreddy2461 6 жыл бұрын
Here we expect something unique from other videos, like how it works rather than what is it. Thanks nice
@priyankadabe7277
@priyankadabe7277 3 жыл бұрын
People Like u..really build the world.. Telusko clears every concept.very neatly.. Thanks!!! Brilliant.
@swathiallu9819
@swathiallu9819 6 жыл бұрын
Very clear explanation. Thanks a lot for this video. Please make some more videos on this topic with realtime examples.
@yogiraj_dange8130
@yogiraj_dange8130 6 жыл бұрын
Please do videos on software testing. You explain really very well. I love to learn from you.. Thank you
@trendingvideos2517
@trendingvideos2517 6 жыл бұрын
Excellent and clear explanation.Thank you for uploading.
@karthikavijayaraghavan1263
@karthikavijayaraghavan1263 4 жыл бұрын
Its very clear. All your videos are very useful to understand the concepts v clearly Sir. Thanks a ton
@greecemathapamagar7085
@greecemathapamagar7085 4 жыл бұрын
Sir ur too amazing, god bless u, and u keep blessing us with ur wonderful understandable videos
@indianentertainer9895
@indianentertainer9895 Жыл бұрын
As always simple and Clear fantastic explanation 👏❤️
@realhealthywater7135
@realhealthywater7135 3 жыл бұрын
Super Super clean and clear example of servlet config and servlet context. WOW
@andregoulbourne839
@andregoulbourne839 3 жыл бұрын
Great Explanation! Straight to the Point.
@anujkumbhar2075
@anujkumbhar2075 6 жыл бұрын
i watch so many videos on dis topic..bt i could nt understand. after then dis video help me to understand the diff. b/w config and context.... thank uh sir....
@pradeepsolanki1963
@pradeepsolanki1963 5 жыл бұрын
Nicely explained, Thanks.
@javascriptwar9525
@javascriptwar9525 5 жыл бұрын
Thankyou very much sir... it means for readability we can mention url of database, username and password also in web. xml file no need to go for changing in servlet class...☺
@jeremyFaden
@jeremyFaden Жыл бұрын
I would love to hear more about META-INF/context.xml, where you can have the the same web application running serveral times with different configurations in the same Tomcat instance. At least I think that's the case, and I'm having trouble finding documentation for it. Thanks for the video!
@FaizanShaikh-pp1kg
@FaizanShaikh-pp1kg 6 жыл бұрын
Very nicely explained...
@shreyanshjain2347
@shreyanshjain2347 6 жыл бұрын
Nicely explained.
@mahimashah9919
@mahimashah9919 5 жыл бұрын
Well explained 👏🏻
@saurabrakshit405
@saurabrakshit405 4 жыл бұрын
nicely understood sir ! ! ! ! !
@sandeeprapolusandeeprapolu
@sandeeprapolusandeeprapolu 6 жыл бұрын
Your are awesome sir
@ShivamKendre-fc3su
@ShivamKendre-fc3su 2 жыл бұрын
great explanation
@velliyangiria1554
@velliyangiria1554 2 жыл бұрын
Great video
@wpatyune1631
@wpatyune1631 3 жыл бұрын
So if connect to the DB, it would be servlet context to share all servlet? and you call it to every time to different servlet?
@blaxminarayanpatra7311
@blaxminarayanpatra7311 6 жыл бұрын
thank u for uploading this video and sir if possible please tell how internally serveltConfig and servletContext will work
@nissinjad7455
@nissinjad7455 2 жыл бұрын
Hi Telusko, I wanna ask : between using JavaScript and Using Filter to check wether data in the form are right before to sending to a servlet, which one of the choices is the best.???
@lulubegaga
@lulubegaga 5 жыл бұрын
Hi, can anyone help me, please? What should I write in the home.jsp file in order to access the servlet, since he's not using a form nor an href? It seems to go automatically from home.jsp straight to the servlet.
@abcdef6435
@abcdef6435 4 жыл бұрын
Hello sir, can you explain what is "protected" in your servlet file that you
@ayoubanbara1685
@ayoubanbara1685 4 жыл бұрын
Thank you
@kirangiri8394
@kirangiri8394 5 жыл бұрын
why do you use /home in url pattern please help my code is not runnig...........?????
@ksaikumarnaik271
@ksaikumarnaik271 4 жыл бұрын
Same problem bro... if u got the answer plss reply why /home
@boberteroberte
@boberteroberte 4 жыл бұрын
@KsaikumarNaik This worked for me. Just create an empty home.jsp and when you run from the server, make sure you are in the tab of MyServlet and double click and run as ..server etc.. and it will work.
@akshayalakshmanan3674
@akshayalakshmanan3674 4 жыл бұрын
@@boberteroberte Thanks brother
@sagarmeena0210
@sagarmeena0210 6 жыл бұрын
amazing
@surajtopal9940
@surajtopal9940 3 жыл бұрын
thanks a lot sir ji
@benjaminroy6610
@benjaminroy6610 5 жыл бұрын
Can we use both of them with annotation instead of writing in .xml file? If yes how. Thank you for your videos.
@NitinYadav-vs9qq
@NitinYadav-vs9qq 5 жыл бұрын
Sir which book do we use for jsp and servlet
@user-gb7cp5vz4q
@user-gb7cp5vz4q 2 жыл бұрын
oooo thanks!
@sankar0446
@sankar0446 5 жыл бұрын
Thanks sir
@sravyav2623
@sravyav2623 5 жыл бұрын
How to specify context and config parameter values if we don't use web.xml and use annotations
@immortalhuman7085
@immortalhuman7085 6 жыл бұрын
Thanks
@nehakiran7991
@nehakiran7991 6 жыл бұрын
Please explain what you have written in JSP pages.
@gauravanil1749
@gauravanil1749 3 жыл бұрын
Neha, Just create home.html page instead of home.jsp with that basic snippet, mention action="home" and method="get", then normal submit button. Don't accept any values just normal submit button. It will work.
@arjunrao503
@arjunrao503 3 жыл бұрын
@@gauravanil1749 Thank you, its working
@yashwanthkumarmn5302
@yashwanthkumarmn5302 5 ай бұрын
@@gauravanil1749 Thank you
@Lord-v2s
@Lord-v2s 3 жыл бұрын
At 4:16 I keep getting an error saying *The requested resource [/Servlet_prog/servlet/com.abhishek.Context] is not available*
@DhanalakshmiKaruppusamy-lx8ch
@DhanalakshmiKaruppusamy-lx8ch Ай бұрын
Facing the same trouble
@jaishreeganesh7597
@jaishreeganesh7597 6 жыл бұрын
Sir,I want to join Spring MVC Live online courses from your channel..how can I contact you?
@shwetabambal5869
@shwetabambal5869 3 жыл бұрын
I dont know if you are going to reply to this query, but, how come u put /home - url-pattern for this servlet?? will u plz explain?
@DhanalakshmiKaruppusamy-lx8ch
@DhanalakshmiKaruppusamy-lx8ch Ай бұрын
Same doubt
@asifalam9086
@asifalam9086 6 жыл бұрын
Why do you call us Aliens?
@nikhilvijay6022
@nikhilvijay6022 3 жыл бұрын
haha yes
@abhiytbolte7566
@abhiytbolte7566 Жыл бұрын
May be because he is from another planet 🌝... Though awesome teacher no hate ❤❤
@BibekGhoshh1
@BibekGhoshh1 2 жыл бұрын
what is in the home.jsp file????
@faisalhabibhimel3113
@faisalhabibhimel3113 5 жыл бұрын
you didn't explain anything about what you did in .JSP files. In url pattern of web.xml page, you called home, but you didn't show what you did in there. It would be better if you could give the source code of every lecture.
@milaanvigraham8664
@milaanvigraham8664 5 жыл бұрын
It's part of a playlist dude, it's there in previous videos...
@faisalhabibhimel3113
@faisalhabibhimel3113 5 жыл бұрын
i guess the playlist is little order-less man. After #10, they're not numbered.I found these JSP codes some videos later in the playlist.
@DeathBender
@DeathBender 5 жыл бұрын
@@milaanvigraham8664 No he simply didn't at all, I watched all the previous videos and he just happened to have those jsp files on that one (you can figure it out by yourself, yet ...). So actually just edit web.xml correspondingly create at least home.jsp in the same folder as he did (pause the vid and take a look at the mentioned parts). Not sure if Header.jsp is required this vids content compiled (just compile MyServlet) and ran with a "blank" (no content added) home.jsp for me (and ofc the changes to the web.xml).
@boberteroberte
@boberteroberte 4 жыл бұрын
@DeathBender This worked for me. Just create an empty home.jsp and when you run from the server, make sure you are in the tab of MyServlet and double click and run as ..server etc.. and it will work.
@swagatachakraborty265
@swagatachakraborty265 5 жыл бұрын
Sir please help me why i m getting a blank page. All are did same as u say 😔😔😔😔
@rubalshukla6208
@rubalshukla6208 4 жыл бұрын
If you are following the previous videos as well So I suggest you create a new project and do all the steps as shown in the video hope this helps
@Bharadwajav9
@Bharadwajav9 5 жыл бұрын
Hi,Can u Please tell what was the "URL" (web.xml) written in above video,Thank You u
@javascriptwar9525
@javascriptwar9525 5 жыл бұрын
web.xml file also called as deployment descriptor file there we have to mention for which url which of the available servlet(Servlet is nothing but it just our .java friend) should called..
@forstoringdavidatad2525
@forstoringdavidatad2525 2 жыл бұрын
I have a requirement where i have to move migrate from web.xml to java config class can you please help
@bijilkp4315
@bijilkp4315 6 жыл бұрын
Sir,which programming language is suitable for a beginner
@riyapathak6743
@riyapathak6743 4 жыл бұрын
C language
@tdan89
@tdan89 Жыл бұрын
@@riyapathak6743 evil :))
@pratikgupta7373
@pratikgupta7373 6 жыл бұрын
Sir I want to apply for internship What should I study for Java internship I have studied j2se and SQL
@ankitaverma2271
@ankitaverma2271 4 жыл бұрын
sir,need to have more knowledge about cookies.
@ajayadgama1962
@ajayadgama1962 6 жыл бұрын
Share other ways to get servletContext and servletConfig object
@nithishreddy9056
@nithishreddy9056 6 жыл бұрын
Please explain about url pattern in web XML in servletcontext
@chinmaydas4053
@chinmaydas4053 6 жыл бұрын
Please sir first complete full quality aws tutorials bcz job opportunities are available now for aws.. we have to survive first..
@yashsinha7604
@yashsinha7604 4 жыл бұрын
I have installed apache 9in my system and at the time of config to eclipse kepler the version which was appeard was till apache tomcat 7 My server is not starting pls help sir plssssss
@vinays4205
@vinays4205 3 жыл бұрын
Check in your system. It may be running other server. Or change the port name.
@ankitaverma2271
@ankitaverma2271 4 жыл бұрын
please have one theory video of it.
@nikhilpant6428
@nikhilpant6428 4 жыл бұрын
what are life cycles of servlet?
@agustdik3696
@agustdik3696 5 жыл бұрын
I just want to zoom out these videos
@t2kumarashutosh2011
@t2kumarashutosh2011 5 жыл бұрын
How can I explain about ur video...I don't have any word
@agustdik3696
@agustdik3696 5 жыл бұрын
So don't 😂
@guilherme4414
@guilherme4414 2 жыл бұрын
Because in Servlet don't use "@Context HttpServletRequest request"
@paulmathai2561
@paulmathai2561 5 жыл бұрын
I clicked on the JOIN link but did not work.
@sravanthkumarchintalacheru1359
@sravanthkumarchintalacheru1359 5 жыл бұрын
Try patreon link 🔗, sir. It seems that Join option is not available for IOS ( apple ) and some other versions. You can find the patreon link in the description part of the video 'support' of this series.
@mickykumar7573
@mickykumar7573 5 жыл бұрын
this code is not running in netbeans help sir
@sonalighante3279
@sonalighante3279 6 жыл бұрын
plz I need software testing videos
@hamidsiddiqui6452
@hamidsiddiqui6452 6 жыл бұрын
Sonali Ghante watch reddy video for testing it will help
@ankitaB11
@ankitaB11 2 жыл бұрын
@guitarheart3723
@guitarheart3723 5 жыл бұрын
dear naveen sir... you did not write res.setContentType("text/html");
@Armannewyork01
@Armannewyork01 6 жыл бұрын
Hello Sir
@pradeepmishra1905
@pradeepmishra1905 4 жыл бұрын
Sir, u are not explaining thoroughly as u r just explaining how to use such interfaces but when and why to use such things?
@AkashGupta-hn4wu
@AkashGupta-hn4wu 5 жыл бұрын
Hi, I tried to do same as you have shown in your Servlet Config and Servlet Context video.And i am getting null value when i used Servlet Config to fetch value from web.xml file. Can you please help here?
@inclinedscorpio
@inclinedscorpio 5 жыл бұрын
Save both .xml and java files and restart the server !!! TAddaaa Done ? Still not done ? -> Then check for error marked by small red cross at left side of lines ..... Hope this helps !
@swagatachakraborty265
@swagatachakraborty265 5 жыл бұрын
Same prblm..😔😔 i cnt get any value Frustrated
@drakshayanibakka11
@drakshayanibakka11 4 жыл бұрын
Hey bro ...I have got the same error. Then I realised that I have included the init-param tag in another servlet tag say servlet-A and I am trying to fetch values from the servlet-B which I have not included init-param tag yet.That's why I got null value.This might be helpful
@rubalshukla6208
@rubalshukla6208 4 жыл бұрын
I was also facing this issue but then I found I did a little Typo on getInitParameter(Name) here the N should be capital because its a case sensitive please check that you are mentioning the same param-name of web XML in servlet file hope this helps
@archana_pidugu
@archana_pidugu 9 ай бұрын
@@drakshayanibakka11 Thank you :)
@omkarbadhe421
@omkarbadhe421 2 жыл бұрын
Showing null value
@patrisagar6548
@patrisagar6548 2 жыл бұрын
Anna don't say aliens.. em baaledu
@shubhambhake2207
@shubhambhake2207 4 жыл бұрын
why u speak so fast...?
@andrewawadike7560
@andrewawadike7560 Жыл бұрын
At 6.18 When I tried configuring I encountered this error "Element name 'init-param' is invalid. One of the following is expected: - module-name - description - display-name - icon - distributable - context-param - filter - filter-mapping - listener - servlet - servlet-mapping - session-config - mime-mapping - welcome-file-list - error-page - jsp-config - security-constraint - login-config - security-role - env-entry - ejb-ref - ejb-local- ref - service-ref - resource-ref - resource-env-ref - message-destination-ref - persistence-context-ref - persistence-unit-ref - post-construct - pre-destroy - data-source - jms-connection-factory - jms-destination - mail-session - connection-factory - administered-object - message-destination - locale-encoding-mapping-list - default-context-path - request-character- encoding - response-character-encoding - deny-uncovered-http-methods - absolute-ordering Error indicated by: { xmlns.jcp.org/xml/ns/javaee} with code:" please help out
Servlet and JSP Tutorial | Servlet Annotation Configuration
3:38
#10 Servlet and JSP Tutorial | HttpSession | Cookie
11:39
Telusko
Рет қаралды 261 М.
НРАВИТСЯ ЭТОТ ФОРМАТ??
00:37
МЯТНАЯ ФАНТА
Рет қаралды 5 МЛН
ЧУТЬ НЕ УТОНУЛ #shorts
00:27
Паша Осадчий
Рет қаралды 9 МЛН
What is JPA? | JPA Implementation
26:21
Telusko
Рет қаралды 379 М.
Servlet and JSP Tutorial | Why JSP?
8:38
Telusko
Рет қаралды 275 М.
What after Computer Science Engineering in the age of AI?
Scaler School of Technology
Рет қаралды 634
Java Database Connectivity | JDBC
20:34
Telusko
Рет қаралды 239 М.
#13 Hibernate Tutorial | Mapping Relations Practical
15:36
Telusko
Рет қаралды 178 М.
ADV JAVA || Differences between ServletConfig and ServletContext Part  - 1
25:34
Durga Software Solutions
Рет қаралды 94 М.
Servlet | JSP | JDBC | Maven Example
37:31
Telusko
Рет қаралды 194 М.
Looks very comfortable. #leddisplay #ledscreen #ledwall #eagerled
0:19
LED Screen Factory-EagerLED
Рет қаралды 2,4 МЛН
Look, this is the 97th generation of the phone?
0:13
Edcers
Рет қаралды 6 МЛН
iPhone, Galaxy или Pixel? 😎
0:16
serg1us
Рет қаралды 1,3 МЛН
Здесь упор в процессор
18:02
Рома, Просто Рома
Рет қаралды 408 М.