• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

HTTP Status 404

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.....
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Show us your success.jsp and your SuccessAction.
[ October 10, 2007: Message edited by: Merrill Higginson ]
 
Subhradip Podder
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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".
reply
    Bookmark Topic Watch Topic
  • New Topic