This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Do such methods exist? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Do such methods exist?" Watch "Do such methods exist?" New topic

Do such methods exist?

Rich Smyth
Ranch Hand

Joined: May 30, 2002
Posts: 87
I wrote two trivial convenience methods to use in my servlets. I'm wondering now if they already exist. I can't find anything similar in the Servlet API doc.
1) getAttributeFromAnyScope(String name) searches
for the attribute in request scope then in session scope then in application scope. Returns the first one it finds.
2) getAtttributeInScope(String name, String scope) returns the attribute from the specified scope.

chanoch wiggers
Ranch Hand

Joined: May 24, 2001
Posts: 245
i dont thinkso - jsp offers those kind of methods but not servlets.

chanoch<p><a href="" target="_blank" rel="nofollow">Author of Professional Apache Tomcat</a></p>
I agree. Here's the link:
subject: Do such methods exist?
Similar Threads
Difference between request parameter and request attribute
page 218 Head First Servlets and JSP
Question on JspContext?
getAttributeScopes() --- is it there???
getAttributeScope(String name)