• Post Reply Bookmark Topic Watch Topic
  • New Topic

Retrieving headers with pageContext request.headerNames  RSS feed

 
Jesus Fernandez
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
i am trying to obtain the headers from a HTTP request and show their values, but the output don't show the values of the header:
Here is the output:

Headers:
1host
2user-agent
3accept
4accept-language
5accept-encoding
6accept-charset
7keep-alive
8connection
9referer
10cookie
11content-type
12content-length

In the code i have defined three columns (id, header name and header value), but the header value column is empty



Any help on this would be appreciated
Thanks in advance
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your EL expression:

${header["${encPeticion}"]}


is invalid.

Try



instead.

Ask if you do not understand why it works.

Perhaps you are thinking that the ${} is some sort of fetch operator? It's not. It is used to enclose a complete EL expression and you cannot (and there is no need to) nest them.
[ March 11, 2005: Message edited by: Bear Bibeault ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!