File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Struts-Portal Dispatch Action Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts-Portal Dispatch Action Problem" Watch "Struts-Portal Dispatch Action Problem" New topic

Struts-Portal Dispatch Action Problem

sally fikry

Joined: Mar 22, 2007
Posts: 1

I'm working on a JSR 168 portlet Struts project using Portal 5.1 and I'm using struts

In struts config, this Action is extending Dispatch Action
& i defined the parameter "userFunction" to hold the method value
<action name="SearchUserForm" path="/DispatcherAction" scope="session" type="DispatcherAction class path" input="/jsp/UserSearchBasicModule/SimpleSearch.jsp" parameter="userFunction">

The userFunction is an action form parameter that is set using hidden field as:
<html:hidden property="userFunction" value="xxx"/>

Back in the Action class itself, I added a method named xxx as:

public ActionForward xxx(ActionMapping mapping,
ActionForm form, ActionRequest request, ActionResponse response)
throws Exception {
// actions to do

And the unspecified method as:

protected ActionForward unspecified(ActionMapping mapping, ActionForm form,
ActionRequest request) throws Exception {
// actions to do
System.out.println("User Function = "
+ searchForm.getUserFunction());
Although the above println displays the correct value each time the DispatcherAction is invoked, the xxx() method is invoked only at the first time then the unspecified() method each other time on the same session as it can't find the parameter.

Any Ideas?

Thank in advance,
I agree. Here's the link:
subject: Struts-Portal Dispatch Action Problem
It's not a secret anymore!