You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Kumari, Ramana" <Ra...@DFA.STATE.NY.US> on 2002/03/22 23:58:35 UTC
reg Forward action
Hi
I am trying to forward request from my Action class to a JSP (which is
configured for forward aciton in struts-config.xml).
When i submit the page i see the action is fired but it is not forwarding
the request to specified JSP. since i could see no
output on my browser . When i see my jsp_servlet folder the corresponding
class file for the forwarded JSP is not found.
My app is running on Weblogic 6.1 server.
I am wondering if someone could help me in figuring out of what is
happening !
My Action Class follows
public final class ReferralLoginCompleteAction extends Action {
public ActionForward perform(ActionMapping mapping,
ReferralForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
System.out.println("in ReferralLoginCompleteAction perform() ");
if (form instanceof ReferralForm) {
ReferralForm theForm = (ReferralForm) form;
String dateReceived = theForm.getDateReceived();
String workerName = theForm.getWorkerName();
String referralNumber = theForm.getReferralNumber();
HttpSession session = request.getSession();
System.out.println("before forwarding "+ dateReceived
+workerName+referralNumber);
request.setAttribute("dateReceived", dateReceived);
request.setAttribute("referralNumber",
referralNumber);
request.setAttribute("workerName", workerName);
return (mapping.findForward("referral"));
}
else
return null;
}
}
My struts-config.xml file is in \web-inf\conf directory.
My classes are in \web-inf\classes directory.
My struts configuration follows
<struts-config>
<form-beans>
<form-bean name="referralForm"
type="assets.icr.referral.model.ReferralForm"/>
</form-beans>
<action-mappings>
<action path="/loginComplete"
type="assets.icr.referral.webController.ReferralLoginCompleteAction"
name="referralForm"
scope="request">
<forward name="referral" path="/result.jsp" />
</action>
</action-mappings>
</struts-config>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: reg Forward action
Posted by Mikael Eriksson <mi...@connection.se>.
Hi
Since the perform method should take an ActionForm as its form parameter
and not an ReferralForm your perform is probably not called at all...
change the declaration and cast the form to a ReferralForm inside.
If you do get inteo the perform method, try to put in some more trace printouts
to see that you are not returning null or something like that.
Regards
Mikael
At 17:58 2002-03-22 -0500, you wrote:
>Hi
>
> I am trying to forward request from my Action class to a JSP (which is
>configured for forward aciton in struts-config.xml).
> When i submit the page i see the action is fired but it is not forwarding
>the request to specified JSP. since i could see no
> output on my browser . When i see my jsp_servlet folder the corresponding
>class file for the forwarded JSP is not found.
>
>
>public final class ReferralLoginCompleteAction extends Action {
> public ActionForward perform(ActionMapping mapping,
> ReferralForm form,
> HttpServletRequest request,
> HttpServletResponse response)
> throws IOException, ServletException {
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>