• Post Reply Bookmark Topic Watch Topic
  • New Topic

EL and JSTL not showing cookie value

 
Keimo Smith
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)
-----------------------------------------------

 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Definitely not Beginning Java. Moving to JSP.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!