• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

is there any such thing as jspServletConfig

 
Ankur Jain Kothari
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i couldnt find anything like this in the specs
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then it probably does not exist.

What exactly do you mean by jspServletConfig ?
 
Keith Flo
Ranch Hand
Posts: 128
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You must be thinking of ServletConfig? and wondering how to get the 'config' of a JSP page .... correct?

ServletConfig is mostly helpful because its a way to set/get init parameters for a servlet(s) in your app. To get/set init parameters for a JSP you cam either ...

  • use a scoped attribute (this is mentioned somewhere in the spec) like so ...





  • or use a context init parameter

  • - define the param in the DD and you can retrieve it in your JSP pages with EL like so ...
    - ${initParam.paramname}

     
    Keith Flo
    Ranch Hand
    Posts: 128
    Android Eclipse IDE Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    One other point ...

    Its easy to confuse the methods needed to get the init params in servlet code ...

    To get the servlet init params use ...
    To get the context (think application) init params use ...

    Context for context (application) params .... Config for servlet params ...
     
    Ankur Jain Kothari
    Ranch Hand
    Posts: 154
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    actually in one of the hfsj questions there was an option of jspServletConfig....so was wondering if such a thing existed....nevertheless thanks a lot....scwcd is huge..i was hoping to give the exam on 5th april...but now will go for may 17th or something....

     
    Keith Flo
    Ranch Hand
    Posts: 128
    Android Eclipse IDE Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Yeah .. it is huge! ... I take the test on April 6th ...
     
    Swagato Bhatta
    Ranch Hand
    Posts: 72
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Ankur Jain Kothari wrote:actually in one of the hfsj questions there was an option of jspServletConfig....so was wondering if such a thing existed....nevertheless thanks a lot....scwcd is huge..i was hoping to give the exam on 5th april...but now will go for may 17th or something....



    SCWCD is just like a black hole. Once you start, it just do not seem to end! Neverending studies
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic