You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@jakarta.apache.org by Stephen Townsend <st...@rpc.unb.ca> on 2000/03/06 04:40:03 UTC

HELP: plugin and expressions used for values

Hello,

I have tried using Tomcat v3.0 and v3.1M1. Both fail to take an expression
as a param value. Below I describe what I am trying to do. It is my hope
that someone can direct me to a proper solution.

I have been trying to using a servlet to forward info to a JSP which
launches a plugin. The plugin parameters need to be data obtained from the
servlet. The servlet sets a attribute. Once the attribute is obtained it the
forwarding JSP code resembles:

<% String numberOfColumns =
request.getAttribute("NumberOfColumns").toString(); %>

<jsp:plugin type="applet" code="Columns" jreversion="1.2" width="500"
height="250" >
 <jsp:params>
  <jsp:param name = "NumberOfColumns" value = "<% columns; %>" />
 </jsp:params>
    <jsp:fallback>
        Plugin tag OBJECT or EMBED not supported by browser.
    </jsp:fallback>
</jsp:plugin>

This does not work. Any expression I use for the value is taken as a literal
string, even though the standard on Sun's site for a param value states an
expression can be used.

Some please help identify where I have gone wrong.

Stephen


Re: HELP: plugin and expressions used for values

Posted by Stephen Townsend <st...@rpc.unb.ca>.
Thank you. The original code did have the field as numberOfColumns.

I have checked the reset of the code. If I hard code the value then things
work fine. i.e.

If I use:
<jsp:param name = "NumberOfColumns" value = "5" />

The applet works great.

If I use:
<jsp:param name = "NumberOfColumns" value = "<%= numberOfColumns %>" />

The applet will not work but it receives the value <%= numberOfColumns %>

It appears that the value field can not take an expression like the standard
states.

Could someone please at least confirm this for me or show me where I'm
wrong.

Stephen




----- Original Message -----
From: "Serge Knystautas" <se...@lokitech.com>
To: <ge...@jakarta.apache.org>
Sent: Sunday, March 05, 2000 11:55 PM
Subject: Re: HELP: plugin and expressions used for values


> Stephen Townsend wrote:
> >   <jsp:param name = "NumberOfColumns" value = "<% columns; %>" />
>
> <jsp:param name = "NumberOfColumns" value = "<%= columns %>" />
>
> But actually this doesn't even work because you named your field to
> "numberOfColumns", so <%=columns%> obviously won't work.  So really
> you'll want:
>
> <jsp:param name = "NumberOfColumns" value = "<%= numberOfColumns %>" />
>
> I can't speak to whether the jsp:plugins tag is correct, but that will
> at least correct the flaws in the JSP portion of your code.
>
> Serge Knystautas
> Loki Technologies
> http://www.lokitech.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: general-help@jakarta.apache.org
>


Re: HELP: plugin and expressions used for values

Posted by Serge Knystautas <se...@lokitech.com>.
Stephen Townsend wrote:
>   <jsp:param name = "NumberOfColumns" value = "<% columns; %>" />

<jsp:param name = "NumberOfColumns" value = "<%= columns %>" />

But actually this doesn't even work because you named your field to
"numberOfColumns", so <%=columns%> obviously won't work.  So really
you'll want:

<jsp:param name = "NumberOfColumns" value = "<%= numberOfColumns %>" />

I can't speak to whether the jsp:plugins tag is correct, but that will
at least correct the flaws in the JSP portion of your code.

Serge Knystautas
Loki Technologies
http://www.lokitech.com/