Jsp12 07/10/2008
 

How to overwrite the init and destroy method in a jsp page.

We can overwrite the init method in a jsp page by using declaration tag in our JSP page.

Where do we use hidden variables and url rewriting? and what is the difference between them?

Both hidden variable and URL rewriting are used for session tracking. The only advantage in hidden variable is that the URL looks neat. In URL rewriting, each and every variable is added to the URL (called GET parameters).Example: profile.jsp?name=dilip+surname=iyer

What is the difference between session and cookie ?

Sessions are stored in the server side whereas cookies are stored in the client side2. There is a limit to the number of cookies that can be stored with respect to session

What is the difference betweeen JSP forward and servlet forward methods?

JSP forward forwards the control to another resource available in the same web application on the same container..where as Servlet forward forwards the control to another resource available in the same web application or different web app on the same container.

What is difference between getAttribute() and getParameter()?

GetAttribute() returns an object so when ever we use a getAttribute() we have to cast the return type that is we have to convert it to the required type like string or int.
getParameter always returns a string.one more difference is where this 2 methods are used...getAttribute is used to get the values from the session and getParameter is used to get the values from the form.(html or a jsp file).

 


Comments




Leave a Reply

Name (required)
Email (not published)
Website


 
    Jsp Sets


    Archives

    July 2008

    RSS Feed