You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by jagadeesh kumar movva <jm...@yahoo.com> on 2003/10/10 06:55:21 UTC

forwarding value to view from Action

Hi,

I am trying to do this :

1. Take values from a jsp page.

2. Make a query from the values in Action class and
store it in a String.

3. Send the query as a parameter to another jsp page
where the query is sent to the database and the values
are displayed.

I have problem with (3). I use the following code in
the Action class:

<code>
request.setAttribute("query", query);
</code>

When I run, I get the following error on the console :

<error>
[WARN] RequestProcessor - -Unhandled Exception thrown:
class java.lang.ClassCastException
</error>

and the following error is displayed on the browser :

<error>
javax.servlet.ServletException: java.lang.String
	at
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:545)
	at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:486)
	at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
	at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
............................
</error>

I read in a tutorial that we should use a bean while
forwarding a parameter, but it is unclear how to use
it. Can anybody give an idea?

Thanks
Jag

________________________________________________________________________
Yahoo! India Matrimony: Find your partner online.
Go to http://yahoo.shaadi.com

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