• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

EL and JSTL not showing cookie value

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

This is probably a stupid question.. I'm stuck.

I have a cookie which I can show using a packaged java function.

When I try to show it with EL, I only see ${cookie.mxsesid.value} instead of the real value of the cookie.

Any ideas what might be missing?
Cheers
Keimo


The output of test.jsp:
--------------------------------------------------------------------------------
get cookie with a package function:0000000000159040000201101261447400007855900278432

get cookie with el:${cookie.mxsesid.value}

get cookie with el and c : out:${cookie.mxsesid.value}

test returns true



The code (test.jsp):
---------------------



And the packaged function (mxlogi/MxLogi.java)
-----------------------------------------------

 
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Definitely not Beginning Java. Moving to JSP.
 
Marshal
Posts: 67389
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the ${} is not being resolved, it's likely that the EL isn't enabled at all.

What happens when you try ${3+4}?

If you don;t see 7, your app is misconfigured. See the JSP FAQ for proper setup.
 
Keimo Smith
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the tips.

${3+4} gave indeed: ${3+4}

I had created the project with maven and in my web.xml I had a web-app tag like

<web-app>

I changed that to

<web-app xmlns="http://java.sun.com/xml/ns/j2ee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd";
version="2.5">

Now it works.
 
Bear Bibeault
Marshal
Posts: 67389
173
Mac Mac OS X IntelliJ IDE jQuery Java
 
I'd appreciate it if you pronounced my name correctly. Pinhead, with a silent "H". Petite ad:
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic