You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bryan Hunt <ad...@revoltingdigits.com> on 2004/06/24 19:06:59 UTC

unable to set html-el:link parameters

Good evening list users.

I have been trying to get html-el to work with JSTL in order to create a 
hyperlink. I am
getting the following error message

[ServletException in:/client/basket.jsp] Cannot find bean 
ie.jestate.bo.property.ForRentalProperty@1504a84 in any scope'

Here is the code.

snip=
  <c:forEach var="properties" items="${rentalPropertiesSelection}">
  <c:set var="property" value="${properties.value}"></c:set>
  <tr>
    <td>
       <c:out value="${property.id}"/>
     <html-el:link paramId="id" paramName="${property}" 
action="/client-property-view-for-rent-action" >
    <c:out value='${property.name}'/></html-el:link>
       </td>
  </tr>
  </c:forEach>
=snip

The ${property.id} is printed out just fine.

The ${property.name} is printed out just fine.

I am slowly going nuts, I've been trying to get this to work for hours 
now. I've never spent so much time on a hyperlink
in my life ... ;-)  Is this a abnormal behavior or do I just stay up 
past my bedtime to ofter ?

--b


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: unable to set html-el:link parameters

Posted by Mark Lowe <ma...@boxstuff.com>.
Not in plain struts tags it wasn't , before jstl and el were on the  
screen

<logic:iterate id="property" name="rentalPropertiesSelection"  
property="values">
	<html:link paramName="property"
			paramId="id"
			page="/myaction.do"
			><bean:write name="property" property="name" />
	</html:link>
</logic:iterate>

its just now jstl is around you can brew a strange mix. You can achieve  
what you want with JSTL and you'd probably be better doing that.

<c:forEach var="property" items="${rentalPropertiesSelection.values}">
	<c:url var="link" value="/myaction.do">
		<c:param name="id" value="${property.id}" />
	</c:url>
	<a href="${link}">${property.name}</a>
</c:forEach>

Using el outside of <c:out is possible in tomcat 5.

Mark

On 24 Jun 2004, at 19:29, Bryan Hunt wrote:

> Cheers Mark,
> You were correct, it is now working. Here is the correct code
>
> snip=
> <c:forEach var="properties" items="${rentalPropertiesSelection}">
> <c:set var="property" value="${properties.value}"></c:set>
> <tr>
>   <td>
>      <c:out value="${property.id}"/>
>    <html-el:link paramId="id" paramName="property" paramProperty="id"  
> action="/client-property-view-for-rent-action" >
>   <c:out value='${property.name}'/></html-el:link>
>      </td>
> </tr>
> </c:forEach>
> =snip
>
> I can't help but think that the workings of this tag are a little  
> convoluted.
>
> --b
>
>
>
> Mark Lowe wrote:
>
>> opps..
>>
>>
>> You need to access a method in you ForRentalProperty class if there's  
>> a getId() method then add paramProperty="id"
>>
>>
>>
>>
>> On 1 Jul 2004, at 19:17, Mark Lowe wrote:
>>
>>> Seeing as you're using jstl, there's more that one way but you might
>>>
>>> <c:url var="link" value="/client-property-view-for-rent-action">
>>>     <c:param name="id" value="${property}" />
>>> </c:url>
>>> <a href="<c:out value="${link}" />">
>>>
>>> or perhaps
>>>
>>> <html-el:link href="${link}">
>>>
>>> But i haven't used the htm-el lib in a while so could be wrong.
>>>
>>> Mark
>>>
>>>
>>>
>>> On 24 Jun 2004, at 19:06, Bryan Hunt wrote:
>>>
>>>> Good evening list users.
>>>>
>>>> I have been trying to get html-el to work with JSTL in order to  
>>>> create a hyperlink. I am
>>>> getting the following error message
>>>>
>>>> [ServletException in:/client/basket.jsp] Cannot find bean  
>>>> ie.jestate.bo.property.ForRentalProperty@1504a84 in any scope'
>>>>
>>>> Here is the code.
>>>>
>>>> snip=
>>>>  <c:forEach var="properties" items="${rentalPropertiesSelection}">
>>>>  <c:set var="property" value="${properties.value}"></c:set>
>>>>  <tr>
>>>>    <td>
>>>>       <c:out value="${property.id}"/>
>>>>     <html-el:link paramId="id" paramName="${property}"  
>>>> action="/client-property-view-for-rent-action" >
>>>>    <c:out value='${property.name}'/></html-el:link>
>>>>       </td>
>>>>  </tr>
>>>>  </c:forEach>
>>>> =snip
>>>>
>>>> The ${property.id} is printed out just fine.
>>>>
>>>> The ${property.name} is printed out just fine.
>>>>
>>>> I am slowly going nuts, I've been trying to get this to work for  
>>>> hours now. I've never spent so much time on a hyperlink
>>>> in my life ... ;-)  Is this a abnormal behavior or do I just stay  
>>>> up past my bedtime to ofter ?
>>>>
>>>> --b
>>>>
>>>>
>>>> -------------------------------------------------------------------- 
>>>> -
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: unable to set html-el:link parameters

Posted by Bryan Hunt <ad...@revoltingdigits.com>.
Cheers Mark,
You were correct, it is now working. Here is the correct code

snip=
<c:forEach var="properties" items="${rentalPropertiesSelection}">
 <c:set var="property" value="${properties.value}"></c:set>
 <tr>
   <td>
      <c:out value="${property.id}"/>
    <html-el:link paramId="id" paramName="property" paramProperty="id" 
action="/client-property-view-for-rent-action" >
   <c:out value='${property.name}'/></html-el:link>
      </td>
 </tr>
 </c:forEach>
=snip

I can't help but think that the workings of this tag are a little 
convoluted.

--b



Mark Lowe wrote:

> opps..
>
>
> You need to access a method in you ForRentalProperty class if there's 
> a getId() method then add paramProperty="id"
>
>
>
>
> On 1 Jul 2004, at 19:17, Mark Lowe wrote:
>
>> Seeing as you're using jstl, there's more that one way but you might
>>
>> <c:url var="link" value="/client-property-view-for-rent-action">
>>     <c:param name="id" value="${property}" />
>> </c:url>
>> <a href="<c:out value="${link}" />">
>>
>> or perhaps
>>
>> <html-el:link href="${link}">
>>
>> But i haven't used the htm-el lib in a while so could be wrong.
>>
>> Mark
>>
>>
>>
>> On 24 Jun 2004, at 19:06, Bryan Hunt wrote:
>>
>>> Good evening list users.
>>>
>>> I have been trying to get html-el to work with JSTL in order to 
>>> create a hyperlink. I am
>>> getting the following error message
>>>
>>> [ServletException in:/client/basket.jsp] Cannot find bean 
>>> ie.jestate.bo.property.ForRentalProperty@1504a84 in any scope'
>>>
>>> Here is the code.
>>>
>>> snip=
>>>  <c:forEach var="properties" items="${rentalPropertiesSelection}">
>>>  <c:set var="property" value="${properties.value}"></c:set>
>>>  <tr>
>>>    <td>
>>>       <c:out value="${property.id}"/>
>>>     <html-el:link paramId="id" paramName="${property}" 
>>> action="/client-property-view-for-rent-action" >
>>>    <c:out value='${property.name}'/></html-el:link>
>>>       </td>
>>>  </tr>
>>>  </c:forEach>
>>> =snip
>>>
>>> The ${property.id} is printed out just fine.
>>>
>>> The ${property.name} is printed out just fine.
>>>
>>> I am slowly going nuts, I've been trying to get this to work for 
>>> hours now. I've never spent so much time on a hyperlink
>>> in my life ... ;-)  Is this a abnormal behavior or do I just stay up 
>>> past my bedtime to ofter ?
>>>
>>> --b
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: unable to set html-el:link parameters

Posted by Mark Lowe <ma...@boxstuff.com>.
opps..


You need to access a method in you ForRentalProperty class if there's a 
getId() method then add paramProperty="id"




On 1 Jul 2004, at 19:17, Mark Lowe wrote:

> Seeing as you're using jstl, there's more that one way but you might
>
> <c:url var="link" value="/client-property-view-for-rent-action">
> 	<c:param name="id" value="${property}" />
> </c:url>
> <a href="<c:out value="${link}" />">
>
> or perhaps
>
> <html-el:link href="${link}">
>
> But i haven't used the htm-el lib in a while so could be wrong.
>
> Mark
>
>
>
> On 24 Jun 2004, at 19:06, Bryan Hunt wrote:
>
>> Good evening list users.
>>
>> I have been trying to get html-el to work with JSTL in order to 
>> create a hyperlink. I am
>> getting the following error message
>>
>> [ServletException in:/client/basket.jsp] Cannot find bean 
>> ie.jestate.bo.property.ForRentalProperty@1504a84 in any scope'
>>
>> Here is the code.
>>
>> snip=
>>  <c:forEach var="properties" items="${rentalPropertiesSelection}">
>>  <c:set var="property" value="${properties.value}"></c:set>
>>  <tr>
>>    <td>
>>       <c:out value="${property.id}"/>
>>     <html-el:link paramId="id" paramName="${property}" 
>> action="/client-property-view-for-rent-action" >
>>    <c:out value='${property.name}'/></html-el:link>
>>       </td>
>>  </tr>
>>  </c:forEach>
>> =snip
>>
>> The ${property.id} is printed out just fine.
>>
>> The ${property.name} is printed out just fine.
>>
>> I am slowly going nuts, I've been trying to get this to work for 
>> hours now. I've never spent so much time on a hyperlink
>> in my life ... ;-)  Is this a abnormal behavior or do I just stay up 
>> past my bedtime to ofter ?
>>
>> --b
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: unable to set html-el:link parameters

Posted by Mark Lowe <ma...@boxstuff.com>.
Seeing as you're using jstl, there's more that one way but you might

<c:url var="link" value="/client-property-view-for-rent-action">
	<c:param name="id" value="${property}" />
</c:url>
<a href="<c:out value="${link}" />">

or perhaps

<html-el:link href="${link}">

But i haven't used the htm-el lib in a while so could be wrong.

Mark



On 24 Jun 2004, at 19:06, Bryan Hunt wrote:

> Good evening list users.
>
> I have been trying to get html-el to work with JSTL in order to create 
> a hyperlink. I am
> getting the following error message
>
> [ServletException in:/client/basket.jsp] Cannot find bean 
> ie.jestate.bo.property.ForRentalProperty@1504a84 in any scope'
>
> Here is the code.
>
> snip=
>  <c:forEach var="properties" items="${rentalPropertiesSelection}">
>  <c:set var="property" value="${properties.value}"></c:set>
>  <tr>
>    <td>
>       <c:out value="${property.id}"/>
>     <html-el:link paramId="id" paramName="${property}" 
> action="/client-property-view-for-rent-action" >
>    <c:out value='${property.name}'/></html-el:link>
>       </td>
>  </tr>
>  </c:forEach>
> =snip
>
> The ${property.id} is printed out just fine.
>
> The ${property.name} is printed out just fine.
>
> I am slowly going nuts, I've been trying to get this to work for hours 
> now. I've never spent so much time on a hyperlink
> in my life ... ;-)  Is this a abnormal behavior or do I just stay up 
> past my bedtime to ofter ?
>
> --b
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org