Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java Open Source > Struts
| Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Struts section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old April 9th, 2014, 12:57 PM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2014
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default No action instance for path /welcomeAction could be created

Dear Struts Experts


Can somebody please help me with this problem? I am deploying war file on Weblogic. The application is done with Struts,

struts-config

<action-mappings>
<action path="/welcomeAction" type="com.refdata.welcome.WelcomeAction">
<forward name="welcomePage" contextRelative="true" path="/resources/jsp/common/index.jsp"/>
</action>

WelcomAction.java

/**
* <p><component description>.
* </p>
* <br><br>
*
* Name Date Description
* ----------------------------------------------------------<br>
*
*/

package com.refdata.welcome;

import com.refdata.common.Constants;
import com.refdata.common.RDMException;
import com.refdata.common.SessionInfo;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;

public class WelcomeAction extends Action { final Log log = LogFactory.getLog("com.refdata.welcome");



public WelcomeAction() {
}

public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { System.out.println("I am in WelcomeAction"); SessionInfo sessionInfo = new SessionInfo(); HttpSession session = request.getSession(false); // HttpSession session = null; ActionErrors errors = new ActionErrors(); String returnPage = null;

try {
if (session.isNew()) {
session = request.getSession();
}

String userId = (request.getParameter("User_Id") == null ? "Guest" : request.getParameter("User_Id")); //String userEdit = userId == "Guest"?"N":"Y"; String userEdit = (request.getParameter("user_edit") == null) ? "N" : request.getParameter("user_edit") ; String sessionId = session.getId(); long currDateTime = System.currentTimeMillis(); Date myDate = new Date(currDateTime); SimpleDateFormat dateFormat = new SimpleDateFormat(Constants.DATE_FORMAT);
sessionInfo.setUserId(userId);
sessionInfo.setUserEdit(userEdit);
sessionInfo.setStrSessionId(sessionId);

sessionInfo.setBusinessDate(dateFormat.format(myDa te)); session.setAttribute("SessionInfo", sessionInfo); returnPage = "welcomePage"; } catch (Exception e) { RDMException rdmEx = new RDMException(e); errors.add(ActionErrors.GLOBAL_MESSAGE, new ActionError("error.systemError.label1"));
errors.add(ActionErrors.GLOBAL_MESSAGE, new ActionError("error.systemError.label2", rdmEx.getMessage())); errors.add(ActionErrors.GLOBAL_MESSAGE, new ActionError("error.systemError.label3", rdmEx.getExceptionTrail())); errors.add(ActionErrors.GLOBAL_MESSAGE, new ActionError("error.commonMessage.label"));
saveErrors(request, errors);
returnPage = "errorPage";
}

return mapping.findForward(returnPage);
}
}

web.xml
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Struts Action Servlet Mappings -->
<!-- Note that because Struts takes the *last* mapping here as the extension to add to actions posted from forms, we must have *.do come after *.jpf. --> <servlet-mapping> <servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

URL

http ://localhost:7001/RDM/welcomeAction.do

I would greatly appreciate any help

Thank you

Eugene


Similar Threads
Thread Thread Starter Forum Replies Last Post
absolute path vs relative path for substitution group elements ptn77 XSLT 3 June 16th, 2011 10:04 AM
Need Help with path for loading Pics (app.path) Tabbasum Beginning VB 6 2 November 15th, 2007 04:57 AM
Request action on change and get no action. Help crussell Ajax 0 September 12th, 2007 11:11 AM
Implementing the all-path shortest path problem bitwords XSLT 1 December 6th, 2006 11:37 AM
No action instance for path /UserActivator could b du-it JSP Basics 0 June 3rd, 2003 02:51 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.