Meaningless Drivel is fun!*
The moose likes JSP and the fly likes JSTL request.getAttribute(String attName) 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 » JSP
Bookmark "JSTL request.getAttribute(String attName)" Watch "JSTL request.getAttribute(String attName)" New topic
Author

JSTL request.getAttribute(String attName)

Raul Vieira
Greenhorn

Joined: Feb 12, 2004
Posts: 6
Hi there
I'm trying to minimize the amount of scriplet code in a jsp page and would like to accomplish this by using JSTL.
I'll give you a brief overview of my design:
The client sends a request which is handled by a controller servlet. This servlet returns data from the database building the appropriate beans to be forwarded on to my view in the HttpRequest object.
My JSP then retrieves the object and prints out its value:
<%String pageState = (String)request.getAttribute("viewState");%>
<%=pageState%>
I'm aware of how to use print the values of request parameters, not added by my servlet, using:
<c ut value="${param.myParam}"/>
But this will not work in the example I have provided in my scriplet (maybe it does and I'm just crazy).
Can you please provide me with some insight or direct me to a resource that explains this?
Thanks very Much.
Raul
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

I'm confused as to what your question is. What does the param example have to do with your attribute example?
If what you are asking is how to eliminate the scriplet

should do it for you.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

P.S. If you click the 'disable smilies' checkbox when posting, your tags won't turn into smilies.
 
Don't get me started about those stupid light bulbs.
 
subject: JSTL request.getAttribute(String attName)
 
Similar Threads
Null request parameter from Select/Option element
Retrieve Value from Array to be Displayed
getAttribute in a jsp
bean problem
how to iterate and get values in a dropdown from a list variable