Don’t look where you fall, but where you slipped
Adam Zedan wrote:My question is why do we use JSP ?? Is the sole purpose of a JSP to accomodate the response from a servlet perhaps organize it into a presentable form , by applying MVC type pattern where the jsp page serves as the view a servlet as a controller and a plain old java object as a model ??
What other uses could their be for JSPS (i have been told not to use scripts in JSPS) ??
Secondly are JSPS still being used ?? if not what has replaced them ??
I actually just finished Head First jsp and servlets though the book was pretty good but it would have been nice to read suggestions on when to use a jsp and when the use of a jsp should be discouraged. (well you cant cover everything in one book i guess). I'd Love to hear other opinions about JSP uses ??
So should I always keep this as a rule of thumb that even if a couple of items on a form need to be populated i should post the data to servlet
which in return should send that data to a different jsp page (which exactly looks similar to the orignial page the user just had filled in)
I was told that once i am finished with JSP and servlets i should move to a framework such as spring
... but before that i suggest i should look at javascript and Ajax....
Bear Bibeault wrote:
Adam Zedan wrote:
which in return should send that data to a different jsp page (which exactly looks similar to the orignial page the user just had filled in)
You lost me here. Huh?
Don’t look where you fall, but where you slipped
Adam Zedan wrote:and then calls a JSP page which resembles the index.html only now all the field are populated. Is this the proper way to accomplish this task ?
Bear Bibeault wrote:(I fixed your quoting in the previous reply -- please use Preview to make sure your post is correctly formatted)
Adam Zedan wrote:and then calls a JSP page which resembles the index.html only now all the field are populated. Is this the proper way to accomplish this task ?
Why would you need a JSP that resembles an HTML page when the JSP creates an HTML page in the first place?
Hint: the above sentence has enough information for you to answer the question.
Don’t look where you fall, but where you slipped
Adam Zedan wrote:Now is this the proper way to accomplish such a task ?
Bear Bibeault wrote:
Adam Zedan wrote:Now is this the proper way to accomplish such a task ?
Nope.
Does not strike you as completely wasteful and a maintenance nightmare to have a JSP and an HTML page that need to be maintained in sync?
I'll ask a slightly different way: why do you need an HTML page that resembles the JSP?
Don’t look where you fall, but where you slipped
Bear Bibeault wrote:Exactly. Why on earth would you think that you'd need to have an HTML version and a JSP version? It's all just HTML in the end.
Don’t look where you fall, but where you slipped
Paul Clapham wrote:Right. And if you create a system with lots of JSPs, it quickly becomes clear that static HTML pages are a liability, and you should implement them as JSPs as well. Even though there's apparently no decisions being made in those JSPs -- yet.
Even such a simple requirement as having a copyright notice with the current year at the bottom of each displayed page is a negative for HTML, for example.
Don’t look where you fall, but where you slipped
Adam Zedan wrote:Is it weird to not even have a single HTML in our website?
Bear Bibeault wrote:
Adam Zedan wrote:Is it weird to not even have a single HTML in our website?
No.
Don’t look where you fall, but where you slipped
Adam Zedan wrote:Is it weird to not even have a single HTML in our website??