aspose file tools*
The moose likes JSP and the fly likes help me to avoid scriptlets, declaration & expression... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "help me to avoid scriptlets, declaration & expression..." Watch "help me to avoid scriptlets, declaration & expression..." New topic
Author

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

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830


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

Joined: Nov 24, 2005
Posts: 14687
    
  16

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.


[My Blog]
All roads lead to JavaRanch
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
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

Joined: Oct 11, 2004
Posts: 3830
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

Joined: Nov 24, 2005
Posts: 14687
    
  16

will it work if you input "aaaaaaaaaaaaaaaa" ?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Anyway, you try this way :
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Originally posted by Satou kurinosuke:
will it work if you input "aaaaaaaaaaaaaaaa" ?


This version will work:



Thanks.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Will with the JSTL version, no need to check for the size.
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: help me to avoid scriptlets, declaration & expression...
 
Similar Threads
AJAX implementation is giving problem
Having some multidimensional array problem in JSP
Passing more than one object between jsp and servlet
Displaying all the months in the year
When Validation Error I Lose My Bean Value-Struts 2