• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jstl inside jsp:param

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic