aspose file tools*
The moose likes Servlets and the fly likes Custom tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Custom tags" Watch "Custom tags" New topic
Author

Custom tags

Jean Miles
Ranch Hand

Joined: Aug 20, 2003
Posts: 53
I can I access variables in scriptlets in JSP?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61658
    
  67

This question is so vague as to be meaningless. And what does it have to so with custom tags?
But, using one possible interpretation of the question, yes you can create and reference local variables in Java scriptlets within a JSP. Any such scriplets become part the service method of the JSP-generated servlet.
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jean Miles
Ranch Hand

Joined: Aug 20, 2003
Posts: 53
Actually the question is based on the topic 'Custom tags' can i reference variables that are defined in scriplets in Custom tags?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61658
    
  67

More carefully-worded questions will get better answers.
To this one: no. While you can pass the values of scripting variables to custom tags through the attributes that allow run-time values, you cannot access scripting variables by name in custom tags.
Tacking values onto the page context as attributes is a common means of passing non-attribute info to tags. (Though I'd be cautious about doing so since you can create artificial bindings between your pages and tags that could limit the reusability of the tags).
bear
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Custom tags