JSPs and Servlets Tutorial 14 - Using jspInit and InitParams

  Рет қаралды 126,451

Java Brains

Java Brains

Күн бұрын

Here we'll see how our understanding of the init concepts of servlets translates to JSPs.

Пікірлер: 33
@Ruzveld83
@Ruzveld83 9 жыл бұрын
For those who also got confused with jspInit() and _jspInit() methods. A JSP-servlet extends abstract class HttpJspBase which is an HttpServlet. In HttpJspBase: public final void init(ServletConfig config) throws ServletException { super.init(config); jspInit(); _jspInit(); } the underscored method is redefined by Tomcat while creating a servlet and the other method stays empty in order to let the user redefine it.
@זוהרנייגו
@זוהרנייגו 10 жыл бұрын
Hello Koushik , just wanted to brace you for this wonderful tutorial , you great lecture and it was not just increase my knowledge it also very fun engaged to watch all of your other tutorial ... well done I wish you will deliver more great tutorials in future . Thank and great regards , Zohar N
@sparkman786
@sparkman786 11 жыл бұрын
Dude these videos are awesome! Thank you so much for doing this. I have learned more from these videos than anything else.
@ankitjain8849
@ankitjain8849 9 жыл бұрын
Thanks for the sharing the tutorial they are helping in knowing the starting blocks for JSP!!
@suri4uonutube
@suri4uonutube 10 жыл бұрын
Thanks for the tutorial, I have one question. You are overriding the init() method in JSP file(generated code). But i noticed in Parent class method signatures, its name starts with _(underscore), but in your overridden method , underscore is not there. Did you miss that or it is the way it should be, then in that case, it cannot be overriding. Please correct me if i am wrong
@LiveLoveLaughEveryday
@LiveLoveLaughEveryday 8 жыл бұрын
You made my Thanksgiving long weekend :-)
@EurekaYoga
@EurekaYoga 11 жыл бұрын
At your command line prompt try: find -mtime 0 | fgrep _jsp.java > /home/dir.txt That should create a text file with the path to *_jsp.java. Mine was deep inside the hidden folder .metadata.
@neerajmahajan1305
@neerajmahajan1305 8 жыл бұрын
Good Video and explanation.
@thevagabond85yt
@thevagabond85yt 10 жыл бұрын
Java Brains earlier when we used servlets you showed us how we can use init params using both ( in web.xml and @WebInitParam annotations in servlet itself) but in JSP there's no alternative to use the Annotation method(right?). So the conclusion : while using JSP and desiring for init params you are forced to use web.xml
@bruno199131
@bruno199131 10 жыл бұрын
thanks for this explanation, but i have a question, when i do "super." to see the method that i m overriding this method don't appear in the eclipse list. I think that this happens because ecplise don't recognize this jsp like a HttpJspPage but like a Servlet. M.i wrong?
@tejaaravind5271
@tejaaravind5271 8 жыл бұрын
You are using ServletContext in JspInit method.... can we use application object to set the value...when i check in my own editor by giving application .setAttribute in place odf servletContext it is showing error. i dont know why.... i am having doubt with implicit objects...can we use implicit objects in the Jspinit method or any in anyother method. plz help me
@sparkman786
@sparkman786 11 жыл бұрын
does your jsp-file tag match the spelling and case of your filename?
@sonnix31
@sonnix31 11 жыл бұрын
Thanks alot!
@kaushiksinha786
@kaushiksinha786 6 жыл бұрын
init /init.jsp test me init /init.jsp Then in my init.jsp I can get the init params using getServletContext.getInitParameter.. However, I am using WebSevlet 3.0 annotations and I can't see equivalent jsp-file annotation. I am looking for something along these lines @WebServlet(initParams=@WebInitParam(name="hello", value = "hello"),description = "A Simple Servlet", urlPatterns = { "/init.jsp" }) where I can use jsp-file annotation. So I need to set the jsp init params without using web.xml.
@hussainv1
@hussainv1 11 жыл бұрын
The default user from the servlet config is: getServletConfig().getInitParameter("defaultUser") defined in initpage.jsp is returning null for me. Any idea why wat might have went wrong in my code as i have configured exactly as the one done in tutorial?
@MrIcecreamAttack
@MrIcecreamAttack 8 жыл бұрын
I have the same problem. :/ Did you find any solution?
@denisrodriguez2054
@denisrodriguez2054 7 жыл бұрын
verify that the init method is correctly written public void jspInit(){....}
@AkashSingh-el1ew
@AkashSingh-el1ew 6 жыл бұрын
In place of TOMCAT, I am using Glassfish, I found the java file for the init JSP file, but didn't find the jspInit() and destroy method in there, not sure why...anyone has any clue?
@SoeaOu
@SoeaOu 12 жыл бұрын
yes, thats more intuitive
@rashikashreshtha118
@rashikashreshtha118 7 жыл бұрын
sir i am getting null value, i dont understand how to rectify the same.. Please help me
@nehasinha4736
@nehasinha4736 6 жыл бұрын
Reload the Tomcat server and run the initpage.jsp file, I also got the same issue :-)
@ManpreetSingh-qe8wn
@ManpreetSingh-qe8wn 10 жыл бұрын
Why does the default username show up even if I give the username in the URL.... strange
@devanggaur2511
@devanggaur2511 9 жыл бұрын
Manpreet Singh the username you gave in the URL was an attribute of the request object . It doesn't belong to servlet config or context.
@EurekaYoga
@EurekaYoga 11 жыл бұрын
I couldn't find it either.
@echelecopao
@echelecopao 11 жыл бұрын
If you can't find the generated servlet files, go to stackoverflow (.) com and search for question: 4543868
@agastyapatashala9and10
@agastyapatashala9and10 7 жыл бұрын
voice is not so clear....please record the voice clearly
@AnirbanGorai
@AnirbanGorai 6 жыл бұрын
It is clear enough.
@dazelmann6589
@dazelmann6589 4 жыл бұрын
yes its crisp and clear.
JSPs and Servlets Tutorial 15 - Understanding the MVC Pattern
10:33
JSPs and Servlets Tutorial 07 - Understanding GET and POST
14:48
Java Brains
Рет қаралды 213 М.
Как подписать? 😂 #shorts
00:10
Денис Кукояка
Рет қаралды 8 МЛН
Миллионер | 1 - серия
34:31
Million Show
Рет қаралды 2,4 МЛН
Don't look down on anyone#devil  #lilith  #funny  #shorts
00:12
Devil Lilith
Рет қаралды 28 МЛН
🛑 Top 5 Interview Mistakes to Avoid RIGHT NOW! 🛑
14:43
Java Brains
Рет қаралды 6 М.
JSPs and Servlets Tutorial 06 - Passing More Parameters
14:56
Java Brains
Рет қаралды 239 М.
JSPs and Servlets Tutorial 11 - Understanding the JSP
14:42
Java Brains
Рет қаралды 164 М.
MUST KNOW junior role JAVA interview questions
42:15
Keep On Coding
Рет қаралды 120 М.
API GATEWAY and Microservices Architecture | How API Gateway act as a Single Entry Point?
23:18
Concept && Coding - by Shrayansh
Рет қаралды 16 М.
Top 25 Microservice Interview Questions Answered - Java Brains
39:54
Array Methods in JavaScript | 17 Useful Methods
42:39
DoableDanny
Рет қаралды 57 М.
Как подписать? 😂 #shorts
00:10
Денис Кукояка
Рет қаралды 8 МЛН