• Post Reply Bookmark Topic Watch Topic
  • New Topic

jstl inside jsp:param

 
Chris Cornelius
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
 
Stefan Evans
Bartender
Posts: 1822
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: 1822
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!