Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting and setting bean property with the jsp tag

 
Ali Gordon
Ranch Hand
Posts: 182
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Will it make any difference if I put the last line of code inside the useBean tag ?



It gives me the same output though
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65337
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what's your conclusion based upon your tests?

And, any reason you're not using JSTL/EL in place of these crusty old things?
 
Ali Gordon
Ranch Hand
Posts: 182
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:So what's your conclusion based upon your tests?

And, any reason you're not using JSTL/EL in place of these crusty old things?


EDIT - I tested the code and got different outputs. If you put the last line inside the useBean
tag, you get a blank output. Why ?

I am using these crusty old things because my book (head first jsp) uses them as an intro to move to EL and then JSTL. It says that we
have to learn "scriptless jsp". It says that scripting comprises of - scriptlets, declarations & expressions and we are going to stop using
them. Is the code in my question "scripting" i.e Java-like code ?

If only there was a tutorial which just gave you what is generally used in the real world.
Last time I skipped chapters, I was confused.

Bear, please consider writing a new modern JSP book as you had mentioned in one post. Try self publishing like Cameron mckenzie
if the publishers are stubbornly resisting the idea of a new book.

Thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65337
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ali Gordon wrote:I am using these crusty old things because my book (head first jsp) uses them …

OK. The older stuff is fine to learn -- you will see it in legacy code, and code from the many people who still write JSP as if it were 13 years ago -- but be aware that it should not be used in new code.

It says that scripting comprises of - scriptlets,
declarations & expressions and we are going to stop using them. Is the code in my question "scripting" i.e Java-like code ?

Those older JSP tags are used in conjunction with scriptlets and aren;t necessary with the JSTL and EL -- which have more up-to-date ways of setting and getting property values.

Last time I skipped chapters, I was confused.

Then don't. Just be aware of what's legacy, and what's modern.
 
Ali Gordon
Ranch Hand
Posts: 182
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:
Ali Gordon wrote:I am using these crusty old things because my book (head first jsp) uses them …

OK. The older stuff is fine to learn -- you will see in legacy code -- but be aware that it should not be used in new code.

It says that scripting comprises of - scriptlets,
declarations & expressions and we are going to stop using them. Is the code in my question "scripting" i.e Java-like code ?

Those older JSP tags are used in conjunction with scriptlets and aren;t necessary with the JSTL and EL -- which have more up-to-date ways of setting and getting property values.

Last time I skipped chapters, I was confused.

Then don't. Just be aware of what's legacy, and what's modern.


Bear, please consider writing a new modern JSP book as you had mentioned in one post. You could try self publishing like Cameron mckenzie
if the publishers are stubbornly resisting the idea of a new book.

Thanks.
 
Ali Gordon
Ranch Hand
Posts: 182
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
btw, can you please tell me why I get different outputs ?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65337
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To be honest, I'd have to look at the documentation -- I haven't used those tags in over a done years.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic