• Post Reply Bookmark Topic Watch Topic
  • New Topic

Creating custom implicit object

 
Adnan Badar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • 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.
 
Sandeep Jindal
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!