tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mufaddal Khumri <mufad...@wmotion.com>
Subject Re: Am i doing something wrong while using <jsp:setProperty ... /> ?????
Date Mon, 03 Mar 2003 05:44:25 GMT
I downcasted but it did not help.
	<jsp:useBean id="faqHelper" class="FAQHelper" scope="session">
		<jsp:setProperty name="faqHelper"
						 property="dbReader"
						 value="<%= (Object)session.getAttribute("DBREADER")%>" />
		<jsp:setProperty name="faqHelper"
						 property="dbWriter"
						 value="<%= (Object)session.getAttribute("DBWRITER")%>" />
	</jsp:useBean>

I went to the generated .Java file for the JSP .. its throwing an  
exception at this line :

       if (pageContext != null) pageContext.handlePageException(t);


On Monday, March 3, 2003, at 11:24  PM, Erik Price wrote:

>
>
> Mufaddal Khumri wrote:
>
> [...]
>
>> In my JSP page i have the following code
>> /  
>> /--------------------------------------------------------------------- 
>> -- ----------------
>>     <jsp:useBean id="myBean" class="MyBean" scope="session">
>>         <jsp:setProperty name="faqHelper"
>>                          property="dbReader"
>>                          value="<%=  
>> session.getAttribute("DBWRITER")%>" />
>>         <jsp:setProperty name="faqHelper"
>>                          property="dbWriter"
>>                          value="<%=  
>> session.getAttribute("DBWRITER")%>" />
>>     </jsp:useBean>
>> /  
>> /--------------------------------------------------------------------- 
>> -- ----------------
>> I get the following error in my log file:
>> 2003-03-03 10:23:51 StandardWrapperValve[jsp]: Servlet.service() for   
>> servlet jsp threw exception
>> org.apache.jasper.JasperException: FAQHelper
>
>
> In your <jsp:setProperty> tags, the "name" attribute should be the  
> same as a JavaBean instance identified with the "id" attribute of  
> <jsp:useBean>.
>
> So maybe it should look like this:
>
>   <jsp:useBean id="faqHelper" class="MyBean" scope="session"/>
>   <jsp:setProperty name="faqHelper" property="dbReader"
>                    value="<%= session.getAttribute("DBWRITER") %>"/>
>
> etc.
>
> Also you may need to downcast the value returned from  
> session.getAttribute().
>
>
> Erik
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>


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


Mime
View raw message