Ravi Gupta

Ranch Hand
+ Follow
since Jul 15, 2006
Merit badge: grant badges
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Ravi Gupta

I have created few tabs using Tomahawk tabbedpane component. One of the tabs(say tab2) has a JSP included in it(say jsp2). Now this jsp2 has a link , which when clicked is supposed to load jsp3 inside the same tab (tab2). Any pointers on how to achieve this will be highly appreciated.
15 years ago
JSF
Hi

I am using Tomahawk library to create tabs in a JSF page. The code used is

I am able to get 6 tabs as expected. However, trouble begins when I try to display a JSP page inside one of the tabs. I use the following code

Upon including this piece of code, all tabs are lost and even home.jsp does not display. What am i doing wrong?
15 years ago
JSF
If you are using the Windows platform, then:
1. First navigate to the directory where Tomcat is installed. For e.g. I have installed Tomcat in C: drive, so my command prompt should read C:/Tomcat/bin> before i issue the start-up command.
2. Once you have managed to get the correct directory path onto your command prompt, just type 'startup' (without quotes) and press enter.

Follow the above steps and if you still face issues, please feel free to send me a PM.
15 years ago
Ustaad Desraj, please check your Private Messages
15 years ago
Hi

Did you take a look at the link I provided?

15 years ago
I agree that installing Tomcat as a service may cause trouble, but blaming Vista for a "stupid" security feature that has helped massively cut down malware infections, is immature at best.

IF you want to know the no nonsense guide to setup tomcat on your Vista/XP/7 system, then you can take a look at http://gupta-ravi.spaces.live.com for this post.
15 years ago
You can visit http://gupta-ravi.spaces.live.com for a guide on setting up your system for working with tomcat jsp and servlets.
If you have any issues please PM me.
15 years ago

Zaheer A Baloch wrote:When the webcontainer gets a requests it creates Request and Response objects. Then creates a thread for the servlet being requested and then passes the objects to service method of servlet. When the service method completes, the web container sends the response back. After that request and response objects are destroyed. Note that service method gets the objects as parameters and its job of container to create and destroy these objects.

Hope this helps



You are merely quoting whats mentioned in the book. I understand that. I know its the way its supposed to work. But my issue is with the line where the authors mention - the request and response objects fall out of scope on completion of the thread, which does not make sense to me. The language implies that somehow completion of the thread makes these objects fall out of scope, while I believe its the container that decides when to remove references to those objects and make them available for Garbage Collection. So probably instead of " The service() method completes,so the thread either dies or returns to a Container-managed thread pool. The request and response object references fall out of scope, so these objects are toast (ready for garbage collection)." it could have been - "The service() method completes,so the thread either dies or returns to a Container-managed thread pool. The container destroys any references to request and response objects and thus they fall out of scope and become available for garbage collection."

Chinmaya Chowdary wrote:Hi, Ravi. I think when a request comes, the container creates request and response object directly in the service method like service(new HttpServletRequestImpl(), new HttpServletResponseImpl()), not creating like HttpServletRequest request=new HttpServletRequestImpl() and HttpServletResponse response=new HttpServletResponseImpl() and pass to service(request, response).



Thanks a ton for your reply but that doesnt solve my doubt. The question is, how can two objects created before the creation of a thread, fall out of scope on the completion of that thread.
Hi

Like most people preparing for SCWCD, I too am following the excellent resource - Head First Servlets & JSP 2nd Edition.

I have a doubt regarding one of the concepts presented on pages 95 and 96.

On page 95, 2nd and 3rd steps, it is described that the container creates the Request and Response objects BEFORE creating/allocating a thread for the request that the Request and Response objects belong to.

Then on page 96, 6th step states that after the thread dies or returns to a Container-managed thread pool, the Request and Response object references fall out of scope.

My doubt is - if the container is responsible for the creation of Request and Response objects, and obviously has a reference to them, then why do they fall out of scope on the completion of the thread to which their references are passed?

Hi

If you are completely new to Servlets and JSP, I would recommend reading and following Murach`s Java Servlets and JSP. Its an ideal beginner book for these technologies. Once you are familiar with these concepts, you can safely move on to Head First. You can say Murach is more of a how-to-make-it-work while Head First is more of why-does-it-work-that-way book.
But at the same time, some people have grasped these concepts after multiple readings of the Head First offering only.
If you require a short instruction guide on how to make the code samples in Head First Servlets & JSP run on your Windows machine, feel free to send a PM.

Regards
Ravi
Thanks a ton. Will proceed as suggested and will post the code for others too.
16 years ago
I want to export an applet to an image of same size. Image format can be PNG or JPEG. How should I go about it?
16 years ago
I have an applet that gets launched from a JSP. It is deployed on the WebLogic Application Server. What is the method to make that applet signed?
16 years ago
Hi, i have a j2ee based application that launches an applet which displays a graph based on some data pulled from a database. My question is that can i add an element to the applet that can export the current applet to an image file like jpeg?
16 years ago