• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Parsing error processing resource path ?

 
harish pathak
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am getting the following error:

-------------------------
Parsing error processing resource path.
------------------------
while running my first struts application.

following are my jsp and java file

regSuccess.jsp
----------------------
<html>
<head>
<title>
User Registration Was Successful!
</title>
</head>
<body>
<h1>User Registration Was Successful!</h1>
</body>
</html>
----------------------

strutsapp1/ (its a package inside classes directory)
UserRegistrationAction.java
-------------------------------
package strutsapp1;

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;

public class UserRegistrationAction extends Action
{
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
return mapping.findForward("success");

}
}
-------------------------------
struts-config.xml is as:

-----------------------
<action-mappings>
<action path="/userRegistration"
type="strutsapp1.UserRegistrationAction">
<forward name="success" path="/regSuccess.jsp"/>
</action>


</action-mappings>
-------------------------
web.xml file is as:

---------------------------

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>
<display-name>Struts Example Application</display-name>

<!-- Action Servlet Configuration -->
<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>2</load-on-startup>
</servlet>



<!-- Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

-------------------------------

So please look into the code and answer please.
What could be the problem.?

Thanks in advance
 
vidya sagar
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how u will make a request

This is a way to make a request, such that it display regSuccess.jsp
http://localhost portnumber)/(projectname)/userRegistration.do
 
Ganesh Kumar Kalamadugu
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by harish pathak:
Hi All,

I am getting the following error:

-------------------------
Parsing error processing resource path.
------------------------
while running my first struts application.

following are my jsp and java file

regSuccess.jsp
----------------------
<html>
<head>
<title>
User Registration Was Successful!
</title>
</head>
<body>
<h1>User Registration Was Successful!</h1>
</body>
</html>
----------------------

strutsapp1/ (its a package inside classes directory)
UserRegistrationAction.java
-------------------------------
package strutsapp1;

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;

public class UserRegistrationAction extends Action
{
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
return mapping.findForward("success");

}
}
-------------------------------
struts-config.xml is as:

-----------------------
<action-mappings>
<action path="/userRegistration"
type="strutsapp1.UserRegistrationAction">
<forward name="success" path="/regSuccess.jsp"/>
</action>


</action-mappings>
-------------------------
web.xml file is as:

---------------------------

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>
<display-name>Struts Example Application</display-name>

<!-- Action Servlet Configuration -->
<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>2</load-on-startup>
</servlet>



<!-- Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

-------------------------------

So please look into the code and answer please.
What could be the problem.?

Thanks in advance





change ur jsp

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<HTML>
<BODY>
<html:errors />

<html:form action="userRegistration.do">

<table>
<tr>
Product
</td>
<td><html:text property="symbol"/> </td>
</tr>
<tr><html:submit/></tr>
</table>
</html:form>
</BODY>
</HTML>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic