aspose file tools*
The moose likes Struts and the fly likes HTTP  Status 404 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "HTTP  Status 404" Watch "HTTP  Status 404" New topic
Author

HTTP Status 404

Subhradip Podder
Ranch Hand

Joined: Aug 27, 2007
Posts: 36
Hi,

Can anybody help me for my problem.i'm using struts+jdk 1.5+Apache 5.
My application flow is login.jsp->success.jsp->epcc8.jsp.
I get success.jsp from login.jsp but when trying to get epcc8.jsp,it will give me error [HTTP Status 404 - /success,The requested resource (/success) is not available.]


This is my struts-config.xml code

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">

<struts-config>
<data-sources />
<form-beans >
<form-bean name="loginForm" type="com.iotde.struts.form.LoginForm" />
<form-bean name="successForm" type="com.iotde.struts.form.SuccessForm" />


</form-beans>

<global-exceptions />
<global-forwards />
<action-mappings >
<action
attribute="loginForm"
input="/login.jsp"
name="loginForm"
path="/login"
scope="request"
type="com.iotde.struts.action.LoginAction">
<forward name="success" path="/success.jsp" />
<forward name="failure" path="/failure.jsp" />
</action>
<action
attribute="successForm"
input="/success.jsp"
name="successForm"
path="/success"
scope="request"
type="com.iotde.struts.action.SuccessAction">
<forward name="epcc8" path="/epcc8.jsp" />
<forward name="epcc6" path="/epcc6.jsp" />
</action>


</action-mappings>

<message-resources parameter="com.iotde.struts.ApplicationResources" />
</struts-config>

Plese help me.....
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14423
    
  23

This sounds like a Struts problem, not a Tomcat problem.

We have a special forum about Struts here on JavaRanch. I will move this topic there. Click on the link at the top of the page (see the big letters) to go to the copy in the Struts forum.
[ October 10, 2007: Message edited by: Jesper Young ]

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Show us your success.jsp and your SuccessAction.
[ October 10, 2007: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
Subhradip Podder
Ranch Hand

Joined: Aug 27, 2007
Posts: 36
Originally posted by Subhradip Podder:
Hi,

Can anybody help me for my problem.i'm using struts+jdk 1.5+Apache 5.
My application flow is login.jsp->success.jsp->epcc8.jsp.
I get success.jsp from login.jsp but when trying to get epcc8.jsp,it will give me error [HTTP Status 404 - /success,The requested resource (/success) is not available.]


This is my struts-config.xml code





<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">

<struts-config>
<data-sources />
<form-beans >
<form-bean name="loginForm" type="com.iotde.struts.form.LoginForm" />
<form-bean name="successForm" type="com.iotde.struts.form.SuccessForm" />


</form-beans>

<global-exceptions />
<global-forwards />
<action-mappings >
<action
attribute="loginForm"
input="/login.jsp"
name="loginForm"
path="/login"
scope="request"
type="com.iotde.struts.action.LoginAction">
<forward name="success" path="/success.jsp" />
<forward name="failure" path="/failure.jsp" />
</action>
<action
attribute="successForm"
input="/success.jsp"
name="successForm"
path="/success"
scope="request"
type="com.iotde.struts.action.SuccessAction">
<forward name="epcc8" path="/epcc8.jsp" />
<forward name="epcc6" path="/epcc6.jsp" />
</action>


</action-mappings>

<message-resources parameter="com.iotde.struts.ApplicationResources" />
</struts-config>

Plese help me.....




HI Merrill Higginson,

plese find bellow my sucess.JSP & successAction




<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>success.jsp</title>
<script language="javascript">
function validate()
{
var radio_choice = false;
for (counter = 0; counter < radio_form.project.length; counter++)
{
if (radio_form.project[counter].checked)
radio_choice = true;
}
if (!radio_choice)
{
alert("Please select a letter.")
return (false);
}
return (true);
}
</script>

</head>

<body>

<form method="post" action="/success"
onsubmit="return validate()" name="radio_form">

<CENTER>
<FIELDSET ID="fld1" style="HEIGHT: 200px; WIDTH: 700">
<LEGEND ALIGN="left"><font color="#804000"><b>Projects</b></font></LEGEND>

<table>

<tr>
<td><input type="radio" value="epcc8" name="project">EPCC-8</td>
<tr></tr>
<tr>
<td><input type="radio" value="epcc6" name="project">EPCC-6</td>
</tr>
<tr></tr>

</table>
</FIELDSET>

<table align="center">
<tr>
<td align="center" colspan="2"><input type="submit" value="Submit"></td>
</tr>
</table>
</CENTER>
</html:form>
</body>
</html>



/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.iotde.struts.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.iotde.struts.form.SuccessForm;

/**
* MyEclipse Struts
* Creation date: 10-09-2007
*
* XDoclet definition:
* @struts.action path="/success" name="successForm" input="/success.jsp" scope="request" validate="true"
* @struts.action-forward name="epcc8" path="epcc8.jsp"
* @struts.action-forward name="epcc6" path="epcc6.jsp"
*/
public class SuccessAction extends Action {
/*
* Generated Methods
*/

/**
* Method execute
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
SuccessForm successForm = (SuccessForm) form;// TODO Auto-generated method stub

if (successForm.getEpcc8().equals("epcc8"))
{
// we are in
return mapping.findForward("epcc8");
} else {
// not allowed
return mapping.findForward("epcc6");
}
}
}
[ October 10, 2007: Message edited by: Subhradip Podder ]
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The problem is in your success.jsp. If you use a Struts <html:form> tag, it's ok to reference the action as "/sucess", but with a plain html <form> tag, you must reference the action with the ".do" suffix as in "/success.do".
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTTP Status 404