Archive

Archive for January, 2007

HOWTO add DVD repository to ADEPT in UBUNTU

January 18th, 2007 Rajesh No comments

… recently i downloaded the DVD repositories iso images for UBUNTU 6.10 (Edgy Eft).
After i burnt the DVD images , i tried to add them to the sources.list of ADEPT Package Manager, but , couldn find the option :(

i started to google and after an hour of search , i found the command to get it done.
here it is
run this command in your linux console
% sudo apt-cdrom add

its working for me :)

  • Share/Bookmark
Categories: Ubuntu/Linux

HOWTO pass request and response from one servlet to another servlet …

January 16th, 2007 Rajesh 1 comment

…that sounds simple for a java/j2ee programmer…
RequestDispatcher rd = request.getRequestDispatcher”/jsps/login.jsp”);
rd.forward(request,response);

but the scenario is …
i have to pass the request and response from a servlet in one web application to another servlet or jsp in another web application deployed in the same server …


lets say we have two web applications SabreNews and BeanPicks

and we have to pass the request and response object from a Servlet or a jsp in SabreNews to a resource(Servlet or a jsp) in BeanPicks
how should we go about ?

here is the solution :
ServletContext beanPicksContext = getServletContext().getContext(“/BeanPicks”);
beanPicksContext.getRequestDispatcher(“/beanPicks/jsps/displayBlog.jsp”).forward(request,response);


getServletContext() is the method declared in the ServletConfig object .As the method name goes by , it returns the ServletContext object with which a Servlet can communicate with the ServletContainer in which the webapplication runs.
so now we have got the line to talk with the ServletContainer which also holds other web applications and BeanPicks too .
Now , we have to ask for the BeanPicks’s context and we get the BeanPicks context
by calling getContext(“/BeanPicks”)
we have got the context and the rest is to get the RequestDispathcher(getRequestDispatcher(java.lang.String path)) on a particular resource (displayBlog.jsp) and forward the request and response


i am using the code snippet i have given above , in my web application and it is working fine for me .if there is another way doing it , please blog it and let me know.
please refer to J2EE 1.4 api docs for brief information about ServletConfig , ServletResponse and GenericServlet objects

  • Share/Bookmark
Categories: java

HOW I forgot ctr+alt+del

January 11th, 2007 Rajesh No comments

I have been waiting for a long time to write this blog ,
“how i forgot that favourite command”, most of us (desktop users) have used the most . did u guess it !

yes its ctrl+alt+del.

Ever since i saw that pc in the internet kiosk (5 yrs before, when i was in college ), COMPUTER became my passion and i never thought that i will start my carreer with it.After my graduation , somehow i managed to get a personal computer and installed Windows 98 . Since that day i have been using MS Windows 98 and some days later Windows XP.

All these years i was hearing about the other OS which is free to use , virus free, spyware free, yes the Linux OS .First i was afraid to try it , thinking that it might not support the hardware, might corrupt my harddisk and all files would be lost.After a word from my friend, that Linux is completely harmless , i decided to give a try.

First i started with Fedora Core , then Suse and finally ended with Kubuntu :) .
(Thats a 8 months story how i ended up with Kubuntu) …

  • Share/Bookmark
Categories: others