• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Creating custom implicit object

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Can any one tell me how to create/customize jsp implicit objects. I want to create my own class that might extends from HttpServletRequest and whenever user writes in jsp file request.getParameter() my overrided method getParameter could be invoked.

Any suggestion/reference would be helpful.
Thanks in advance.
 
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hye Adnanssd,

The question is good, but i would advice you to first understand what and why are implicit objects.

I will try to explain. Implicit object are nothing but a standard that says whenever a jsp is converted to a servlet, the sevlet will create some objects in the code, that your code can use. Thats it. To understand it more clearly, read some translated jsp file.

Hope this will clear.

Regards
Sandeep Jindal
 
Adnan Badar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot for reply.

Actually I am working on Multilingual application to support Arabic form input. Application is already coded and parameters are fetched as requuest.getParameter(""); We are using iPlanet which support servlets 2.2 specs and does not supports request.setCharacterEncoding so I found alternate solution to fetch unicode data from request and insert into DB:

String tName = new String(request.getParameter("T1").getBytes("ISO8859-1"),"UTF-8");

I dont want it to be replaced with every statement request.getParameter() and was thinking to override this method by some mean. So I want that servlet container must use my Specialize class that extends HttpServletRequest . Is this possible? and will JSP engine also using this class to generate code for servlet from JSP. I can also write my utility class that can act like UnicodeUtil.convert(request.getParameter("T1")) but am looking for more customized solution as requested above.

Thanks U
 
Surfs up space ponies, I'm making gravy without this lumpy, tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic