Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActionClass is not being called when page is loading

Status
Not open for further replies.

liorza

Programmer
Mar 3, 2004
27
US
Hi all,
I have a login page that works fine. On success I would like to move to the next page. The page is loading but empty (no values were populated). I have print out to a log file at the beginning of my Execute method (ActionClass) but it is not getting written to the log (ActionClass for the login page is writing to the log).

Here are the last lines from the log file:
com.archismo.archismo.web.LoginAction - Ending LoginAction execute.
com.archismo.archismo.dao.hibernate.HibernateSessionManager - Session closed.
net.sf.hibernate.impl.SessionImpl - closing session
net.sf.hibernate.impl.SessionImpl - disconnecting session
net.sf.hibernate.connection.DriverManagerConnectionProvider - returning connection to pool, pool size: 1
net.sf.hibernate.impl.SessionImpl - transaction completion
org.apache.struts.action.RequestProcessor - processForwardConfig(ForwardConfig[name=success,path=/WEB-INF/Editor/main.jsp,redirect=false,contextRelative=false])
org.apache.catalina.core.ApplicationDispatcher - servletPath=/WEB-INF/Editor/main.jsp, pathInfo=null, queryString=null, name=null
org.apache.catalina.core.ApplicationDispatcher - Path Based Forward
org.apache.struts.util.RequestUtils - Looking for ActionForm bean instance in scope 'request' under attribute key 'frmMain'
org.apache.struts.util.RequestUtils - Creating new ActionForm instance of type 'com.archismo.archismo.web.MainForm'
org.apache.struts.util.RequestUtils - --> com.archismo.archismo.web.MainForm@23d275
org.apache.catalina.core.ApplicationDispatcher - Disabling the response for futher output

It looks like the ActionForm was found but I don’t see any sign of the Actionclass. It may have to do with the last line "Disabling ..."


Here is struts-config
<struts-config>
<form-beans>
<form-bean name="frmLogin" type="com.archismo.archismo.web.LoginForm"/>
<form-bean name="frmMain" type="com.archismo.archismo.web.MainForm"/>
</form-beans>

<!-- Action Mappings -->
<action-mappings>
<action path="/home" parameter="/WEB-INF/Editor/index.jsp" type="org.apache.struts.actions.ForwardAction"/>
<action path="/homeHeader" parameter="/WEB-INF/Editor/header.jsp" type="org.apache.struts.actions.ForwardAction"/>

<!--Login page-->
<action path="/login" input="/WEB-INF/Editor/login.jsp" type="com.archismo.archismo.web.LoginAction" name="frmLogin" scope="request" validate="false">
<forward name="success" path="/WEB-INF/Editor/main.jsp"/>
<forward name="failure" path="/WEB-INF/Editor/login.jsp"/>
</action>
<!--Main page-->
<action path="/main" input="/WEB-INF/Editor/main.jsp" type="com.archismo.archismo.web.MainAction" name="frmMain" scope="request" validate="false">
<forward name="load" path="/WEB-INF/Editor/main.jsp"/>
</action>
</action-mappings>

<!-- Message Resources -->
<message-resources parameter="ApplicationResources" null="false"/>

</struts-config>

Here is the first part of my ActionClass

public class MainAction extends Action
{

Log log = LogFactory.getLog(this.getClass());

public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception
{
ActionForward forward = null;
DAOFactory factory = DAOFactory.getFactory();
MainForm mainForm;
String userAction;
try
{
if (log.isDebugEnabled())
log.debug("Starting MainAction execute.");


forward = mapping.findForward("load");

Any idea?

Lior
 
Issue resolved...

I have modified the following in my starts-config
<action path="/login" input="/WEB-INF/Editor/login.jsp" type="com.archismo.archismo.web.LoginAction" name="frmLogin" scope="request" validate="false">
<forward name="success" path="/main.do"/>
<forward name="failure" path="/WEB-INF/Editor/login.jsp"/>
</action>

Also I have found some elements in my jsp that their type did not match the type in the form bean. For example I had a text field which had a name of xxx and in the form bean I had
List xxxx (instead of String).


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top