• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP problem using EL.

 
ellie spring
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi everyone,

I have a problem using EL in jsp.
I want to get the request attributes that i define in my servlet to my jsp page.

for example in my servlet i define


then forward it to my view jsp using request dispatcher.
How i can i access my name property in my jsp page using EL.

Thanks in advance,
 
mallikarjun dontamsetti
Ranch Hand
Posts: 246
Firefox Browser Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be this will help You

request.setAttribute(string,Object);
 
Dieter Quickfend
Bartender
Posts: 543
4
Java Netbeans IDE Redhat
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have no other name attribute in any of the scopes, you can use ${name}
If you want to be sure you've got the right scope, you can use ${requestScope["name"]}
 
ellie spring
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thanks for the replies.

Its working now.

simply by this.



using:
same result..

Thanks
 
Dieter Quickfend
Bartender
Posts: 543
4
Java Netbeans IDE Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome

As an aside, the dot (.) operator and the [] operator give the same result in this case, but there is a big difference between them. Good idea to read up on those two, and why it is usually a better idea to use [] operator in EL. It affords far more flexibility.
 
Mac Luq
Greenhorn
Posts: 22
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mallikarjun don wrote:May be this will help You

request.setAttribute(string,Object);


 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!