You can have the V (Swing) talk to M (Beans) via Soap/Axis easy and have re-use. This I do often.
If you used your controller via interfaces, you can call the business logic from SOAP as well. This I designed.... but have yet to test in a real world. (Remember question as to why I have interface on action?)

.V

Ortega, Carlos wrote:
It's four hours after I promissed my wife I'd be home and I'm sitting in the office scratching my head, wondering WHY struts won't load ActionForm classes.

In a previous thread I mentioned that when I deploy a working beta 1 Struts application on iPlanet 6.0 and attempt to load a JSP that references any ActionForm I get the following silly error:

javax.servlet.ServletException: Exception creating bean of class [YourActionFormClassHere!]

The form bean is found, but cannot be loaded?!? It get's even more interesting. I discovered that if I bypassed the JSP page and called the ".do" instead, in this case "logon.do", the form would actually load. The page had validation errors, as if the user had attempted to login without entering their user name and password.

After mentioning this on a previous thread Greg wisely mentioned using the controller to front all of my JSPs. In other words, create an action class that I would call to access the JSPs. So I created a class named RelayAction, designed to accept a "forward" name as an argument. Unfortuneatly, using it resulted in the same error. Here's where the head scratching begins. Why was the form able to load when I called the "Logon.do" and fail when I used RelayAction?

Long story short (and I may be too late), I discovered a key difference between the LogonAction and the RelayAction is how they are defined in struts-config.xml. Take a look at the two definitions:

LogonAction
-------------------------------
<action
   path="/logon"
   name="logonForm"
   type="app.forms.LogonAction"
   scope="request"
   input="/logon.jsp">
</action>

RelayAction
-------------------------------
<action
   path="/relay"
   type="app.forms.RelayAction">
</action>

I now know that calling "Logon.do" was able to load the form because when LogonAction fails, it forwards control to the "input" page, which is set to "/logon.jsp" above. The LogonAction code that does this is below:

if (!errors.empty()) {
   saveErrors(request, errors);
   return (new ActionForward(mapping.getInput()));
}

I don't understand why LogonAction class is able to load LogonForm using mapping.getInput() and the RelayAction cannot using mapping.findForward? They both return ActionForward. Can it be because there is a difference between mapping.getInput() and mapping.findForward()!?

If you've got pointers, please point-on. I need help here.

(going home now...)

Carlos Ortega



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

Reply via email to