DWR 1.1.1 version returning String Object in JDK6/JEE5 Weblogic Server

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

DWR 1.1.1 version returning String Object in JDK6/JEE5 Weblogic Server

Danny
Posts: 5
       
[Post New]posted Today 11:10:27 AM
Quote Edit
Struts version 1.2

<%@taglib uri="/WEB-INF/tld/struts-html.tld" prefix="HTML" %>

<HTML:radio property="vo.lookupParameters(searchBy)" value="code"></HTML:radio>

The vo.lookupParameters(searchBy) gets executed via DWR api.

I am trying to migrate a J2EE project from J2EE, JDK5 to JEE5, JDK6. from web-app_2_4 to web-app_2_5 and the jstl is upgraded from javax.servlet.jsp.jstl 1.1.2 to javax.servlet.jsp.jstl 1.2.

When I executed the above line in previous versions, the value vo.lookupParameters(searchBy) comes a String, but once migrated to the newer version, the value is coming in String Object and I am getting the following exception java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.lang.String

Am I missing something or should I upgrade the dwr version which is currently 1.1.1
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: DWR 1.1.1 version returning String Object in JDK6/JEE5 Weblogic Server

david@butterdev.com
I don't see this having anything to do with DWR (more like the taglib).  You can prove this by executing the remote function on the DWR test page.  I am sure you will still get a String back if you haven't changed anything else (the Java method still returns a String).
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: DWR 1.1.1 version returning String Object in JDK6/JEE5 Weblogic Server

david@butterdev.com
"When I executed the above line in previous versions, the value vo.lookupParameters(searchBy) comes a String, but once migrated to the newer version, the value is coming in String Object and I am getting the following exception java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.lang.String"

Are you sure you did not modify your Java method to return a String array?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: DWR 1.1.1 version returning String Object in JDK6/JEE5 Weblogic Server

Danny
You are right. I guess it is something to do with jstl and not sure though how will I attack the problem.

I am sorry and thanks a lot for your time.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: DWR 1.1.1 version returning String Object in JDK6/JEE5 Weblogic Server

david@butterdev.com
I really don't see how it ever worked.

<HTML:radio property="vo.lookupParameters(searchBy)" value="code"></HTML:radio>

The first problem is that tag libs are processed on the server.  If you want "vo.lookupParameters(searchBy)" to be a literal value than you probably have to change your syntax (if this is even possible, I don't use taglibs so I can't help you here).

The second problem is that DWR makes calls asynchronously.  So vo.lookupParameters is always going to return null (you don't get the value from the remote method call until the callback).  I really don't see how this ever could have worked.  

I think you need to think about what you are doing here and rework your code to make a bit more sense.
Loading...