You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Philip Tucker <ph...@valtech.com> on 2001/07/25 15:51:27 UTC

RE: accessing user-defined classes from html:select and html:opti ons tags

I added the import statement, but still get the same error.  It's in a
Struts method called "BeanUtils.populate".  I have the imported class in my
.WAR file, and I even tried placing it directly in the server class path,
but still the same error.  Any ideas?

Below is the full error text.

Thanks for the help,
Philip


Internal Servlet Error:

javax.servlet.ServletException: BeanUtils.populate
	at
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:774)
	at
org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.java:20
61)
	at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1563)
	at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
	at org.apache.tomcat.core.Handler.service(Handler.java:287)
	at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
	at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
	at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
	at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:213)
	at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
	at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
	at java.lang.Thread.run(Thread.java:484)

Root cause: 
java.lang.IllegalArgumentException: argument type mismatch
	at java.lang.reflect.Method.invoke(Native Method)
	at
org.apache.struts.util.PropertyUtils.setSimpleProperty(PropertyUtils.java:98
8)
	at
org.apache.struts.util.PropertyUtils.setNestedProperty(PropertyUtils.java:90
4)
	at
org.apache.struts.util.PropertyUtils.setProperty(PropertyUtils.java:932)
	at org.apache.struts.util.BeanUtils.populate(BeanUtils.java:509)
	at
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:772)
	at
org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.java:20
61)
	at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1563)
	at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
	at org.apache.tomcat.core.Handler.service(Handler.java:287)
	at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
	at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
	at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
	at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:213)
	at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
	at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
	at java.lang.Thread.run(Thread.java:484)

> -----Original Message-----
> From: eden [mailto:eden@jamethial.ath.cx]
> Sent: Monday, July 23, 2001 7:23 PM
> To: philip.tucker@valtech.com
> Subject: RE: accessing user-defined classes from html:select and
> html:options tags
> 
> 
> Hi!  I know you asked this question last Friday, but I didn't 
> see a response
> to it in the last several days.  So, in case you're still 
> wondering, yes -
> you've got to import that class into the jsp page in order 
> for it to be used
> in the page context.  And don't forget that it needs to be in your web
> server's classpath!
> 
> Hope this helps,
> Melissa
> Web Developer
> 
> -----Original Message-----
> From: Philip Tucker [mailto:philip.tucker@valtech.com]
> Sent: Friday, July 20, 2001 9:39 PM
> To: 'struts-user@jakarta.apache.org'
> Cc: Jyotisana Verma
> Subject: accessing user-defined classes from html:select and
> html:options tags
> 
> 
> I'm using Struts 1.0 with Tomcat 3.2.2 and JBoss 2.2.2.  I'm using an
> <hrml:select> containing an <html:options> tag in a JSP, with 
> the property
> attributes referring to form and bean fields.  It works fine 
> when the Java
> class of the 2 bean properties is String, but when I try to 
> use class I
> created I get an error.  I've verified my .class file is in 
> the deployment
> WAR file.
> 
> Do I have to do something special to use my own class?  Do I 
> need an import
> statement in the JSP?
> 
> Thanks,
> Philip
>