HTTP Status 404 - Invalid path was requested
document.forms[0].action=actionName+".htm";
should be changed to
document.forms[0].action=actionName+".do";
i am assuming *.do to be the url mapping for ActionServlet in web.xml
replace *.do with your extension (check your web.xml)
Java Questions
Updated on June 04, 2022Comments
-
Java Questions almost 2 years
i am developing an application using struts1.2.9 and the following is my folder structure.
once i login to the system it is fine and i get no issue, following is the home page.
and when i click on the menu which is there at the left side than i get the following exception and the page looks like this
HTTP Status 404 - Invalid path was requested
my menu link is like this :
<a href=\"#\" target=\"workFrame\" onclick=\"getMenuRequest('DepartmentAction','goToHome')\">"Department"</a>
and this the javascript :
function getMenuRequest(actionName,methodName){ document.forms[0].action=actionName+".htm"; document.forms[0].method.value=methodName; document.forms[0].submit(); }
the following is my action class method :
public ActionForward goToHome(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { //call method to verify Pagetoken forwardRequestTo = "departmentHome"; return mapping.findForward(forwardRequestTo); }
and the following is the struts-config.xml
<action path="/DepartmentAction" name="SecurEyesForm" type="com.secureyes.eswastha.struts.action.DepartmentAction" scope="request" parameter="method" validate="false"> <forward name="departmentHome" path="/WEB-INF/Masters/DepartmentMaster.jsp"></forward> </action>
i am using framsets.
now when i click on the menu name it is giving the above exception.
Please help.
Regards
-
Java Questions over 11 yearsThanks for the info but it did not help as this will not be an issue
-
zb226 about 7 years@JavaQuestions: Considering above comment, may I ask why you accepted the answer?
-
Zibbobz almost 4 yearsDownvoting this as it seems to only help a completely unrelated issue.