You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Justin Kennedy <ju...@consortio.com> on 2001/02/21 23:13:05 UTC

attribute blah has no value

HI all,

I'm trying to use a dynamic value for an attribute of my tag. but I'm 
gettin this error:
org.apache.jasper.compiler.ParseException: 
D:\jakarta-tomcat-3.2.1\webapps\mycompany\test.jsp(6,46) Attribute users 
has no value at 
org.apache.jasper.compiler.JspReader.parseAttributeValue(JspReader.java:499)


Here's my tag entry in my tld file

hi.tld

     <tag>
         <name>hello</name>
         <tagclass>mycompany.HelloTag</tagclass>
         <bodycontent>JSP</bodycontent>
         <attribute>
             <name>foo</name>
             <required>true</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
     </tag>

mycompany.HelloTag simply calls out.print(foo)

Here's the JSP that generates the error.
<hi:hello foo="<%= request.getParameter("users") %>" />

users doesn't actually exist in the request but it should just return null 
right ?
so when I change my jsp to this:
<%
String bar = request.getParameter("users");
%>
<hi:hello foo="<%= bar %>" />

it prints out "null" and works just fine.

Any suggestions ?
Thanx


Re: attribute blah has no value

Posted by Justin Kennedy <ju...@consortio.com>.
yea, that works great. I should've known better.

Thanx

At 02:24 PM 2/21/2001 -0800, you wrote:
>You are trying to use nested double quotes, which is probably confusing the
>parser somewhat. Try this instead:
>
><hi:hello foo='<%= request.getParameter("users") %>' />
>
>Hope this helps.
>
>--
>Martin Cooper
>Tumbleweed Communications
>
>
>----- Original Message -----
>From: "Justin Kennedy" <ju...@consortio.com>
>To: <st...@jakarta.apache.org>
>Sent: Wednesday, February 21, 2001 2:13 PM
>Subject: attribute blah has no value
>
>
> > HI all,
> >
> > I'm trying to use a dynamic value for an attribute of my tag. but I'm
> > gettin this error:
> > org.apache.jasper.compiler.ParseException:
> > D:\jakarta-tomcat-3.2.1\webapps\mycompany\test.jsp(6,46) Attribute users
> > has no value at
> >
>org.apache.jasper.compiler.JspReader.parseAttributeValue(JspReader.java:499)
> >
> >
> > Here's my tag entry in my tld file
> >
> > hi.tld
> >
> >      <tag>
> >          <name>hello</name>
> >          <tagclass>mycompany.HelloTag</tagclass>
> >          <bodycontent>JSP</bodycontent>
> >          <attribute>
> >              <name>foo</name>
> >              <required>true</required>
> >              <rtexprvalue>true</rtexprvalue>
> >          </attribute>
> >      </tag>
> >
> > mycompany.HelloTag simply calls out.print(foo)
> >
> > Here's the JSP that generates the error.
> > <hi:hello foo="<%= request.getParameter("users") %>" />
> >
> > users doesn't actually exist in the request but it should just return null
> > right ?
> > so when I change my jsp to this:
> > <%
> > String bar = request.getParameter("users");
> > %>
> > <hi:hello foo="<%= bar %>" />
> >
> > it prints out "null" and works just fine.
> >
> > Any suggestions ?
> > Thanx
> >

Justin Kennedy
Computer Systems Analyst
Consortio, Inc.
www.consortio.com


Re: attribute blah has no value

Posted by Martin Cooper <ma...@tumbleweed.com>.
You are trying to use nested double quotes, which is probably confusing the
parser somewhat. Try this instead:

<hi:hello foo='<%= request.getParameter("users") %>' />

Hope this helps.

--
Martin Cooper
Tumbleweed Communications


----- Original Message -----
From: "Justin Kennedy" <ju...@consortio.com>
To: <st...@jakarta.apache.org>
Sent: Wednesday, February 21, 2001 2:13 PM
Subject: attribute blah has no value


> HI all,
>
> I'm trying to use a dynamic value for an attribute of my tag. but I'm
> gettin this error:
> org.apache.jasper.compiler.ParseException:
> D:\jakarta-tomcat-3.2.1\webapps\mycompany\test.jsp(6,46) Attribute users
> has no value at
>
org.apache.jasper.compiler.JspReader.parseAttributeValue(JspReader.java:499)
>
>
> Here's my tag entry in my tld file
>
> hi.tld
>
>      <tag>
>          <name>hello</name>
>          <tagclass>mycompany.HelloTag</tagclass>
>          <bodycontent>JSP</bodycontent>
>          <attribute>
>              <name>foo</name>
>              <required>true</required>
>              <rtexprvalue>true</rtexprvalue>
>          </attribute>
>      </tag>
>
> mycompany.HelloTag simply calls out.print(foo)
>
> Here's the JSP that generates the error.
> <hi:hello foo="<%= request.getParameter("users") %>" />
>
> users doesn't actually exist in the request but it should just return null
> right ?
> so when I change my jsp to this:
> <%
> String bar = request.getParameter("users");
> %>
> <hi:hello foo="<%= bar %>" />
>
> it prints out "null" and works just fine.
>
> Any suggestions ?
> Thanx
>



Re: attribute blah has no value

Posted by Craig Tataryn <Cr...@msdw.com>.
What if you changed the outter quotes to single quotes?

<hi:hello foo='<%= request.getParameter("users") %>' />

I don't know if that makes a difference, but worth a try anyway.

<tataryn:craig/>

Justin Kennedy wrote:

> HI all,
>
> I'm trying to use a dynamic value for an attribute of my tag. but I'm
> gettin this error:
> org.apache.jasper.compiler.ParseException:
> D:\jakarta-tomcat-3.2.1\webapps\mycompany\test.jsp(6,46) Attribute users
> has no value at
> org.apache.jasper.compiler.JspReader.parseAttributeValue(JspReader.java:499)
>
> Here's my tag entry in my tld file
>
> hi.tld
>
>      <tag>
>          <name>hello</name>
>          <tagclass>mycompany.HelloTag</tagclass>
>          <bodycontent>JSP</bodycontent>
>          <attribute>
>              <name>foo</name>
>              <required>true</required>
>              <rtexprvalue>true</rtexprvalue>
>          </attribute>
>      </tag>
>
> mycompany.HelloTag simply calls out.print(foo)
>
> Here's the JSP that generates the error.
> <hi:hello foo="<%= request.getParameter("users") %>" />
>
> users doesn't actually exist in the request but it should just return null
> right ?
> so when I change my jsp to this:
> <%
> String bar = request.getParameter("users");
> %>
> <hi:hello foo="<%= bar %>" />
>
> it prints out "null" and works just fine.
>
> Any suggestions ?
> Thanx

--
I've been trying to change the world for years, but they just won't give me the
source code....