Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

jstl inside jsp:param

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have an applet that is running inside my jsp. I now need to pass it a parameter from my servlet. I have tried the following code with no luck.



Any ideas?

Thanks,

Chris
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<jsp:param name="Filename" value="<%= pageContext.findAttribute("Action").toString() + "?action=GET_IMAGE" %>"/>

If you have a JSP2.0 container, maybe this?
<jsp:param name="Filename" value="${Action}?action=GET_IMAGE"/>

or
<c:set var="fileName">${Action}?action=GET_IMAGE</c:set>
<jsp:param name="Filename" value="${fileName}"/>

Cheers,
evnafets
[ October 18, 2005: Message edited by: Stefan Evans ]
 
Chris Cornelius
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Stefan.

I still can't get it to work. The output comes out like this:



For some reason, inside the jsp aram the jstl does not work.

Chris
 
Stefan Evans
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EL expressions with the jsp aram tag will only work in a JSP2.0 container (eg Tomcat 5)
Your web.xml also needs to be up to date, otherwise it disables EL.
http://faq.javaranch.com/view?ServletsWebXml

If you don't have a JSP2.0 container, it will not work.

However that first one I posted should work anywhere (I think)
<jsp aram name="Filename" value="<%= pageContext.findAttribute("Action").toString() + "?action=GET_IMAGE" %>"/>

Good luck,
evnafets
 
Chris Cornelius
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks,

I couldn't get the first suggestion to work either, so
I just did a <c:choose> on the whole jsp: segment and
that works. I will definately look into the xml settings.

Chris
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic