Q:

Can javascript be used to render web pages

In my project i am using jsp for templating and java as backend. This was the first time I was using jsp and javascipt i have few questions about it.
I learnt that we can dynamically render a page using javascript so does that makes the jsp redundant?
If "js" can be used for rendering pages then what are the advantages of using jsp?

A:

Java Server Pages (JSP) were a templating solution invented as a response to Microsoft's ASP.  It gave developers a way to create dynamic web pages that would respond to data from the server side.
JSP is a template language that is parsed and compiled into a Java servlet, which is subsequently compiled from .java to a .class file.  The servlet/JSP engine on the server side uses it to generate HTML dynamically and stream it to the browser.
There are lots of other templating solutions out there (e.g. Velocity).  
It's entirely possible to use JavaScript to dynamically manipulate the DOM - that's what jQuery is all about.
JSP only works if you're a Java developer committed to the Java EE stack.
If you're a web developer expecting to deal with REST services, I think it's less likely that you'd choose JSP.
"redundant" is too strong a negative term, IMO.  Think of JSP as one choice among many possibilities.

