• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Accessing Request Scope Variables

 
Ranch Hand
Posts: 426
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone,

I have used javascript in my JSP pages but I'm having problem related to this.





I declare LOGIN_RESULT as a request scope attribute in my action class and
it seems ok at this point and I can alert the user regarding the result because I know I had defined LOGIN_RESULT as a request scope attribute prior to forwarding to this JSP.

But what if the request scope attribute differs depending on the user transaction and different request scope attribute can be reloaded together
with the page.



I tried googling for answer and found request.getAttributeNames() and it returns an enums. I dont know how getAttributeNames is implemented using EL and my action class always return just one request attributes.
What can I substitute "?" in my EL expression

Thanks for the help and tell me if my question isn't that clear
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How is your dynamic attribute name getting to the page?

In general, indirection can be handled with:



where something contains the attribute name.
 
Mark Reyes
Ranch Hand
Posts: 426
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

How is your dynamic attribute name getting to the page?



Pardon me but I am not sure if I got your question correctly but I am doing this in my action class



in my javascript, I was hoping to substitute "?" with the attribute.



I can hardcode it one by one like this but I want to learn if there's an easy way out of doing this for the sake of learning.



Thanks again..
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why not just use an array?
 
Mark Reyes
Ranch Hand
Posts: 426
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

thanks for the suggestion. I have overlooked about using arrays. By using array I wont bother much on the attribute name.

Thanks for the help. I'll check and try it out..

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic