Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help me to avoid scriptlets, declaration & expression...

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


The above JSP displays the list of possible names in a table when user enters any string in previous JSP and submit.

But this JSP has scriptlet, declaration and expression, which shouldn't be in a JSP.

What you will do to avoid these in JSP, I mean, how you will replace these by EL, Actions or Custom Tags...

Thanks.
[ June 13, 2006: Message edited by: rathi ji ]
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure this actually works ? What is getMatchingNames doing ?
Could you send a possible value for "enteredString" because I tried it and I keep getting exceptions.
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Satou kurinosuke:
Are you sure this actually works ? What is getMatchingNames doing ?
Could you send a possible value for "enteredString" because I tried it and I keep getting exceptions.


It's working at my machine.

getMatchingNames() method actually returns the list of names which matches with the string entered by user.

What exceptions you are getting?
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Satou kurinosuke:
Are you sure this actually works ? What is getMatchingNames doing ?
Could you send a possible value for "enteredString" because I tried it and I keep getting exceptions.


'enteredString' could be any string like "p", "bu" etc.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
will it work if you input "aaaaaaaaaaaaaaaa" ?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyway, you try this way :
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Satou kurinosuke:
will it work if you input "aaaaaaaaaaaaaaaa" ?


This version will work:



Thanks.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Will with the JSTL version, no need to check for the size.
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Satou kurinosuke:
Anyway, you try this way :


Thanks a lot Satou,

What about using custom tag. Which one would you or anyone prefer?

Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic